Skip to content

Keyboard control wave 2: F6 areas, sidebar arrows, Bot keys, ↑ to resend, ⌘F - #641

Merged
sambitcreate merged 7 commits into
mainfrom
claude/project-thread-aiyeon
Oct 29, 2026
Merged

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

Conversation

@sambitcreate

Copy link
Copy Markdown
Owner

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

What changes for the person

  • F6 / ⇧F6 move between the sidebar, the conversation, the message box and the side panel. Each area takes focus at its own entry point: the open chat, the conversation scrollport (so arrow keys and Page Up/Down scroll it), the message box, or the selected panel tab. Hidden or closed areas are skipped, and F6 does nothing while a menu or dialog is open. ⌘K gains Focus sidebar, Focus conversation and Focus side panel. Each can be given a key in Settings, and each shows a toast when its area isn't on screen.
  • Sidebar arrow keys: the chat list and the Bot list are now one Tab stop.
    • ↑ ↓ move between rows, and Home / End jump to the first / last row.
    • ← / → close and open a project folder; ← on a chat goes to its folder.
    • Tab still reaches the open chat's •••.
  • Bots get chat keys: ⌘1–9 and ⇧⌘[ / ⇧⌘] work on the Bots page, and holding ⌘ shows the hints. The chat number keys and ⇧⌘[ / ⇧⌘] now also work while typing in the message box. Before, they were ignored there, even though that is where focus usually is.
  • ↑ in an empty message box brings back your last message to fix and resend, using the same flow as Edit in fork, so the original chat is untouched. It needs that message to have a finished reply, and does nothing while a reply streams, in Bot chats, or when the box holds anything.
  • ⌥↑ / ⌥↓ step between replies and land on each reply's Copy button. They work from the conversation or from an empty message box; ⌥↓ past the latest reply goes back to the message box.
  • ⌘F finds text in the open chat (local and remote chats, and Bot chats):
    • ↩ / ⇧↩ or ⌘G / ⇧⌘G move to the next / previous match.
    • The count keeps up with streaming replies.
    • Esc closes the bar and returns focus to where it was.
    • Matches are painted with the CSS Custom Highlight API, so the transcript DOM is never changed.
    • The new ⌘F default gives way to a shortcut someone already saved on Command+F.

Implementation notes

  • New files:
    • renderer/lib/focus-regions.ts: areas are marked with data-focus-region.
    • renderer/lib/roving-rows.ts
    • renderer/lib/chat-find.ts with renderer/components/chat-find-bar.tsx
    • renderer/components/keyboard-regions.tsx, mounted in the root view.
  • Fixed keys: F6, the arrow keys and ↑ are fixed keys, not catalog bindings, because the catalog requires a modifier.
  • ScrollArea props:
    • focusRegion="chat" makes the scrollport a labelled "Conversation" region. Its focus ring is drawn as a sibling below the overlaid toolbar.
    • overlay floats the find bar under the toolbar.
  • Two bugs found and fixed by the new tests:
    • Sidebar rows are Radix tooltip triggers and carry data-state="closed", which the area check wrongly treated as a closed panel. That check is now applied only to the area element.
    • Chat keys were ignored in editable targets.

Screenshots (light and dark)

They are in the project files under keyboard-control/wave2/:

  1. Find in chat
  2. Conversation focus ring after ⇧F6
  3. ↓ in the sidebar
  4. ⌥↑ landing on a reply's Copy
  5. Bot ⌘ hints

