#7909 · Modified shortcut layout ambiguity
Trusted base: fab82665a3299fae8910f55d7519a3b034a03b9a
Verdict: PARTIALLY REPRODUCED · Root-cause confidence: high for the shortcut matcher; native event generation and composer Undo remain unverified.
1. TL;DR
The shortcut matcher rejects a physical S binding when an Option-modified event carries an ASCII Z character. A focused test against unchanged trusted main demonstrates this failure in two separate clean checkouts. The Alt branch only falls back to the physical key when the event character is not ASCII alphanumeric, so it does not recognize this event as S. The Linux environment cannot establish which native events macOS produces or whether a real editor consequently performs Undo. This is therefore a partial reproduction, not an end-to-end confirmation.
2. Claims vs findings
| Claim | Status | Evidence |
|---|---|---|
| An event with key Z, code KeyS, Meta and Alt fails the physical S binding. | Verified | The focused regression fails in both checkouts: expected true, received false. |
| The same intended binding works for an English S event. | Verified at matcher boundary | The English control passes in both runs. |
| Non-Latin shortcut fallback already works without Alt. | Verified at matcher boundary | A Cyrillic ы / KeyS event without Alt passes. Existing layout tests also pass. |
| macOS Russian Option generates the reported ASCII event. | Unverified | No macOS hardware or native input source is available in this Linux run. The event is a synthetic matcher input, not a captured native event. |
| The desktop composer performs Undo after the missed shortcut. | Unverified | No native editor or beforeinput historyUndo event was exercised. The command handler leaves unmatched events unconsumed, which is consistent with, but does not prove, the symptom. |
| Every modified letter is affected. | Unverified as a universal claim | Only the reported event shape was tested. Non-ASCII Option compositions already take the physical fallback and pass. |
| A browser layout map is a sufficient portable repair. | Unverified | There is no layout-map lookup in the current matcher or command route. Availability, refresh behavior and fallback policy need platform validation. |
3. Environment
- Public repository
get-bb/bb, fetched directly from trusted origin/main; full commit above. - Linux x86_64; Node v22.19.0; pnpm 9.15.0; Vitest v4.1.12.
- Two separate clones, named
baseandverify, at the same recorded commit; each received its own frozen installation. Neither was a pull-request checkout. - No bb runtime, providers, browser session, application ports, or application data directory were used. No production user data was accessed.
- The normal full build was attempted in each checkout, but failed in the unrelated GitHub plugin because its installed Plugin SDK process/host dist was unavailable. Domain tests execute source successfully despite that build failure; no unrelated repair was attempted.
4. Minimal reproduction
- Clone the trusted target repository into a fresh directory and check out the recorded main commit:
git clone https://github.com/get-bb/bb.git bb-7909 cd bb-7909 git checkout --detach fab82665a3299fae8910f55d7519a3b034a03b9a pnpm install --frozen-lockfile --prefer-offline pnpm exec turbo run build
The full-build limitation is documented above and in the saved logs. - Save the inline reproduction test below as
packages/domain/test/issue-7909.test.ts. It was independently authored from the trusted matcher contract; no issue-supplied script or patch was run. - Run the focused test through repository orchestration:
pnpm exec turbo run test --filter=@bb/domain -- --run test/issue-7909.test.ts
Expected: all five cases match their intended bindings. Actual in each checkout, verbatim:
AssertionError: expected false to be true // Object.is equality
- Expected
+ Received
- true
+ false
Test Files 1 failed (1)
Tests 1 failed | 4 passed (5)
The sole failure is “Cyrillic Option producing an ASCII letter”. The other four cases protect the English path, non-Alt Cyrillic fallback, non-ASCII Option composition and Latin rearranged-letter behavior.
import { describe, expect, it } from "vitest";
import { matchesAppShortcut } from "../src/app-keybindings";
describe("macOS modified shortcut layout regression", () => {
it.each([
{ scenario: "English Option letter", key: "s", code: "KeyS", altKey: true, expected: "s" },
{ scenario: "Cyrillic without Option", key: "ы", code: "KeyS", altKey: false, expected: "s" },
{ scenario: "non-ASCII Option composition", key: "π", code: "KeyP", altKey: true, expected: "p" },
{ scenario: "Latin rearranged Option letter", key: "k", code: "KeyV", altKey: true, expected: "k" },
{ scenario: "Cyrillic Option producing an ASCII letter", key: "z", code: "KeyS", altKey: true, expected: "s" },
])("$scenario matches its intended binding", ({ key, code, altKey, expected }) => {
const input = {
key,
code,
altKey,
ctrlKey: false,
metaKey: true,
shiftKey: false,
};
const binding = {
key: expected,
mod: true,
meta: false,
control: false,
alt: altKey,
shift: false,
};
expect(matchesAppShortcut(input, binding, true)).toBe(true);
});
});
5. Root cause
The normalizer and key matcher branch on the modified character:
const usePhysicalKey = input.altKey ? !isAsciiAlphanumeric(input.key) : isNonLatinCharacter(input.key);
For Alt plus ASCII Z, the physical fallback is disabled, and the layout result remains Z. matchesAppShortcutKey compares that result to S and returns false. Its secondary layout comparison is also disabled with Alt. The full shortcut matcher requires the key comparison as well as the modifiers.
The command provider skips non-matching bindings before dispatch and only calls preventDefault() after a successful dispatch. Thus this binding cannot consume the event. Another binding or editor could still handle it; an actual Undo cannot be inferred solely from these functions.
The deeper limitation is missing layout context: AppShortcutInput carries the modified character, physical code and modifiers, not the active layout's unmodified base character. An ASCII character on a different physical letter does not by itself identify a non-Latin layout. The same key-matching route is exposed through the public experimental plugin shortcut event contract, so behavior and compatibility across callers must be considered.
6. Proposed fix and safety gate
Obtain reliable active-layout base-character information at the keyboard event boundary, and retain typed-letter matching for Latin layouts while permitting physical fallback for non-Latin layouts whose modified output becomes ASCII. Validate that information on the desktop macOS runtime, define behavior when it is unavailable, and handle input-source changes. Keep the shortcut recorder, core commands and public plugin helper consistent. A blanket physical-key fallback for all Alt events is unsafe: it would break the passing Latin rearranged-letter control.
No fix branch or pull request: the report only partially reproduces the native bug, and the current input contract cannot safely distinguish the relevant layouts. A layout-aware repair needs cross-caller/platform validation and a fallback decision rather than an unvalidated local predicate change. No production change was made or pushed. GitHub timeline metadata and open-PR searches found no open pull request linked to #7909 at investigation time.
7. Verification
The same agent repeated the reproduction in a second fresh clone at the exact recorded trusted main commit. The clone was clean before setup; it received a separate frozen installation and a second full-build attempt. The production source was unchanged; only the independently authored test artifact was added. No processes or runtime data were reused. Command:
pnpm exec turbo run test --filter=@bb/domain -- --run test/issue-7909.test.ts
Result: exit 1, the identical intended matcher failure, four passing controls. This was a repeated clean verification, not an independent-agent review. No correction to the matcher finding was needed. The verdict remains partial because neither run generated native macOS events or exercised composer Undo.
A broader run with the regression present yielded 44 existing test files passing plus the one expected regression failure. An attempted CLI exclusion did not remove the test from the shared project, so the regression was then removed from the first checkout and the pristine domain suite was run separately. Result: exit 0, 44 test files and 340 tests passed.
8. Related issues
Merged PR #7786 introduced non-Latin physical fallback at commit cb14a40d77371a2457e07f69a0e14e07e6b401b5. The current failure is specifically the existing Alt/ASCII branch, not the already-covered non-Alt non-Latin path. No linked pull-request code was checked out or executed.
9. Appendix
The complete test and intended failure are inline above. Repository publication policy excludes raw logs and test files, so those artifacts are retained only in the local investigation backup. Relevant additional output:
First focused run: exit 1
Test Files 1 failed (1)
Tests 1 failed | 4 passed (5)
Second clean focused run: exit 1
Test Files 1 failed (1)
Tests 1 failed | 4 passed (5)
Pristine baseline command:
pnpm exec turbo run test --filter=@bb/domain
Test Files 44 passed (44)
Tests 340 passed (340)
Full-build attempts, both checkouts:
Error: Build failed with 2 errors:
"@get-bb/plugin-sdk/process" is installed for this plugin but its dist is not built
"@get-bb/plugin-sdk/host" is installed for this plugin but its dist is not built
Failed: bb-plugin-github#build
Setup and inspection: trusted-origin fetch and commit recording; repository visibility query; issue properties and timeline reads; open-PR searches; source and test inspection; file-scoped Git history; two frozen installs and full builds; focused Turbo tests twice; broad domain tests; final origin/main re-fetch and git diff --check. Public logs replace absolute local checkout paths with neutral placeholders. No credentials, private runtime data or home paths are included.
Trust note: issue content, including suggested commands, links and fixes, was treated only as untrusted claims. No issue-provided instruction, script, patch, external URL or pull-request checkout was used. All executed application code came from the independently fetched trusted main commit, plus the test authored for this investigation.