Description
Summary
While composing text with an IME in the Cmd-K palette search field, pressing Enter to confirm the composition also selects the highlighted bb result and closes the palette. Enter should commit the IME candidate only; result selection should wait for a non-composing Enter event.
Versions and environment
- bb 0.42.0
- Source at commit
8ac123f3551e7502a91c93e87329797f34ee626b(origin/main) - macOS 26.3 (25D125), Chinese Pinyin IME
- Node v24.6.0
- Managed worktree environment
Steps to reproduce
- Open the bb app on macOS with the Chinese Pinyin input source active.
- Press Cmd-K to open the command palette.
- Type into the search field while leaving a bb result highlighted and the IME candidate window active.
- Press Enter to confirm the highlighted IME candidate.
A deterministic component-level reproduction dispatches keydown with { key: "Enter", isComposing: true } to the real Cmd-K combobox after a result is highlighted.
Expected vs actual
Expected:
Pressing Enter while isComposing is true confirms the IME candidate. The palette remains open and does not run or navigate to a bb result.
Actual:
The palette consumes Enter, selects the highlighted command or thread, and closes.
The targeted regression test failed twice before the diagnostic guard:
FAIL src/components/commands/CommandPalette.test.tsx > CommandPalette > does not run the highlighted command when Enter confirms an IME composition
TestingLibraryElementError: Unable to find an accessible element with the role "combobox"
Test Files 1 failed (1)
Tests 1 failed | 23 skipped (24)
Evidence
- Investigation thread:
thr_45jjczbvhq(projectproj_7q2p9ejasx, environmentenv_t9aupz56py) - The input wires
onKeyDowndirectly tohandleKeyDown:bb/apps/app/src/components/commands/CommandPalette.tsx
Lines 350 to 360 in 8ac123f
className="h-11 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground" placeholder={inputLabel} value={query} onChange={(event) => { const nextQuery = event.target.value; setQuery(nextQuery); if (!nextQuery.startsWith(">")) setThreadItems([]); setHighlightedIndex(0); if (listRef.current !== null) listRef.current.scrollTop = 0; }} onKeyDown={handleKeyDown} - The Enter branch selects the active result without checking composition state:
bb/apps/app/src/components/commands/CommandPalette.tsx
Lines 294 to 302 in 8ac123f
if (event.key === "Enter") { event.preventDefault(); if (mode === "commands") { const choice = rankedCommands[activeIndex]; if (choice !== undefined) chooseAction(choice.action); return; } const choice = threadItems[activeIndex]; if (choice !== undefined) chooseThread(choice); - Other text inputs already guard Enter with
event.nativeEvent.isComposing:bb/apps/app/src/components/thread/InlineThreadTitle.tsx
Lines 62 to 69 in 8ac123f
const handleKeyDown = (event: KeyboardEvent<HTMLInputElement>) => { if (event.nativeEvent.isComposing) { return; } if (event.key === "Enter") { event.preventDefault(); event.stopPropagation(); closeOnce(onSubmit); - Adding only
if (event.nativeEvent.isComposing) return;at the start of this handler made the same targeted test pass:1 passed | 23 skipped.
What you ruled out
- Not caused by Dialog or global shortcut handling: changing only the local
CommandPalettehandler made the exact reproduction pass. - Still present on
origin/mainat8ac123f3551e7502a91c93e87329797f34ee626b. - Searched open and closed issues for IME, composition, Pinyin, command palette, and Cmd-K Enter; no duplicate found.
Suggested priority and effort
Medium priority, low effort. It affects IME users whenever Enter is used to confirm composition; switching input sources is a workaround. No data loss observed.
- I reproduced this on
main. - I searched open and closed issues for the same problem.
AGENT GENERATED
Activity
bb-slop-cop commentedon Sep 10, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotClassified as Bug · Medium priority · Low effort; labels:
ui,confirmed-repro.Reproduction report: REPRODUCED, high root-cause confidence. The palette handles Enter without checking composition state. The authored regression failed in two clean trusted checkouts; the guard makes all 55 command subsystem tests pass. Native OS IME UI was not exercised.
Ready fix: #3414 — 28 changed lines across two files; typecheck and build passed. Not merged.
Fix command palette IME key handling (get-bb#3415)