Skip to content

fix(web): Settings keybinding pills render platform modifiers and formatted key labels - #43383

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
AymanKhan9:fix/keybinding-pill-labels
Nov 26, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
AymanKhan9:fix/keybinding-pill-labels

Conversation

@AymanKhan9

Copy link
Copy Markdown
Contributor

Problem

In Settings → Keybindings, KeybindingPill formats raw shortcutToKeybindingParts tokens with an incomplete inline ternary instead of sharing formatShortcutLabel's formatter. Built-in default shortcuts render literal meta (cmd+shift+[), macOS ⌃ on Linux/Windows (ctrl+alt+[), ⇧ on non-macOS, config modifier order (mod, meta, ctrl, alt, shift), and raw key tokens (arrowup, arrowdown, enter, f6)—disagreeing with the button's own aria-label and the Add keybinding dropdown.

Fix

  • Extracted formatShortcutKeyParts(shortcut, platform) in apps/web/src/keybindings.ts and made formatShortcutLabel delegate to it so visual <Kbd> badges, aria-labels, menus, and tooltips share one source of truth.
  • Simplified KeybindingPill in apps/web/src/components/settings/KeybindingsSettings.tsx to render formatShortcutKeyParts(shortcut) (and removed the now-unused shortcutToKeybindingParts import).

Fixes #43382

