Skip to content

Commit 855b0a9

Browse files
rgrvlskclaude
andcommitted
fix(web): new-thread shortcuts work while the command palette lists them
The palette shows ⌥⌘N next to "No project" (and ⇧⌘N next to "New thread in …"), but the global shortcut handler ignores keys while the palette is open, and the palette only ran its own ⌘1–9 hints. Pressing a shown new-thread shortcut now runs the listed item, like clicking it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 98beed1 commit 855b0a9

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

‎apps/web/src/components/CommandPalette.tsx‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3108,12 +3108,19 @@ function OpenCommandPaletteDialog(props: {
31083108
platform: navigator.platform,
31093109
context: { modelPickerOpen: false },
31103110
});
3111-
if (threadJumpIndexFromCommand(command ?? "") !== null) {
3111+
// A shortcut shown on a listed item runs that item. The global handlers
3112+
// ignore shortcuts while the palette is open, so nothing else would.
3113+
const isJump = threadJumpIndexFromCommand(command ?? "") !== null;
3114+
const matchingItem = command
3115+
? displayedGroups
3116+
.flatMap((group) => group.items)
3117+
.find((item) => item.shortcutCommand === command)
3118+
: undefined;
3119+
const isNewThread =
3120+
command === "chat.new" || command === "chat.newLocal" || command === "chat.newWithoutProject";
3121+
if (isJump || (matchingItem && isNewThread)) {
31123122
event.preventDefault();
31133123
event.stopPropagation();
3114-
const matchingItem = displayedGroups
3115-
.flatMap((group) => group.items)
3116-
.find((item) => item.shortcutCommand === command);
31173124
if (matchingItem) {
31183125
executeItem(matchingItem);
31193126
}

0 commit comments

Comments
 (0)