Tests

  • New unit and behavior tests:
    • roving-rows (7) and focus-regions (5)
    • chat-find-bar (5)
    • composer-edit-last (4): mounts the real Composer.
    • Bot sidebar: chat keys and the roving Tab stop.
    • Keybindings: ⌘F gives way to a saved binding.
    • Command system: chat keys from editable targets.
  • Registration: the new tests are in test:sidebar and test:command-system, and in scripts/ci-test-registry.json (renderer-other lane).
  • New e2e in chat-shell-interactions.spec.ts: ⇧F6 / F6 through the areas, ↓ and ↩ in the sidebar, and ⌘F with Esc.
  • Local results:
    • These e2e specs pass: chat-shell-interactions, bots-sidebar-panel, chat-top-bar, app-controls, chat-message-queue, workspace-panel and bots-persistence.
    • The renderer-other lane passes, except prepare-macos-dev-runtime (no /usr/bin/plutil in the Linux container).
    • tsc and eslint are clean.
  • Local flakes, recorded per AGENTS.md:
    • workspace-panel.spec.ts › "the shared browser strip ignores a delayed command snapshot after a newer close event" failed once with electronApplication.evaluate: Resulting promise was garbage collected. It then passed 3/3 with --repeat-each=3.
    • One run of chat-shell-interactions + bots-sidebar-panel reported 1 failure. I cleared the results before reading which spec it was, and the next two full runs passed 29/29.

Docs

docs/keyboard.md adds a "Moving around the window" section plus the new chat keys and rules, and the README's keyboard line is updated.


Generated by Claude Code

…end, ⌘F

- F6 / ⇧F6 move between the sidebar, conversation, message box and side
  panel; ⌘K gains Focus sidebar / conversation / side panel.
- The sidebar chat list and the Bot list are one Tab stop with ↑ ↓ Home End,
  and ← → for project folders.
- Bots get ⌘1–9 and ⇧⌘[ / ⇧⌘] with hold-⌘ hints; these chat keys now also
  work while typing in the message box.
- ↑ in an empty message box edits the last message in a fork; ⌥↑ / ⌥↓ step
  between replies and land on Copy.
- ⌘F finds text in the open chat with the CSS Highlight API (new default
  yields to a saved Command+F).
- Tests, CI registry, docs/keyboard.md and README.

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

Find in chat has three reproducible correctness issues: Unicode searches can throw, navigation can leave matches offscreen, and continuous streaming postpones match-count updates until the stream pauses.

Reviewed changes across the full keyboard-control wave, including shared focus/navigation helpers and local/remote chat and Bot integrations.

  • Window navigation: F6 region cycling, explicit focus commands, and reply-action traversal.
  • Sidebar and composer: Roving row focus, Bot jump shortcuts and hints, editable-target chat shortcuts, and ArrowUp Edit in fork.
  • Conversation search: Find-bar lifecycle, text matching, highlight painting, match navigation, shortcut migration, and documentation.
  • Validation: All 335 tests in the focused command-system, sidebar, Bot, remote-chat, and chat-transition runs passed, as did application and e2e type-checks. Additional targeted probes reproduced the inline findings; full Electron e2e execution was not possible on this Linux runner because the repository harness requires macOS.

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

Comment thread renderer/lib/chat-find.ts Resolved
Comment thread renderer/components/chat-find-bar.tsx Resolved
Comment thread renderer/components/chat-find-bar.tsx Resolved
…elf, refresh while streaming

- Lowercasing can lengthen a character (İ), so folded offsets are mapped
  back to the original text node before building ranges.
- Next / previous centre the match's own rectangle in each scroller out to
  the conversation, so matches far apart in one tall code block are shown.
- The transcript observer keeps at most one refresh pending instead of
  restarting the delay on every mutation, so a fast stream is still counted.

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 offset fix introduces a reproducible Unicode search regression: an exact Greek query can return no matches when the same text node contains İ.

Reviewed changes since the prior Pullfrog review at 06c0dabac, scoped to the find-in-chat fixes in 755b96464.

  • Mapped search offsets: Added original-text offsets for length-expanding lowercase conversions and dotted-I matcher coverage.
  • Revealed matched ranges: Replaced parent-element scrolling with range-based positioning through nested scroll containers, with a tall-code-block visibility e2e.
  • Refreshed streaming matches: Replaced the trailing debounce with a bounded refresh timer and added sustained-stream behavior coverage.
  • Validated the delta: Passed all 126 command-system tests, application type-checking, and e2e type-checking. Full Electron e2e execution remains unverified on this Linux runner because the repository harness requires macOS.

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

