fix(web): record the layout character in the keybinding editor #15972
main fromrefs/pull/15972/head·merged by juliusmarminge View on GitHubThe keybinding editor recorded US physical punctuation positions on non-US layouts. Both editing an existing binding and adding a new one now retain the typed character. A German apostrophe press records shift+'; unshifted # records #. US Shift+{ still records shift+[, while an unshifted { stays literal.
Based on @macodev00's work in #15972, preserving original commits and merging main. The rebuild removes the duplicate glyph registry and reuses the existing terminal normalization map through shared code. The map moved verbatim. Alt/Option recording keeps the existing physical-key behavior, so Option-generated symbols do not replace portable shortcuts. Shortcut matching and default physical recording remain unchanged.
| Before — main | After — current head |
|---|---|
![]() | ![]() |
Recording: both capture fields record the apostrophe
Verification: 26 added cases were replaced with two behavior tests in the existing recorder suite, preserving main coverage. The recorder/matcher run dropped from 198 to 174 tests; all pass. Including 10 existing terminal tests, the final focused run passes 184 tests across three files. Removing the fix fails both new tests; removing the Shift guard fails the brace regression. Web/shared typecheck, targeted lint/format and diff checks pass. Two rounds of fresh independent full-diff reviews finished without a code blocker; the Option regression found in round one was fixed.
Live proof uses the real paired web app/server with isolated state in headless Linux Chromium. Actual main and head use matching data, viewport (1280×800), temporary font and synthetic keyboard events. Both fields changed from shift+\ to shift+'. Both retain # and unshifted {, and normalize US Shift+{ to shift+[. The proof covers capture; unit tests cover parse-and-match round trips. Option/Alt presses still record the physical key (alt+1). Draft edits were not saved.
This is the keybinding-editor portion of #13229. SnapShot and project-script recording keep their physical-key behavior. Native German keyboard delivery, Linux AltGr behavior, macOS, Windows, packaged Electron and iOS/Android were not verified. Mobile has no changed capture surface. The pre-existing non-Mac AltGr matching restriction is unchanged. Existing limitation: layout-character and physical-key aliases can overlap without a Settings conflict warning; matching and conflict detection are unchanged. Human review remains required; this PR is unmerged.
Implementation: GPT-6.1-Sol in Codex through T3 Code; tests: GPT-6-Astra; independent reviews: Claude Opus 5.5 and GPT-6-Sol.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
Approvability#
Verdict: Approved at
addfe4fMacroscope's review found this PR approvable — This is a narrowly scoped keybinding-editor bug fix: non-US layout characters are recorded correctly while existing physical-key and terminal normalization behavior remains unchanged. The implementation is covered by focused tests and does not alter product defaults, schemas, deployment, or static-analysis configuration.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Warning
Review limit reached#
Only developers with an assigned seat can use this organization's usage-based review budget, and seats here are assigned manually. Ask an admin to assign a seat, or change the review continuation mode in Billing.
Next included review available in 13 minutes.
View limit details
-
Limit details: You’ve used all 10 included reviews currently available.
Review configuration:
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
38d89ab6-aeb1-494d-bb21-ae037d6cc850
📥 Commits
-
Reviewing files that changed from the base of the PR and between 05b61cc8c1da73e9f812c202006a57d21b898cb5 and addfe4f936b9812595e1d15d58befdd7540b5d95.
📒 Files selected for processing: 5
-
apps/web/src/components/settings/KeybindingsSettings.logic.test.tsapps/web/src/components/settings/KeybindingsSettings.logic.tsapps/web/src/components/settings/KeybindingsSettings.tsxapps/web/src/terminal/ghostty/keyCodes.tspackages/shared/src/keybindings.ts
-
Note
Reviews paused#
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
reviews.auto_review.auto_pause_after_reviewed_commitssetting.- Last reviewed commit: 05b61cc8c1da73e9f812c202006a57d21b898cb5
- Latest commit, not reviewed: addfe4f936b9812595e1d15d58befdd7540b5d95
Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto trigger a single review.
Use the checkboxes below for quick actions:
- ▶️ Resume reviews
- 🔍 Trigger review
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
7cea91ff-a1cd-4669-8113-663598276f9e
📥 Commits
-
Reviewing files that changed from the base of the PR and between 40aef8f510e06426cb58cb70b97bdb736f6f19e0 and 05b61cc8c1da73e9f812c202006a57d21b898cb5.
📒 Files selected for processing: 3
-
apps/web/src/components/settings/KeybindingsSettings.logic.test.tsapps/web/src/components/settings/KeybindingsSettings.logic.tsapps/web/src/components/settings/KeybindingsSettings.tsx
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
📝 Walkthrough
-
Shortcut capture now supports characters from the active keyboard layout. Both settings capture paths use this mode. The default physical-key conversion remains available.
Changes: Keyboard layout-aware shortcut capture
Layer / File(s) Summary Layout-aware conversion, settings capture, and tests
apps/web/src/components/settings/KeybindingsSettings.logic.ts,apps/web/src/components/settings/KeybindingsSettings.tsx,apps/web/src/components/settings/KeybindingsSettings.logic.test.tsThe converter accepts an optional layout-character setting. Both settings capture paths enable it. Tests cover punctuation, layout-specific characters, shifted keys, and shortcut matching. Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Suggested reviewers:
juliusmarminge
Merge Risk: ⚪ Minimal · up to
05b61-
The changed keybinding editor behavior has no identified merge-blocking issue after normal checks.
Security architecture risk: 🔵 Low · up to
05b61-
The change is confined to shortcut recording in Settings and preserves the existing matching and save paths. No introduced security weakness was identified. Verification of authoritative write enforcement and interrupted-save recovery remains partial, so the assessment is cautious.
Retained concerns No architecture-level concerns identified.
Security review details
-
Security Blast Radius
- observed — A Settings save targets all connected environments, not only the primary environment. That existing scope is unchanged: the PR changes the captured key token, not the selected environments, command identity, or mutation destination.
Trust Boundaries and Controls
- observed — The save callback retains its write-scope check for every target environment. Server source also maps keybinding upserts to the settings-write scope and wires authorization middleware using session scopes. These controls were located, but complete end-to-end server enforcement was only partially inspected.
Resilience and Maintainability Implications
- observed — The existing multi-environment save is not an all-target transaction: successful environments are not rolled back when another target fails. Failure and interruption handling remain unchanged by layout-aware capture. Per-environment writes retain serialized mutation and persistence-before-publication ordering; post-send interruption recovery was not fully traced.
-
Pre-merge checks:
3 · 1-
Failed checks: 1 warningCheck name Status Explanation Resolution Linked Issues check Issue #13229requires layout-aware shortcut display for the keybinding editor and identifies Snapshot hotkey editing as affected. The PR updates bothKeybindingsSettings.tsxcapture handlers and add…Apply layout-aware capture to Snapshot hotkey editing and add automated coverage for non-US layout input. Passed checks: 3 passed-
Check name Status Explanation Out of Scope Changes check The changes to layout-aware key conversion, both keybinding capture fields, and their tests support issue #13229. The current diff does not retain the previously noted unrelated `titleCaseCommandSegme…Title check The title clearly and concisely describes the main change: recording layout characters in the web keybinding editor. Description check The description covers the problem, implementation, scope, linked issue, verification results, screenshots, recording, limitations, and agent details. It does not use the template's explicit section h… Full details: Out of Scope Changes check
-
Explanation
The changes to layout-aware key conversion, both keybinding capture fields, and their tests support issue
#13229. The current diff does not retain the previously noted unrelatedtitleCaseCommandSegmentdocstring change. No demonstrated unrelated change remains.
Full details: Description check
-
Explanation
The description covers the problem, implementation, scope, linked issue, verification results, screenshots, recording, limitations, and agent details. It does not use the template's explicit section headings, but the required information is present and sufficiently complete.
-
Full details: Linked Issues check
-
Explanation
Issue
#13229requires layout-aware shortcut display for the keybinding editor and identifies Snapshot hotkey editing as affected. The PR updates bothKeybindingsSettings.tsxcapture handlers and adds layout-character logic and tests. The Snapshot recorder still callskeybindingFromKeyboardEvent(event, navigator.platform)withoutlayoutCharacter: true, so Snapshot recording still uses the US physical-key name. This requirement remains unmet.Resolution
Apply layout-aware capture to Snapshot hotkey editing and add automated coverage for non-US layout input.
-
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
Note
Written by
claude-opus-5-5on behalf of MariaHi! We are cleaning up open PRs, and this one does not say which model or harness was used to create it. If this change is really important, we recommend rebuilding the PR with a newer model and noting the model and harness in the PR description.
maria-rcks closed this
Note
Written by
claude-opus-5-5on behalf of MariaReopening, this was closed by mistake. Sorry for the noise!
maria-rcks reopened this
Note
This comment is posted by Julius' dot
The layout-character fix and its focused tests address #13229. One scope question remains: could you remove the new titleCaseCommandSegment docstring, or explain why documenting that unchanged command-label formatter is necessary for the recorder fix? The description says it was added because it falls inside a diff hunk, which doesn't establish that connection under one problem per PR. This stays open for maintainer decision because Maria has participated.
Removed it in 40aef8f51. It isn't needed for the recorder fix, so the PR is back to the layout-character change and its tests.
juliusmarminge added labelsmacroscope-review
juliusmarminge assignedjuliusmarminge
Taking over this one. I’ll preserve the original commits, trim the tests, rebuild the recorder change against current main, and verify both editor fields before pushing here.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
@coderabbitai review
Please review the current head, addfe4f936b9812595e1d15d58befdd7540b5d95. This merges main into the existing fix and resolves only the test import block, retaining both main's compileResolvedKeybindingsConfig and this PR's parser/matcher imports. The integrated recorder/matcher/terminal suite passes all 186 tests, with targeted lint and web typecheck passing. Both independent full-diff re-audits found zero confirmed findings.
Posted by GPT-6.1-Sol through Codex in T3 Code as part of maintainer landing preparation.
⚠️ Action not completed
Review rate limited.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
juliusmarminge merged this166e4e7
juliusmarminge closed this
Sign in to join this conversation.


macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed