Skip to content

Prototype shortcuts settings layouts - #204

Open
Mamdouh66 wants to merge 5 commits into
bholmesdev:mainfrom
Mamdouh66:Mamdouh66/custom-shortcuts-tab
Open

Prototype shortcuts settings layouts#204
Mamdouh66 wants to merge 5 commits into
bholmesdev:mainfrom
Mamdouh66:Mamdouh66/custom-shortcuts-tab

Conversation

@Mamdouh66

Copy link
Copy Markdown
Contributor

Description

Related to #194.

This is a deliberately throwaway, dev-only UI prototype for choosing the direction of the Shortcuts settings experience. It adds three switchable layouts inside the existing Settings dialog:

  • Sidebar navigator — settings categories in a persistent left rail
  • Grouped cards — General/Shortcuts tabs with App and Editor command cards
  • Command table — a dense, search-first command list

Each variant projects the same 33-command mock registry and supports in-memory search, shortcut recording, duplicate/reserved-key feedback, disable, reset, and reset-all states. Use the floating switcher, Left/Right arrow keys, or open ?variant=sidebar, ?variant=tabs, or ?variant=table in the renderer URL.

This PR intentionally does not choose TanStack Hotkeys, persist bindings, update Electron menus, or wire shortcuts to runtime commands. Those decisions belong in the follow-up implementation after a layout is selected and the command-registry work is available.

Type of Change

  • New feature (non-breaking change which adds functionality)

Testing

  • Existing tests pass
  • Added new tests for changes
  • Tested manually (describe below)

Manual Testing Details:

  • Ran pnpm check
  • Ran pnpm build:desktop
  • Ran the full pnpm build
  • Launched the Electron desktop app with CDP and inspected all three variants
  • Verified direct variant URLs auto-open Settings
  • Verified successful recording, duplicate-conflict feedback, Escape cancellation, search filtering, and state continuity across variants
  • Verified the existing General settings remain accessible
  • Visually checked light and dark themes at the default 920 × 720 desktop viewport

Checklist

  • I discussed this change in a GitHub issue before submitting this PR
  • I have run the linter, formatter, and tests to ensure my code is ready for review

Prototype limitations

Co-Authored-By: Oz <oz-agent@warp.dev>
@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

@Mamdouh66 is attempting to deploy a commit to the bholmesdev's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Mamdouh66 Mamdouh66 mentioned this pull request Jul 28, 2026
6 tasks
Co-Authored-By: Oz <oz-agent@warp.dev>
@Mamdouh66

Copy link
Copy Markdown
Contributor Author

Addressed the critical review findings in ba2987b:

  • canonicalized modifier order and kept macOS Control distinct from Command
  • made the recorder mirror keymatch physical letter/digit semantics, including Alt/Shift dead-key composition
  • reject invalid bare/system/fixed/literal-plus bindings with inline feedback
  • validate individual resets so they cannot create duplicate bindings
  • keep the sidebar/tabs/table navigation fixed while content scrolls
  • aligned command copy/content across all three variants
  • moved the dev gate so the prototype is absent from production bundles

Verification:

  • pnpm build
  • pnpm build:desktop
  • Electron interaction checks for modifier order, Control vs Command, duplicate reset, OS interception, physical/composed keys, fixed zoom shortcuts, and literal + rejection
  • production renderer bundle checked for prototype strings (absent)
  • final Standards and Spec re-reviews: approved, zero unresolved important findings

@Mamdouh66
Mamdouh66 marked this pull request as ready for review July 30, 2026 08:12
@Mamdouh66

Copy link
Copy Markdown
Contributor Author

@bholmesdev wdyt?

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

Dev-only throwaway prototype for #194: three switchable Shortcuts settings layouts (sidebar / grouped cards / table) over a 33-command mock registry, with in-memory search, recording, conflict feedback, disable/reset. Production Settings path stays behind import.meta.env.DEV; SettingsDialog gains an optional width override.

Scope matches the PR intent — no persistence, menu wiring, or hotkey runtime. Fine as a layout-direction spike.

Concerns

  • ArrowLeft/Right variant cycling is a window-level listener while Settings is open; easy to trigger accidentally and it rewrites the URL.
  • Grouped-cards search empty state is inconsistent with the other two layouts.
  • useCallback fights the desktop React Compiler guidance (apps/desktop/AGENTS.md).
  • Optional: confirm the unconditional ShortcutsSettingsPrototype import is dropped from prod bundles (Vite usually DCE's the DEV branch; worth a quick check).

None of these block a prototype merge.

Verdict

Found: 0 critical, 0 important, 3 suggestions

Approve with nits


Reviewed by a Warp Factory agent.

Comment thread apps/desktop/src/components/ShortcutsSettingsPrototype.tsx Outdated
Comment thread apps/desktop/src/components/ShortcutsSettingsPrototype.tsx
Comment thread apps/desktop/src/components/ShortcutsSettingsPrototype.tsx Outdated

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

Dev-only throwaway prototype for #194: three Shortcuts settings layouts (sidebar / grouped cards / table), mock 33-command registry, in-memory record/validate/reset, wired through Settings via import.meta.env.DEV. Prod settings path stays the stacked sections; SettingsDialog just gains an optional className.

Concerns

  • No blocking correctness/security issues for a DEV-gated prototype.
  • resetAll restores pure defaults and drops the seeded demo rows (app.new-file customized, app.chat-about-note disabled), so “Reset all” no longer matches first-load demo state.
  • PR text mentions Left/Right arrow keys to cycle variants; only the floating ←/→ buttons are wired (fine if copy meant those controls).
  • Prototype root is a fragment under Settings’ divide-y wrapper, so the fixed switcher is a second child and can leave a stray divider.

Verdict

Found: 0 critical, 0 important, 3 suggestions

Approve with nits


Reviewed by a Warp Factory agent.

Comment on lines +461 to +465
const resetAll = () => {
setBindings(initialBindings());
setErrors({});
setRecordingId(null);
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 [SUGGESTION] resetAll uses pure initialBindings(), but mount seeds app.new-file / app.chat-about-note for demo. Extract one demoBindings() used by both so Reset all matches first paint.

Comment on lines +1045 to +1050
const currentIndex = variants.findIndex(({ id }) => id === current);
const cycle = (direction: -1 | 1) => {
const nextIndex =
(currentIndex + direction + variants.length) % variants.length;
onChange(variants[nextIndex].id);
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 [SUGGESTION] PR claims Left/Right arrow keys cycle variants; only buttons call cycle. If keyboard cycling is desired, add a window keydown handler here when !recording (ignore when focus is in an input).

Comment on lines +513 to +526
<>
{variant === "sidebar" ? (
<SidebarVariant {...props} />
) : variant === "tabs" ? (
<TabsVariant {...props} />
) : (
<TableVariant {...props} />
)}
<PrototypeSwitcher
current={variant}
onChange={chooseVariant}
recording={state.recordingId !== null}
/>
</>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 [SUGGESTION] Fragment makes the fixed switcher a second child of Settings’ divide-y container (possible stray divider). Render the active variant as the only dialog child and portal/mount the switcher outside that wrapper.

@Mamdouh66

Copy link
Copy Markdown
Contributor Author

@bholmesdev do u think we should continue here or not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant