Skip to content

feat(annotate): add sidebar shortcuts#986

Merged
backnotprop merged 2 commits into
backnotprop:mainfrom
leoreisdias:feat/annotate-left-sidebar-shortcut
Jul 7, 2026
Merged

feat(annotate): add sidebar shortcuts#986
backnotprop merged 2 commits into
backnotprop:mainfrom
leoreisdias:feat/annotate-left-sidebar-shortcut

Conversation

@leoreisdias

@leoreisdias leoreisdias commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Context

Annotate mode has a left sidebar with useful destinations, but it did not expose keyboard shortcuts for opening those panels. This adds shortcut coverage for the annotate sidebar and makes the shortcuts visible from Settings when the app is in annotate mode.

What Changed

  • Adds an annotate sidebar shortcut scope for toggling the Contents and Files sidebar panels.
  • Adds a double-tap Shift shortcut for toggling the Agent control when the annotate Agent TUI is available.
  • Passes annotate mode into Settings so the shortcut reference shows annotate-specific actions instead of the plan-review action list.
  • Splits the hardcoded shortcut help data into shared plan/annotate sections plus mode-specific action/sidebar sections.

Review Focus

  • Please look hardest at the shortcut choices and event guards in packages/editor/App.tsx.
  • The Agent TUI shortcut intentionally uses Shift Shift after avoiding conflicts with browser shortcuts, Pinpoint/Selection's Option behavior, bare-letter annotation shortcuts, and built-in browser/AI shortcuts.
  • I did not keep an Escape shortcut for closing the left sidebar. The shortcuts that open the sidebar already toggle it closed, and Escape created awkward interactions with annotation UI dismissal.

Design Note

There is some duplication between annotate and plan shortcut definitions in the Settings shortcut display. I leaned slightly away from over-DRYing this for now so each mode can freely evolve its own wording and available actions later. Happy to fold this into a more shared definition model if reviewers prefer that direction.

Relatedly, the new annotate sidebar scope currently lives under packages/ui/shortcuts/plan-review because the existing shortcut taxonomy only has plan-review and code-review folders, and annotate mode already reuses much of the plan-review shortcut surface. I am happy to move this into a dedicated annotate shortcut folder if that feels cleaner.

Test Plan

  • bun test packages/ui/shortcuts.test.ts
  • PATH="$PWD/packages/ui/node_modules/.bin:$PATH" bun run typecheck
  • bun run build:review && bun run build:hook

@leoreisdias leoreisdias marked this pull request as ready for review July 1, 2026 14:13
The double-tap engine counted ANY two keyups of the tracked key within
the window, so the new Shift Shift agent-terminal toggle fired during
ordinary Shift usage: typing two capitalized words, extending a
selection with two Shift+Clicks, or pressing this PR's own Mod+Shift+B
twice. A tap now only counts when the key went down and came up alone —
any other keydown, a pointer interaction mid-press, or another modifier
held at release breaks the press and resets the sequence. Also honors
the binding's preventDefault flag in the double-tap path (it was a
silent no-op).
@backnotprop

Copy link
Copy Markdown
Owner

Nice work — the mode-aware Settings help and the conflict analysis in the PR description were appreciated. One fix pushed to your branch (hope that's OK): the double-tap engine counted any two Shift keyups within the window, so the Agent-TUI toggle fired during ordinary Shift usage — two capitalized words, two Shift+Clicks extending a selection, or pressing this PR's own Mod+Shift+B twice. A tap now only counts when the key goes down and comes up alone (any other keydown, a pointer interaction mid-press, or a modifier held at release breaks the sequence), and the binding's preventDefault flag is now honored in the double-tap path. Full suite + typecheck green. Thanks for the contribution!

@backnotprop backnotprop merged commit 73cd4b1 into backnotprop:main Jul 7, 2026
13 checks passed
@leoreisdias

Copy link
Copy Markdown
Contributor Author

@backnotprop good catch! I appreciate that!

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.

2 participants