Skip to content

Keyboard control wave 3: ⌘/ key list, fuller menu bar, focus after onboarding - #662

Merged
sambitcreate merged 9 commits into
mainfrom
claude/project-thread-aiyeon
Oct 30, 2026
Merged

sambitcreate merged 9 commits into
mainfrom
claude/project-thread-aiyeon

Conversation

@sambitcreate

@sambitcreate sambitcreate commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Wave 3 of 3 from the keyboard-control audit. Wave 1 was #619 and wave 2 was #641. The owner chose all three waves ("1c 2a 3a").

What changes for the person

  • ⌘/ opens a list of every key.
    • It shows the keys as set in Settings, so a changed key shows as changed and a turned-off key is left out.
    • It also lists the fixed keys: F6, the sidebar arrows, Shift+F10, Esc, ↑ to resend, ⌥↑/⌥↓, Find's ↩/⌘G, and the approval keys.
    • The groups are General, Moving around, In a chat and Workspace. ⌘1–⌘9 show as one row while they keep their defaults.
    • Search matches titles, when a key applies, and the keys as shown on this computer (⌘F on a Mac, Ctrl+F on Linux).
    • Change keys… opens Settings → Keyboard shortcuts. Esc gives focus back to where it was.
    • ⌘/ is a new catalog command, so it can be changed in Settings and works while typing.
    • On narrow windows only the "or" alternative of a long key wraps to a second line; each key pair stays on one line.
  • Settings → Keyboard shortcuts gains a "Built-in keys" group under the keys you can change. The page's search covers it too.
  • A fuller menu bar.
    • View gains toggles for the sidebar, terminal and Environment, plus Focus Sidebar, Focus Conversation and Focus Side Panel.
    • A new Go menu has Back, Forward, Previous/Next Chat, Search Chats…, Bots, Open a Bot…, Scheduled and Profile.
    • A new Chat menu has Change Model…, Attach Files…, Find in Chat, Stop Reply, Rename…, Duplicate, Fork…, Compact, Export, Copy Last Reply, Chat Details, Change Folder Access and Delete….
    • Help gains Keyboard Shortcuts.
    • Every item shows its current key. An item is greyed out when nothing on screen can run it. For example, Stop Reply is greyed out while no reply is streaming, and every chat item is greyed out on the Settings page.
  • Focus after onboarding: finishing first-run setup puts the cursor in the message box, including when setup opens a Bot's chat.

Implementation notes

  • Menu keys stay with the page.
    • The new menu items are built with registerAccelerator: false, so they show the key without the OS taking it. The page's own command system keeps the key and its rules (editable targets, terminal scope).
    • macOS still fires such an item when the page leaves its key alone (the terminal) or never sees it (inside an artifact frame). It also fires it for a key assigned under System Settings → App Shortcuts.
    • firedByShortcut drops any triggeredByAccelerator activation that carries a modifier. Electron also reports Return in an open menu as triggeredByAccelerator, but Return carries no modifier, so choosing with the arrow keys and Return still works, as does clicking.
    • Pullfrog's review found each of these cases over three rounds: an echo match that missed on non-QWERTY layouts and in frames, a boolean guard that blocked Return, and a binding match that missed App Shortcuts.
    • The renderer reports which commands have a handler right now over app:setMenuCommands. This is debounced and skips repeats. Main rebuilds the menu only when that list changes.
    • Existing menu-owned keys (nativeMenu commands) are unchanged.
  • New files:
    • renderer/shared/built-in-keys.ts: one list for the sheet, Settings and docs.
    • renderer/lib/shortcut-sheet.ts: grouping and search.
    • renderer/components/keyboard-shortcuts-dialog.tsx
  • Focus after onboarding: focusRegionWhenShown in renderer/lib/focus-regions.ts keeps trying for up to 2 s, until the composer exists.
    • It refocuses if the composer is swapped out, which happens when setup opens a Bot's chat.
    • It stops as soon as the person moves focus themselves.
    • focusRegion now checks nodeType instead of instanceof Document, which threw under happy-dom.

Screenshots (light and dark)

These are in the project files under keyboard-control/wave3/:

  1. The ⌘/ key list
  2. The key list searched for "approval"
  3. Settings → Built-in keys
  4. The Chat, Go and View menus. These are Linux system-drawn menus, so they look the same in both modes.

Tests

  • New:
    • renderer/lib/shortcut-sheet.test.ts (4)

    • renderer/components/keyboard-shortcuts-dialog.test.tsx (5): custom keys, search, Change keys…, Esc returning focus, the Settings group, and menu availability with menu clicks. The focus test fails without its fix.

    • focus-regions (+3): a late composer, a swapped composer, and focus the person moved.

    • application-menu-core (+5). The darwin test covers:

      • a mouse choice
      • Return on a bound item and on an unbound item
      • the item's own key
      • a ⌘⌥ App Shortcut on an unbound item, and on a bound item with different modifiers

      It fails with no guard, with the boolean-only guard, and with the binding-match guard.

    • command-system-core (+1): ⌘/ works from editable targets but not the terminal.

    • The native-menu-command-contract first test is rewritten so that only nativeMenu commands register keys.

  • Registration: the new tests are in test:command-system and scripts/ci-test-registry.json (renderer-other).
  • New e2e:
    • In chat-shell-interactions.spec.ts: composer focus after onboarding, then ⌘/ opens the list, search narrows it and Esc closes it. It also checks the Help item's key (Command+/ on macOS, CommandOrControl+/ elsewhere), which items are greyed out, and that clicking the menu item opens the list.
    • bots-starter.spec.ts checks Bot composer focus after onboarding.
  • Local results:
    • test:command-system (141), test:sidebar, test:linux-contracts and the onboarding tests pass.
    • The e2e specs chat-shell-interactions, bots-starter, onboarding-lmstudio and settings-unification › "all Settings pages fit narrow and wide windows" pass.
    • tsc (app and e2e) and eslint are clean on the new base.
  • Needs a real Mac: this runner is Linux, so arrows plus Return in the menu bar, and a shortcut pressed in the terminal, are still to be checked on a Mac.
  • Local flakes, recorded per AGENTS.md:
    • use-assistant-live › "busy setup close transition" failed once while the full renderer-other lane ran under load. It passes alone.
    • The branding test fails locally on plutil ENOENT. It is Mac-only and unrelated to this change.
  • Hosted CI flake, recorded per AGENTS.md: core-git, main/services/git.test.ts › "GitService reconciles a timeout after the exact branch ref was updated" failed with GitServiceError: Git did not finish within 1 seconds (run). This PR does not touch git code, and the test passed on the next head.

Docs

  • docs/keyboard.md adds the ⌘/ row and a "Keyboard list and menu bar" section, which also covers focus after setup. Its fixed-keys note points to built-in-keys.ts and the Settings list.
  • The README keyboard line mentions ⌘/ and the View, Go and Chat menus.

🤖 Generated with Claude Code

https://claude.ai/code/session_018VA6RFnvTu7rNwP4JpjJMZ

…boarding

- ⌘/ (and Help → Keyboard Shortcuts) opens a searchable list of every key as
  set in Settings plus the built-in keys; Settings → Keyboard shortcuts lists
  the built-in keys too. The new ⌘/ default yields to a saved shortcut.
- The menu bar gains View, Go and Chat menus and Help → Keyboard Shortcuts.
  These items show the current key without taking it from the page, and grey
  out while the app can't run them (the renderer reports what it can run).
  On macOS a menu key the page already saw is dropped.
- When first-run setup finishes, the message box takes focus, including a
  Bot's chat opened from setup.
- docs/keyboard.md and README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RFnvTu7rNwP4JpjJMZ
…ading ids

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RFnvTu7rNwP4JpjJMZ

@pullfrog pullfrog 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.

Important

The native accelerator fallback can bypass keyboard scope restrictions on macOS. One finding needs addressing before merge.

Reviewed changes across the complete PR, including the keyboard list, native menu integration, and onboarding focus lifecycle.

  • Keyboard list: Adds customizable Command+/, searchable saved and built-in bindings, grouped presentation, focus restoration, and a link to Settings.
  • Shortcut Settings: Adds searchable built-in keys and conflict-safe migration for the new default shortcut.
  • Native menus: Extends View, Go, Chat, and Help, reports renderer command availability to main, and distinguishes menu clicks from accelerator echoes.
  • Onboarding focus: Retries composer focus after setup closes, including replacement composers when opening a Bot chat.
  • Verification: Command-system tests passed (142), menu tests passed (7), onboarding tests passed (82), and e2e type-checking passed. A targeted mounted probe reproduced the scope bypass with a simulated native accelerator callback; physical macOS Electron e2e was not run on this Linux runner.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

Comment thread renderer/lib/command-system.tsx Resolved
macOS still fires an item built with registerAccelerator: false when the
page leaves its key alone (the terminal) or never sees it (an artifact
frame). Matching that echo against the last keydown missed on non-QWERTY
layouts and in frames, so the menu ran the command behind the page's
scope rules. Key-triggered clicks on these items now do nothing; the page
alone decides what its keys do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RFnvTu7rNwP4JpjJMZ

@pullfrog pullfrog 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.

Important

The scope bypass is fixed, but the new filter also prevents keyboard selection of renderer-owned native menu items on macOS.

Reviewed changes since the previous Pullfrog review at 5111cf181, scoped to f85c40dac.

  • Blocked native accelerator callbacks: Moved filtering into the menu callback so unmatched native shortcuts cannot bypass renderer keyboard scopes.
  • Removed echo matching: Deleted last-keydown tracking, the menu-key payload field, and the obsolete matching helper and tests.
  • Updated menu coverage: Adjusted callback and mounted tests to the simplified notification contract. The command suite passed all 141 tests, and the menu/readiness-contract suites passed all 13 tests; a targeted callback probe reproduced the keyboard-menu regression. Native macOS interaction was not executed on this Linux runner.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

Comment thread main/services/application-menu-core.ts Resolved
Electron reports every non-mouse activation as triggeredByAccelerator,
so the previous guard also dropped choosing an item with the arrow keys
and Return. A press of the item's own shortcut is now recognised by the
modifiers held, which every shortcut has and menu selection doesn't.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RFnvTu7rNwP4JpjJMZ

@pullfrog pullfrog 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.

Important

Return-based menu selection is restored, but macOS user-assigned menu shortcuts can now bypass renderer keyboard scopes.

Reviewed changes since the previous Pullfrog review at f85c40dac, scoped to a7f868302.

  • Refined native activation filtering: Replaced the blanket accelerator guard with canonical-binding modifier comparison to preserve modifier-free Return selection.
  • Expanded macOS callback coverage: Added mouse selection, Return on bound and unbound items, and canonical shortcut suppression cases.
  • Verified the delta: Passed all 141 command-system tests and all 13 menu/ownership-contract tests. A targeted callback probe reproduced the user-assigned-shortcut bypass; physical macOS interaction was not run on this Linux runner.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

Comment thread main/services/application-menu-core.ts Resolved
macOS App Shortcuts can give a menu item a key Aiden doesn't know about,
so comparing against Aiden's binding let those through. Any key
activation that carries a modifier is now treated as a shortcut; Return
in an open menu carries none and still chooses the item.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RFnvTu7rNwP4JpjJMZ

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes since the previous Pullfrog review at a7f868302, scoped to db464778a.

  • Removed binding-dependent filtering: Suppressed modifier-bearing native shortcut callbacks regardless of Aiden's saved binding, closing the macOS App Shortcuts bypass while preserving modifier-free Return selection and mouse clicks.
  • Extended callback coverage: Added OS-assigned shortcut cases for both unbound items and bound items with different canonical modifiers.
  • Verified keyboard behavior: Passed all 141 command-system tests and all 13 menu/ownership-contract tests. All prior review threads are resolved. Physical macOS menu interaction remains unverified on this Linux runner.

Pullfrog  | View workflow run | Using gpt-6.1-sol | 𝕏

@very-hermes-bot

very-hermes-bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Hermes Review Bot

Confidence: 5

Engine: agy/gemini-3.8-flash-high
Review mode: full
Head: 08ac7353af1d90317ada36194a521f58659c0b94
Generated: 2026-10-30T04:27:54+00:00
Reviews: 1

Summary

This change implements wave 3 of the keyboard-control improvements by introducing a searchable ⌘/ keyboard shortcuts dialog, an expanded native menu bar (View, Go, Chat, and Help menus), a built-in keys reference section in Settings, and post-onboarding composer auto-focus. The renderer reports its currently runnable commands to the main process via app:setMenuCommands to dynamically grey out inactive menu items, while renderer-owned menu items use registerAccelerator: false and filter modifier-bearing activations in firedByShortcut so keystrokes remain subject to in-page scope boundaries (like terminal input or iframe focus). Setup-completion focus is managed by focusRegionWhenShown, which polls via requestAnimationFrame for up to 2 seconds to reliably focus the composer even across asynchronous Bot chat navigation while gracefully yielding if the user manually navigates away. A maintainer should verify native macOS menu selection using keyboard navigation (Arrow keys + Return) versus mouse clicks across varying system keyboard layouts.

Confidence Score: 5/5

Fully traced and verified across main-process menu template construction, IPC command filtering, renderer command availability reporting, focus management, and dialog accessibility.

📁 Important Files Changed
  • main/services/application-menu-core.ts: Adds View, Go, Chat, and Help menus; introduces shownItem with registerAccelerator: false, parseMenuCommandIds validation, and firedByShortcut event filtering.
  • main/index.ts: Handles the app:setMenuCommands IPC channel, tracks available commands and cached menu inputs, and rebuilds the application menu on command state changes.
  • renderer/components/keyboard-shortcuts-dialog.tsx: Implements the ⌘/ searchable shortcuts sheet with grouped sections, KeyCombo accelerator badges, and focus return to the previously focused element upon dismissal.
  • renderer/lib/shortcut-sheet.ts: Normalizes and filters commands and built-in keys into General, Moving around, In a chat, and Workspace sections; coalesces default ⌘1–⌘9 jump shortcuts into a single range.
  • renderer/shared/built-in-keys.ts: Centralizes the definition of non-customizable keys (F6 navigation, sidebar arrows, approval keys, Find in chat steps).
  • renderer/components/settings/shortcut-settings.tsx: Renders the new "Built-in keys" section beneath customizable shortcuts and integrates them into search filtering.
  • renderer/lib/focus-regions.ts: Enhances focusRegion with a safe nodeType check and implements focusRegionWhenShown with a 2-second timeout and user-focus cancellation.
  • renderer/lib/command-system.tsx: Debounces and synchronizes active command handler IDs to the main process over IPC whenever handlers or modals update.
  • renderer/shared/keybindings.ts: Adds shortcuts.show to the catalog (⌘/), includes it in INTRODUCED_DEFAULT_COMMANDS for conflict resolution, and registers the Mac Backspace symbol (⌫).
  • main/services/application-menu-core.test.ts, renderer/components/keyboard-shortcuts-dialog.test.tsx, renderer/lib/shortcut-sheet.test.ts, renderer/lib/focus-regions.test.tsx: Provide unit, contract, and DOM integration tests for menu construction, shortcut filtering, accelerator suppression, and focus retention.

Findings

No findings.

Sequence Diagram

sequenceDiagram
  autonumber
  participant R as Renderer (CommandSystem)
  participant IPC as Electron IPC Bridge
  participant M as Main Process (AppMenu)
  participant OS as Native Menu Bar

  Note over R: Route / handler state changes
  R->>IPC: invoke("app:setMenuCommands", [activeCommandIds])
  IPC->>M: handle("app:setMenuCommands")
  M->>M: parseMenuCommandIds() & diff vs current
  M->>OS: Menu.setApplicationMenu(rebuiltMenu)
  Note over OS: Items enabled/disabled per available set

  alt User selects menu item via click or Return
    OS->>M: MenuItem.click(event)
    M->>M: firedByShortcut(event) == false
    M->>IPC: deliverMainWindowNotification("app:command", { commandId })
    IPC->>R: onNotification("app:command")
    R->>R: execute(commandId)
  else User presses shortcut inside page
    Note over R: keydown captured by DOM listener
    R->>R: execute(commandId)
    Note over OS: MenuItem accelerator not registered (ignored)
  end
Loading
[]