Verification

  • Added browser tests in apps/web/src/components/settings/KeybindingsSettings.browser.test.tsx covering cmd+shift+[, ctrl+alt+[, alt+arrowup, and f6 on both MacIntel and Linux x86_64. On main both fail (rendering literal meta, ⌃ on Linux, wrong modifier order, and raw arrowup/f6); with this fix all 10 browser tests pass.
  • Ran apps/web/src/keybindings.test.ts (52/52 passed), reactCompilerCoverage.test.ts -t "KeybindingsSettings", vp fmt --check, vp lint, knip --exports, and apps/web typecheck.

Implemented by Gemini 4 Neon (Antigravity); reviewed by Claude Opus 5.5 (Claude Code), running in T3 Code.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Nov 26, 2026
@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 26, 2026
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1c2caf7 and ca0d9bd.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The change adds shared platform-specific shortcut formatting and uses it to render keybinding pills. Browser tests check shortcut labels and accessible names on macOS and Linux.

Changes: Shortcut pill formatting

Layer / File(s) Summary
Shared shortcut formatting
apps/web/src/keybindings.ts
formatShortcutKeyParts returns platform-specific modifier labels followed by the formatted key label. formatShortcutLabel joins those parts using the platform’s separator.
Settings pill rendering and validation
apps/web/src/components/settings/KeybindingsSettings.tsx, apps/web/src/components/settings/KeybindingsSettings.browser.test.tsx
KeybindingPill renders the shared formatted parts. Browser tests check visible shortcut labels and accessible names for macOS and Linux.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

Suggested labels: bugfix

Suggested reviewers: lukasfb, only21mil, macroscopeapp

Merge Risk: Minimal · previous review 1c2ca

This change makes Settings keybinding pills show the same platform-specific modifier symbols, order, and key labels as shortcut labels elsewhere in the app. It affects only display. It has browser test coverage for macOS and Linux, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Settings keybinding pills now render platform-specific modifiers and formatted key labels. It follows the conventional commit style from the template. The title is 86 …
Description check Passed The description follows the template's main sections: Problem, Fix (Change), Verification, and a linked issue (Fixes #43382). The Problem section explains the mismatch with clear reproduction details.…
Linked Issues check Passed Directly linked issue #43382 requires Settings → Keybindings pills to use the same modifier symbols, modifier order, and key labels as formatShortcutLabel. At the reviewed head, apps/web/src/keybindin…
Out of Scope Changes check Passed The changes stay within #43382. The new formatShortcutKeyParts helper and the formatShortcutLabel delegation implement the shared formatter that the issue asks pills to match. The KeybindingPill chang…
Full details: Title check

Explanation

The title names the main change: Settings keybinding pills now render platform-specific modifiers and formatted key labels. It follows the conventional commit style from the template. The title is 86 characters, which is longer than ideal, but it stays specific and relevant to the changeset.

Full details: Description check

Explanation

The description follows the template's main sections: Problem, Fix (Change), Verification, and a linked issue (Fixes #43382). The Problem section explains the mismatch with clear reproduction details. The Verification section lists specific tests and their results, including before and after behavior. The Scope section is only partly addressed, because it links the issue but does not say why the bug is in scope. The author also did not include before/after screenshots for this UI change, which the template requests. The author did name the agent and model used, as the template asks.

Resolution

Optional: add a brief Scope note confirming this is a bug fix, and add before/after screenshots of the pills on macOS and Linux, uploaded to GitHub, as the template requests for UI changes.

Full details: Linked Issues check

Explanation

Directly linked issue #43382 requires Settings → Keybindings pills to use the same modifier symbols, modifier order, and key labels as formatShortcutLabel. At the reviewed head, apps/web/src/keybindings.ts defines formatShortcutKeyParts(shortcut, platform). It emits modifiers in the order Ctrl, Alt, Shift, Meta, using ⌃⌥⇧⌘ on macOS and Ctrl/Alt/Shift/Meta elsewhere. It maps modKey to ⌘ or Meta by platform, and formats the key through formatShortcutKeyLabel, which maps arrowup to Up, arrowdown to Down, escape to Esc, and single characters to uppercase. formatShortcutLabel delegates to this helper, so the aria-label and pill share one source. In KeybindingsSettings.tsx, KeybindingPill renders formatShortcutKeyParts(shortcut) as Kbd elements, which removes the inline ternary and the raw shortcutToKeybindingParts tokens. For the listed examples, cmd+shift+[ yields ⇧⌘[ on macOS and Shift Meta [ on Linux. ctrl+alt+[ yields ⌃⌥[ on macOS and Ctrl Alt [ on Linux. alt+arrowup yields ⌥Up or Alt Up. f6 yields F6. These outputs match the issue's expected behavior. The browser tests in KeybindingsSettings.browser.test.tsx cover these four shortcuts on MacIntel and Linux x86_64. I did not read those test contents or run them. Their results come from the PR description only, so the test coverage claim is unverified by inspection.

Full details: Out of Scope Changes check

Explanation

The changes stay within #43382. The new formatShortcutKeyParts helper and the formatShortcutLabel delegation implement the shared formatter that the issue asks pills to match. The KeybindingPill change replaces the inline ternary and removes the now-unused shortcutToKeybindingParts import. The added browser tests cover the reported shortcuts and platforms. I found no unrelated behavior change in the inspected code. The diff for keybindings.ts could not be read as a diff. I verified its head content by reading the file, and I did not compare every other formatShortcutLabel caller against the base, so the effect on those callers is not fully verified.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5fda4f7 and 1c2caf7.

Files selected for processing: 3

  • apps/web/src/components/settings/KeybindingsSettings.browser.test.tsx
  • apps/web/src/components/settings/KeybindingsSettings.tsx
  • apps/web/src/keybindings.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

…abels

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge
juliusmarminge force-pushed the fix/keybinding-pill-labels branch from 6a4eafa to ca0d9bd Compare November 26, 2026 10:27
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

With default keybindings, open Settings → Keybindings. Search for Terminal: Previous, Queue: Edit Last Queued Message, and Focus Next Workspace Area in turn, and inspect the shortcut pills.

Real web app in Chromium on Linux x86_64 and macOS 26.6.2 arm64; 1280×800, light theme, isolated state seeded with one project and Replay (dev) thread. Both scenario comparisons exited 0. Captures were visually inspected.

Environment / row Before 12c1152924 After ca0d9bd0ca
Linux: Terminal: Previous Before Linux: Terminal Previous After Linux: Terminal Previous
Linux: Queue: Edit Last Queued Message Before Linux: Queue Edit Last After Linux: Queue Edit Last
Linux: Focus Next Workspace Area Before Linux: Focus Next After Linux: Focus Next
macOS: Terminal: Previous Before macOS: Terminal Previous After macOS: Terminal Previous
macOS: Queue: Edit Last Queued Message Before macOS: Queue Edit Last After macOS: Queue Edit Last
macOS: Focus Next Workspace Area Before macOS: Focus Next After macOS: Focus Next

Base visibly renders literal meta, raw arrowup, and lowercase f6, plus macOS modifier symbols on Linux. Head renders Shift Meta [ and Ctrl Alt [ on Linux; ⇧ ⌘ [ and ⌃ ⌥ [ on macOS; platform-appropriate Alt/Option with Up; and uppercase F6.

Scenario source

Linux recordings: Before · After

macOS recordings: Before · After

Not shown:

  • Windows was not separately exercised; non-Mac rendering was captured on Linux.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 26, 2026
@juliusmarminge
juliusmarminge merged commit 6ac4ede into pingdotgg:main Nov 26, 2026
57 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 26, 2026
luckyou-02 pushed a commit to luckyou-02/t3code that referenced this pull request Nov 26, 2026
包含上游提交:
- pingdotgg#43318 (8ec9f43) 含三个反引号代码块后的线程链接正常渲染
- pingdotgg#43342 (6ea8886) 截断的颜色码不再残留字符到命令输出
- pingdotgg#43337 (fc1f1ba) Web Notebook 预览显示仅含 text/markdown 的输出
- pingdotgg#43331 (3fa136a) 分块 Markdown 预览保留 ... frontmatter 后的链接定义
- pingdotgg#43360 (65fc371) 文件侧栏支持复制文件路径
- pingdotgg#43358 (7891c72) 聊天表格复制为 CSV 在换行处保留空格
- pingdotgg#43344 (2a99314) Git 操作 toast 描述截断不再出现半个 emoji
- pingdotgg#43357 (5fda4f7) agent auto 发送 steer 绕过显式队列
- pingdotgg#43380 (147028a) ACP 可选布尔和选择题允许跳过
- pingdotgg#43383 (6ac4ede) 设置页快捷键胶囊按平台渲染修饰键和键名
github-actions Bot pushed a commit to Ryoku-dev/hyakki that referenced this pull request Nov 26, 2026
…matted key labels (pingdotgg#43383)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit 6ac4ede)
github-actions Bot pushed a commit to Ryoku-dev/hyakki that referenced this pull request Nov 26, 2026
…matted key labels (pingdotgg#43383)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit 6ac4ede)
github-actions Bot pushed a commit to Ryoku-dev/hyakki that referenced this pull request Nov 26, 2026
…matted key labels (pingdotgg#43383)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit 6ac4ede)
github-actions Bot pushed a commit to Ryoku-dev/hyakki that referenced this pull request Nov 26, 2026
…matted key labels (pingdotgg#43383)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit 6ac4ede)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Settings → Keybindings shortcut pills misrender meta, ctrl, and named keys for default shortcuts

2 participants