Comment thread renderer/lib/chat-find.ts Resolved
Whole-string lowercasing is context-sensitive (a word-final capital sigma
becomes ς), so the per-character fallback could disagree with the query.
Both sides now fold per character, with ς folded to σ; ASCII text keeps the
in-place fast path.

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 prior Pullfrog review at 755b96464, scoped to the case-folding fix in d6444f9c2.

  • Unified search folding: Applied the same per-character transformation to queries and transcript text, normalized Greek sigma variants, and retained original-text offset mapping and the ASCII fast path.
  • Extended matcher coverage: Added mixed dotted-I/Greek assertions that reproduce the previous failure and now pass.
  • Validated the delta: Passed all 126 command-system tests, application type-checking, and nine additional real-matcher probes covering sigma variants, dotted-I offsets, and supplementary characters. Electron e2e was not rerun 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: 561cfe60892c96e8902b9305cce5c45732eeae74
Generated: 2026-10-29T04:38:22+00:00
Reviews: 1

Summary

Wave 2 delivers the second phase of the keyboard-control audit, introducing cross-region navigation (F6/⇧F6 and palette focus commands), roving tabindex with arrow-key and folder navigation in the chat and Bot sidebars, Bot shortcut number keys (⌘1–9 and ⇧⌘[/⇧⌘]), fork-and-resend via ↑ in an empty composer, reply stepping via ⌥↑/⌥↓, and in-transcript search via ⌘F using the CSS Custom Highlight API. Region cycling seamlessly skips hidden/closed panels and respects modal dialog/menu boundaries, while the roving tabindex collapses entire lists into a single Tab stop without losing context menu triggers or row actions. The implementation preserves user-customized shortcuts by registering chat.find through INTRODUCED_DEFAULT_COMMANDS and cleanly cleans up DOM highlights and event listeners upon unmount or navigation. Maintainers should double-check that Chromium's CSS Custom Highlight API (CSS.highlights) continues to degrade gracefully on any environments lacking browser highlight support.

Confidence Score: 5/5

Fully traced all navigation paths, event dispatching, DOM range queries, roving tabindex muting, and command registrations across all views and tests.

📁 Important Files Changed
  • renderer/lib/focus-regions.ts: Defines focus regions (sidebar, chat, composer, panel), region entry heuristics, cycleFocusRegion, stepReply, and global keydown listeners for F6, ⇧F6, ⌥↑, and ⌥↓.
  • renderer/components/keyboard-regions.tsx: Mounts the focus region key listeners in root view and registers command palette actions (focus.sidebar, focus.chat, focus.panel).
  • renderer/lib/roving-rows.ts: Implements roving tabindex (useRovingRows, syncRovingTabStops, rovingTarget) managing Tab stops, arrow navigation, Home/End, and folder expand/collapse.
  • renderer/lib/chat-find.ts: Implements in-memory case-folded unicode text search (findChatMatches), text-offset tracking through case expansions, and CSS Custom Highlight painting/clearing.
  • renderer/components/chat-find-bar.tsx: Provides the floating ⌘F search bar, match navigation, streaming reply debouncing (120ms), and previous focus restoration on Escape.
  • renderer/components/composer.tsx: Adds ↑ key handling in an empty message box to trigger forkFromTurn(..., "before") when eligible, and marks composer focus region attributes.
  • renderer/main/bots/bot-sidebar.tsx: Applies roving tabindex to Bot navigation, registers chat.jump.* / chat.previous / chat.next for Bots, and renders shortcut number hints when ⌘ is held.
  • renderer/components/chat-sidebar.tsx: Applies roving tabindex to the workspace chat list, marking items, rows, and groups with roving attributes.
  • renderer/components/ui.tsx: Updates Sidebar with focus region data, and extends ScrollArea with focusRegion="chat" and floating overlay support.
  • renderer/shared/keybindings.ts: Registers new focus and search commands, permits chat navigation shortcuts inside editable controls (allowInEditable: true), and registers chat.find in INTRODUCED_DEFAULT_COMMANDS.

