Repository navigation
chore(templates): shell-nav opens its command palette with Core's useHotkeys - #12026
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Changes requested: moving the template to useHotkeys is the right direction, but mod+k narrows the shortcut while the changeset says pages behave the same.
mod+k(page.tsx:187) means ⌘ only on macOS and Ctrl only elsewhere, so Ctrl+K on macOS and Meta+K on Windows and Linux no longer open the palette, which contradicts "Pages look and behave the same" in.changeset/cleanup-shell-nav.mdand "No design or behavior change" in the description.
To fix it, register both meta+k and ctrl+k entries to keep the old combos, or keep mod+k and describe the narrowed shortcut in the changeset and description, which then needs a maintainer decision because no current record sets this shortcut. The closed page is pixel-identical at 1280 and 390 px.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Changeset: the template registers its Cmd/Ctrl+K shortcut with Core's
useHotkeysinstead of a hand-written listener: verified (page.tsx:24,page.tsx:186-188). - Changeset: pages look the same: verified; the closed page is pixel-identical at 1280 and 390 px in Chromium.
- Changeset: pages behave the same: false; Ctrl+K on macOS, Meta+K on Windows and Linux, and Ctrl+Alt+K no longer open the palette.
- Description: the shortcut still works inside inputs: verified (
allowInInputs: true,page.tsx:187). - Description: no design or behavior change: false, as above.
- Description: pixel-identical at 390 and 1280 px with script on and off: verified with script on; script off not checked.
- Description: behavior unchanged in a browser check: false; a Chromium check of the base and this branch shows the combos above stop working.
- Description: build replay shows no start, alternatives or block-list change: consistent; the template imports the same packages as before, and the replay itself was not rerun.
- Description: typecheck, lint and prettier pass: the Lint workflow passed on this head; the main CI workflow was cancelled for lack of CI capacity before its typecheck ran.
- Description: one change in one page template: verified, plus its changeset.
- Description: public text contains no internal context: verified.
.changeset/cleanup-shell-nav.md: finding, the "behave the same" claim.packages/cli/assets/templates/pages/shell-nav/page.tsx: finding,mod+knarrows the shortcut; otherwise clear (template rubric A, imports resolve, rendering unchanged).
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because the CI workflow was cancelled when CI was full; re-run it.
Registering meta+k and ctrl+k keeps ⌘K and Ctrl+K opening the command palette on every platform, including from the search field, and the page renders the same. One non-blocking edge: Ctrl+Alt+K (AltGr+K) and ⌘+Ctrl+K no longer open the palette because useHotkeys matches modifiers exactly, which needs no change.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules since the last review (0): none.
- Changeset: the template registers its Cmd+K and Ctrl+K shortcuts with Core's
useHotkeysinstead of a hand-written key listener: verified (page.tsx:24,page.tsx:188-191). - Changeset: pages look the same: verified; the closed page is pixel-identical at 1280 and 390 px in Chromium.
- Changeset: pages behave the same: verified for every ⌘K and Ctrl+K press, with or without Shift, inside or outside the search field, with the platform reported as macOS or Linux; only Ctrl+Alt+K and ⌘+Ctrl+K now stay closed (non-blocking).
- Description: the shortcut still works inside inputs: verified (
allowInInputs: true,page.tsx:189-190, and a browser check from the focused search field). - Description: the page uses the Core piece that already does this job: verified; no page-level listener remains.
- Description: no design or behavior change: verified, with the same edge as above.
- Description: pixel-identical at 390 and 1280 px with script on and off: verified with script on; script off not captured, and the rendered markup is unchanged.
- Description: behavior unchanged in a browser check: verified for the shortcut in a Chromium check of the base and this branch.
- Description: build replay shows no start, alternatives or block-list change: consistent; the template imports the same packages as before, and the replay itself was not rerun.
- Description: typecheck, lint and prettier pass: verified; a strict check with unused-local and unused-parameter errors on reports nothing in
page.tsx, the Lint workflow passed, and prettier passes on both files. - Description: one change in one page template: verified, plus its changeset.
- Description: public text contains no internal context: verified.
.changeset/cleanup-shell-nav.md: clear.packages/cli/assets/templates/pages/shell-nav/page.tsx: clear (template rubric A); non-blocking notes on the edge chords and the unchanged View-menu hints (lines 111 and 118).
What
The
shell-navpage template registers its Cmd/Ctrl+K command palette shortcut with Core'suseHotkeys(allowed inside inputs, as before) instead of a hand-written window keydown listener.Why
Cleaner template code: the page uses the Core piece that already does this job instead of a hand-written version. No design or behavior change.
Evidence
Scope