← reports

#7622 · Palette capture consumes printable search keystrokes

BugPriority: MediumEffort: Lowui GitHub issue2026-11-16 · base da3e60b81d560e114a2bec724bb59c997aaaae7f

Verdict: REPRODUCED · Root-cause confidence: high · reproduction label: confirmed-repro

1. TL;DR

The shared palette dialog treats a printable search keystroke as a command shortcut when a plugin command uses that key. A new regression at the real React component boundary fails in both Quick palette and Search threads. The dialog capture handler cancels the native editing event before the search input can use it. Both lowercase and Shift-uppercase bindings reproduce this on two clean trusted-main checkouts. The contained repair preserves printable editing events while leaving modified shortcuts and normal command selection intact.

2. Claims vs findings

ClaimFindingEvidence
Printable plugin shortcuts interrupt both palette modesVerifiedAll four new cases fail on unchanged production code because the keydown is canceled; all four pass after the fix.
The palette has a different dispatch path from window shortcutsVerifiedThe capture handler directly selects an action after shortcut matching, whereas the window handler evaluates command context and dispatch availability.
The problem requires a plugin to mishandle text inputRefuted as a requirementThe test registers a normal available plugin command. The palette itself cancels the editing event.
A particular installed plugin navigates Home and restores focus in a specific wayNot retestedThe isolated regression uses a callback instead of a third-party plugin or the user's data. The precise third-party navigation sequence is outside this test.
Other application search fields are unaffectedNot comprehensively retestedThe repair is scoped to CommandPalette. The report does not claim a whole-app or native-platform smoke pass.

3. Environment

4. Minimal reproduction

  1. Create a clean checkout of the trusted base:
    git clone https://github.com/get-bb/bb.git bb-7622-repro
    cd bb-7622-repro
    git checkout da3e60b81d560e114a2bec724bb59c997aaaae7f
    pnpm install --frozen-lockfile --prefer-offline
    pnpm exec turbo run build --filter=@get-bb/plugin-sdk
  2. Save the inline regression patch below as regression.patch and apply it to that checkout. This changes tests only:
    git apply /path/to/regression.patch
  3. Run the focused regression:
    pnpm exec turbo run test --filter=@bb/app -- src/components/commands/CommandPalette.test.tsx -t 'keeps printable'

The test first proves the override is active outside the dialog, then opens each palette mode and sends the corresponding printable key to its actual search input. The expected behavior is an uncanceled event, no plugin invocation, an open dialog, and an input that accepts a subsequent change. On trusted main the first assertion fails:

AssertionError: expected false to be true
- Expected
+ Received
- true
+ false
Test Files  1 failed (1)
     Tests  4 failed | 69 skipped (73)

fireEvent.keyDown returns false when the cancelable event was prevented. jsdom does not synthesize browser text insertion from a keydown; the later explicit change assertion is a component editing check, not a claim that a real browser typed text.

Copy-pasteable regression patch
diff --git a/apps/app/src/components/commands/CommandPalette.test.tsx b/apps/app/src/components/commands/CommandPalette.test.tsx
index 8f537fc190..4f3b76e3bb 100644
--- a/apps/app/src/components/commands/CommandPalette.test.tsx
+++ b/apps/app/src/components/commands/CommandPalette.test.tsx
@@ -2187,6 +2187,58 @@ describe("CommandPalette", () => {
     },
   );
 
+  it.each([
+    { mode: "commands", key: "h", shiftKey: false },
+    { mode: "threads", key: "h", shiftKey: false },
+    { mode: "commands", key: "H", shiftKey: true },
+    { mode: "threads", key: "H", shiftKey: true },
+  ])(
+    "keeps printable $key shortcuts as search input in $mode mode",
+    async ({ mode, key, shiftKey }) => {
+      const run = vi.fn();
+      setPluginSlotRegistrations(
+        "linear",
+        collectPluginAppRegistrations({
+          __bbPluginApp: true,
+          setup(app) {
+            app.commands.register({
+              id: "open-issue",
+              title: "Linear: open issue",
+              run,
+            });
+          },
+        }),
+      );
+      testState.overrides = [
+        {
+          command: "plugin:linear/open-issue",
+          shortcut: {
+            key: "h",
+            mod: false,
+            meta: false,
+            control: false,
+            alt: false,
+            shift: shiftKey,
+          },
+        },
+      ];
+      renderPalette();
+      fireEvent.keyDown(window, { key, shiftKey });
+      expect(run).toHaveBeenCalledTimes(1);
+      run.mockClear();
+
+      if (mode === "commands") openPalette();
+      else openThreadSearch();
+      await waitFor(() => expect(searchField()).toBeTruthy());
+
+      expect(fireEvent.keyDown(searchField(), { key, shiftKey })).toBe(true);
+      expect(run).not.toHaveBeenCalled();
+      expect(screen.getByRole("dialog")).toBeTruthy();
+      fireEvent.change(searchField(), { target: { value: key } });
+      expect(searchField()).toHaveProperty("value", key);
+    },
+  );
+
   it("dispatches defaults and overrides, respects availability, and unregisters disabled commands", async () => {
     let available = true;
     const run = vi.fn();
Full added regression
  it.each([
    { mode: "commands", key: "h", shiftKey: false },
    { mode: "threads", key: "h", shiftKey: false },
    { mode: "commands", key: "H", shiftKey: true },
    { mode: "threads", key: "H", shiftKey: true },
  ])(
    "keeps printable $key shortcuts as search input in $mode mode",
    async ({ mode, key, shiftKey }) => {
      const run = vi.fn();
      setPluginSlotRegistrations(
        "linear",
        collectPluginAppRegistrations({
          __bbPluginApp: true,
          setup(app) {
            app.commands.register({
              id: "open-issue",
              title: "Linear: open issue",
              run,
            });
          },
        }),
      );
      testState.overrides = [
        {
          command: "plugin:linear/open-issue",
          shortcut: {
            key: "h",
            mod: false,
            meta: false,
            control: false,
            alt: false,
            shift: shiftKey,
          },
        },
      ];
      renderPalette();
      fireEvent.keyDown(window, { key, shiftKey });
      expect(run).toHaveBeenCalledTimes(1);
      run.mockClear();

      if (mode === "commands") openPalette();
      else openThreadSearch();
      await waitFor(() => expect(searchField()).toBeTruthy());

      expect(fireEvent.keyDown(searchField(), { key, shiftKey })).toBe(true);
      expect(run).not.toHaveBeenCalled();
      expect(screen.getByRole("dialog")).toBeTruthy();
      fireEvent.change(searchField(), { target: { value: key } });
      expect(searchField()).toHaveProperty("value", key);
    },
  );

5. Root cause

CommandPalette.tsx:258–279 installs a capture handler on the entire dialog. After checking that the event belongs to the open dialog, it asks for a matching shortcut. Every match is immediately prevented and stopped, and a matching palette action is chosen. There is no distinction between a text-editing event and a command invocation.

AppCommandProvider.tsx:318–342 matches shortcut keys and client platform; it rejects repeats and composition but does not reject printable keys from editable targets. This is appropriate for a matching helper but insufficient as the palette's entire input policy.

Choosing an action queues its callback and closes the dialog. Thus the capture handler can both suppress text entry and close the search UI. The window path separately evaluates binding context and uses dispatch. Plugin defaults exclude modal context, so ordinary window routing does not require this dialog-local shortcut behavior.

Plugin availability is also evaluated while building the action list. A broader redesign of availability/context semantics is not required to prevent the reproduced editing interception; applying all normal modal exclusions to the palette would disable existing intentional in-dialog shortcuts.

6. Proposed fix and tested result

Before shortcut matching in the palette capture handler, return for a one-character key without Ctrl, Meta, or Alt when the event target is editable. Reuse the existing editable-target predicate. Shift remains allowed so uppercase typing is protected too. Do not alter global matching, public APIs, shortcut persistence, or command-selection semantics.

7. Pull-request check

Issue cross-reference metadata and an open-PR search for numeric issue 7622 returned no linked open pull request before implementation. No pull-request branch was checked out or executed.

8. Related issues

#3967 concerns keyboard-layout matching, and #3184 concerns embedded-browser focus. These provided classification context but do not establish this palette editing failure as a duplicate.

9. Verification

The same agent repeated the reproduction in a second clean detached checkout at da3e60b81d560e114a2bec724bb59c997aaaae7f. Its only source-tree modification was the same newly authored test patch; production remained unchanged. A new frozen install and the normal Turbo dependency build were used. The exact focused command above again failed all four cases with the same canceled-keydown assertion. The first run began at 05:58:24 UTC; the second began at 05:59:13 UTC on 2026-11-16. No report correction was needed. This is a repeated clean run by the same agent, not independent verification.

No ports or data directories were necessary in either DOM-only run. Native browser typing, mobile Safari, and the specific third-party plugin were not run and are not asserted as verified.

10. Appendix and evidence

The regression and exact failing output are inline above. Raw logs and test artifacts remain in a local evidence directory, not this public reports repository. The recorded post-fix outputs are:

Focused regression:
Test Files  1 passed (1)
     Tests  4 passed | 69 skipped (73)

Relevant suites:
Test Files  13 passed (13)
     Tests  182 passed (182)

Lint and typecheck:
Found 228 warnings and 0 errors.
Tasks:    7 successful, 7 total
pnpm exec turbo run test --filter=@bb/app -- src/components/commands src/lib/command-palette src/lib/app-keybindings.test.ts src/lib/plugin-command-keybindings.test.ts
pnpm exec turbo run lint typecheck --filter=@bb/app
pnpm exec oxfmt apps/app/src/components/commands/CommandPalette.tsx apps/app/src/components/commands/CommandPalette.test.tsx
git diff --check
git diff --numstat origin/main

Trust note: issue content and its suggestions were treated only as untrusted claims. No issue-provided command, external link, patch, test, binary, or branch was executed. The regression and repair were authored from inspected trusted repository code. Artifact paths are redacted; no runtime data is published.