Skip to content

feat(web): vendor keyboard shortcuts + ?, j/k, Shift+F#20

Merged
dastratakos merged 3 commits into
mainfrom
dastratakos/keyboard-shortcuts
May 4, 2026
Merged

feat(web): vendor keyboard shortcuts + ?, j/k, Shift+F#20
dastratakos merged 3 commits into
mainfrom
dastratakos/keyboard-shortcuts

Conversation

@dastratakos

@dastratakos dastratakos commented May 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Vendors the keyboard-shortcuts framework from the hosted stage monorepo and wires up the first three shortcuts. ? toggles a help dialog (mounted at the SPA root) listing every registered shortcut grouped by category. Shift+F toggles the file picker on the Files-changed tab; j/k step through the file list.

Changes

  • New lib/keyboard-shortcuts.ts registry with SHOW_SHORTCUTS, TOGGLE_FILES, NEXT_FILE, PREV_FILE (only entries that map to existing features — others omitted to avoid ghost shortcuts).
  • New lib/use-shortcut.ts, lib/use-file-navigation-keys.ts, components/keyboard/{shortcut-label,shortcuts-dialog}.tsx, and shadcn components/ui/dialog.tsx.
  • Added react-hotkeys-hook dep.
  • CollapsiblePicker is now controlled — required isCollapsed/onCollapsedChange props so Shift+F and the in-panel button share one source of truth. FilesPage owns the state.

Testing

pnpm typecheck, pnpm lint, pnpm test (124 passing), and pnpm build all clean. Browser interaction not yet verified — please confirm ? opens the dialog and j/k/Shift+F work on the Files tab.


Open in Stage

Vendors the keyboard-shortcuts registry, useShortcut hook, ShortcutLabel,
and KeyboardShortcutsDialog from the hosted stage monorepo. Mounts the
dialog at the SPA root so ? toggles a help menu listing every registered
shortcut grouped by category. Adds Shift+F to toggle the Files-tab side
picker and j/k to step through the file list (lifts the picker's collapsed
state up so the shortcut and the in-panel button share one source of truth).

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e4a6067. Configure here.

Comment thread packages/web/src/lib/use-shortcut.ts Outdated

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request implements a keyboard shortcut system, including a shortcuts dialog, file navigation keys, and a files panel toggle. It adds Radix UI and react-hotkeys-hook as dependencies. Review feedback identifies opportunities to improve type safety in the shortcut grouping logic and to remove a redundant check in the file navigation hook.

Comment thread packages/web/src/lib/keyboard-shortcuts.ts Outdated
Comment thread packages/web/src/lib/use-file-navigation-keys.ts
The hook was vendored alongside the keyboard-shortcuts framework but
nothing currently consumes it (ShortcutTooltip wasn't ported). Easy to
re-add when the first tooltip needs a shortcut.
Iterate via Object.keys cast to ShortcutKey[] so KEYBOARD_SHORTCUTS[key]
inherits its full type. Drops the per-iteration entry-value assertion
that Object.entries forced.
@dastratakos dastratakos marked this pull request as ready for review May 4, 2026 04:58
@dastratakos dastratakos merged commit 0cb9374 into main May 4, 2026
5 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd14a3901e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/web/package.json
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-react": "^0.562.0",
"radix-ui": "^1.4.3",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid mixing unified and per-primitive Radix deps

Adding radix-ui here while keeping the existing @radix-ui/react-* dependencies creates a mixed dependency strategy that now resolves duplicate Radix primitive versions in the lockfile (for example, multiple @radix-ui/react-separator versions). This increases install/build footprint and raises the chance of subtle UI inconsistencies from version skew; use either the unified radix-ui package consistently or keep per-primitive packages only.

Useful? React with 👍 / 👎.

@dastratakos dastratakos deleted the dastratakos/keyboard-shortcuts branch May 4, 2026 05:09
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