Last reviewed commit: 08ac7353af1d
Reviews (1) · Comment /hermes review to trigger a new review · /hermes review full for full re-review

The Find row's "Enter / Shift+Enter or Ctrl+G / Ctrl+Shift+G" couldn't
shrink, so Settings → Keyboard shortcuts scrolled sideways at 390px
(settings-unification e2e). The combo now wraps within 60% of the row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RFnvTu7rNwP4JpjJMZ

@pullfrog pullfrog 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.

No new issues found.

Reviewed changes since the previous Pullfrog review at db464778a, scoped to 5ab14593f.

  • Constrained key-chip width: Replaced the non-shrinking shortcut group with a 60% maximum width, allowing alternatives to wrap in the keyboard dialog and Settings built-in-key rows without changing shortcut behavior.
  • Verified affected behavior: Passed all 141 command-system tests, including the mounted dialog and Settings tests. CSS wrapping was inspected in both callers but not measured in a real browser; physical macOS menu interaction remains unverified.

Pullfrog  | View workflow run | Using gpt-6.1-sol | 𝕏

Copy link
Copy Markdown
Owner Author

Desktop tests (core-git) failed on 5ab1459. 3987 of 3988 tests passed. The one failure is main/services/git.test.ts › "GitService reconciles a timeout after the exact branch ref was updated" (GitServiceError: Git did not finish within 1 seconds), on the macOS runner.

This isn't from this PR. Nothing here touches GitService, git.ts or its tests: the diff is keyboard, menu and Settings UI only. The test gives Git a 1-second deadline, so it is sensitive to runner load, and the same lane passed on #641's head. I don't know of an existing fix to port. I'm re-running the failed job once, as AGENTS.md allows. If it fails again, I'll treat it as a real bug and look into it.

Run: https://github.com/sambitcreate/aiden-agent/actions/runs/40969192783/job/123781620075


Generated by Claude Code

Electron accelerators are Command+/ on darwin and CommandOrControl+/
elsewhere; the Mac E2E shard failed on the Linux-only expectation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RFnvTu7rNwP4JpjJMZ

Copy link
Copy Markdown
Owner Author

There are two updates on the 5ab1459 run.

  • Electron E2E (2/3) failed because of this PR. The new ⌘/ test expected the Linux accelerator CommandOrControl+/, but the macOS runner reports Command+/. Commit 64500fb makes the expectation follow the platform. The spec passes locally.
  • Desktop tests (core-git) is the unrelated git.test.ts timeout I described above. The 64500fb push starts a fresh full run, and that run is its one re-run. If it fails again there, I'll treat it as a real bug.

Generated by Claude Code

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes since the previous Pullfrog review at 5ab14593f, scoped to 64500fbcd.

  • Corrected the platform-specific expectation: Updated the Help-menu e2e assertion to expect Command+/ on macOS and CommandOrControl+/ elsewhere, matching the existing production accelerator mapping.
  • Verified the affected contract: Passed e2e type-checking and all 8 application-menu unit tests, including macOS and Linux accelerator cases. Physical macOS Electron e2e was not run on this Linux runner.

Pullfrog  | View workflow run | Using gpt-6.1-sol | 𝕏

Only the "or" alternative wraps on narrow windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018VA6RFnvTu7rNwP4JpjJMZ

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes since the previous Pullfrog review at 64500fbcd, scoped to 08ac7353a.

  • Kept key pairs together: Wrapped each primary and alternative key group in a non-wrapping inline-flex span, preserving pair and range readability in both the shortcut dialog and Settings.
  • Verified affected behavior: Passed all 141 command-system tests and checked the real component with production CSS in Chromium using Linux key labels. At the dialog's 680px width, pairs stayed together and Find alternatives wrapped without row overflow at default and maximum UI font sizes. Full Electron e2e and physical macOS interaction were not run.

Pullfrog  | View workflow run | Using gpt-6.1-sol | 𝕏

@sambitcreate
sambitcreate merged commit 81c9c93 into main Oct 30, 2026
27 checks passed
@sambitcreate
sambitcreate deleted the claude/project-thread-aiyeon branch October 30, 2026 14:30
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.

3 participants