Repository navigation
fix(web): renumber project picker jump shortcuts to match filtered results - #8268
kacpergumieniuk wants to merge 2 commits into
Conversation
…sults The new-thread project picker baked mod+1..9 shortcut hints into items once, from their position in the full project list. Filtering (or the rank-based reordering the filter applies) kept the stale numbers, so the only visible project could still show mod+4 while pressing mod+1 did nothing. Shortcuts are now assigned in filterCommandPaletteGroups, after filtering and ranking, for groups marked enumerateShortcuts, so hints and handlers always follow visible positions. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
cc @maria-rcks think this is good to go :) |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused web bug fix that moves project-picker shortcut assignment to the existing post-filter path, affecting only shortcut labels and activation for visible project results. The change is localized, preserves unrelated command-palette behavior, and introduces no schema, deployment, security, billing, or authentication impact. Notes:
You can add or adjust custom eligibility rules. Learn more. |
Co-Authored-By: Claude Fable 5 <[email protected]>
Dismissing prior approval to re-evaluate 3f589a5
Dismissing prior approval to re-evaluate 3f589a5
|
Note Written by Hi! We are cleaning up open PRs, and this one appears to have been created with an older model ( |
What Changed
In the "New Thread" project picker (and the "New thread in..." command palette submenu), the ⌘1–⌘9 jump shortcut hints were assigned from each project's position in the unfiltered list, at view-construction time. After typing in the search box, the visible rows kept their original numbers — the only remaining result could still show ⌘4 — and pressing ⌘1 did nothing if the item that owned
thread.jump.1had been filtered out. The filter's rank-based re-sorting caused the same mismatch even when no rows were dropped.This PR moves the enumeration out of view construction and into
filterCommandPaletteGroups, which runs on every query change: groups that opt in via a newenumerateShortcutsflag getthread.jump.Nassigned after filtering and ranking.apps/web/src/components/CommandPalette.logic.ts—CommandPaletteGroup.enumerateShortcutsflag; enumeration applied infilterCommandPaletteGroups(both the empty-query and filtered paths)apps/web/src/components/CommandPalette.tsx— stop baking shortcuts intoprojectThreadItems; mark the two picker groups withenumerateShortcuts: trueMost of the
CommandPalette.tsxdiff is re-indentation from removing theenumerateCommandPaletteItems(...)wrapper — with whitespace ignored the change is 20(+) / 9(−) lines.Why
Shortcut hints and their handlers should always follow visible positions. Enumerating after the filter runs makes that hold by construction: the keydown handler already resolves items from the displayed groups, so hints and handlers can no longer disagree with what is on screen. Other palette items with static shortcuts (
chat.new,filePicker.toggle, …) are untouched.UI Changes
Projects: Alpha ⌘1, Beta ⌘2, Gamma ⌘3, Delta ⌘4. Typing "delta" leaves a single visible row.
Before
The row still shows the stale ⌘4, and pressing ⌘1 does nothing (the item owning
thread.jump.1was filtered out):Video: before-bug.mp4
After
The filtered row renumbers to ⌘1, and pressing ⌘1 opens a new thread in Delta:
Video: after-fix.mp4
Verification
vp run testinapps/web: full suite passes (2859 tests / 281 files)vp run typecheck(apps/web),vp lint,vp fmt --checkcleanmainthe same flow shows the stale hint and a dead ⌘1Checklist
Made with Claude Fable 5 in Claude Code.
Note
Fix command palette jump shortcuts to match filtered project results
enumerateShortcutsgroup flag andwithEnumeratedShortcutshelper, so jump keybindings (THREAD_JUMP_KEYBINDING_COMMANDS) are assigned after filtering and match the visible resultsenumerateCommandPaletteItemsto accept bothCommandPaletteActionItemandCommandPaletteSubmenuItemarraysOpenCommandPaletteDialogno longer pre-enumeratesprojectThreadItems; the Projects view and New-thread submenu groups now setenumerateShortcuts: trueand pass raw itemsenumerateShortcuts: truein CommandPalette.logic.ts, otherwise their items will have no shortcutsMacroscope summarized 3f589a5.