Findings

No findings.

Sequence Diagram

sequenceDiagram
  autonumber
  actor User
  participant Window as Window Keydown Listener
  participant FindBar as ChatFindBar
  participant Engine as ChatFind (DOM Walker)
  participant HighlightAPI as CSS.highlights
  participant Scrollport as ScrollArea Scrollport

  User->>Window: Press ⌘F
  Window->>FindBar: Execute "chat.find" command
  FindBar->>FindBar: Mount overlay & focus searchbox
  User->>FindBar: Type search query
  FindBar->>Engine: findChatMatches(transcript, query)
  Engine-->>FindBar: Range[] matches
  FindBar->>HighlightAPI: paintChatMatches(ranges, activeIndex)
  FindBar->>Scrollport: revealMatch(matchRange, scrollport)
  User->>FindBar: Press Enter / ⌘G
  FindBar->>FindBar: Advance active index (wrap around)
  FindBar->>HighlightAPI: Update current highlight
  FindBar->>Scrollport: revealMatch(nextRange, scrollport)
  User->>FindBar: Press Escape
  FindBar->>HighlightAPI: clearChatMatches()
  FindBar-->>User: Restore previous focus & unmount
Loading
[]

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

Copy link
Copy Markdown
Owner Author

Linux build x64 failed on d6444f9 because of one flaky e2e test, which --fail-on-flaky-tests counts as a failure. The other 243 passed, including this PR's new keyboard and find specs.

I'll re-run the failed jobs once, after the rest of this run finishes.


Generated by Claude Code

@very-hermes-bot very-hermes-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Inline review — 1 finding(s) anchored to the diff. See the pinned summary comment for the overview.

Comment thread renderer/components/chat-find-bar.tsx Resolved

@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 prior Pullfrog review at d6444f9c2, scoped to the Escape-handling fix in f6bf4955c.

  • Extended Escape dismissal: Moved the handler to the find-bar container so Escape closes from its buttons as well as the search field, preserving the composition guard and focus restoration.
  • Expanded behavioral coverage: Extended the mounted test to dismiss from the Close button and verify that focus returns to the original message box.
  • Validated the delta: Passed all 126 command-system tests and application TypeScript checking. Electron e2e was not rerun for this narrow handler change on the Linux runner.

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

@very-hermes-bot very-hermes-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Inline review — 1 finding(s) anchored to the diff. See the pinned summary comment for the overview.

Comment thread renderer/components/chat-find-bar.tsx Resolved
…reopen it

The chat pane stays mounted across chats, so the hook's state for the old
chat matched again on return and the bar reopened and took focus.

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 prior Pullfrog review at f6bf4955c, scoped to the find-bar lifecycle fix in 561cfe608.

  • Cleared stale find state: Reset the remembered open state when the chat scope changes, preventing the bar from reopening when returning to a previously searched chat.
  • Added navigation coverage: Mounted the real command provider with a persistent pane to verify opening, leaving, returning with the bar closed, and explicitly reopening it.
  • Validated the delta: Passed all 127 command-system tests and application TypeScript checking. Electron e2e was not rerun for this narrow lifecycle change on the Linux runner.

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

…-aiyeon

# Conflicts:
#	renderer/main/bots/bot-chat-pane.tsx
@sambitcreate
sambitcreate merged commit 02c9319 into main Oct 29, 2026
26 checks passed
@sambitcreate
sambitcreate deleted the claude/project-thread-aiyeon branch October 29, 2026 21:50
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