Thanks to visit codestin.com
Credit goes to github.com

Skip to content

🤖 fix: render native macOS shortcut labels (⌘P, not ⌘·P) - #4046

Merged
ibetitsmike merged 2 commits into
mainfrom
mike/mac-keybind-format
Sep 2, 2026
Merged

🤖 fix: render native macOS shortcut labels (⌘P, not ⌘·P)#4046
ibetitsmike merged 2 commits into
mainfrom
mike/mac-keybind-format

Conversation

@ibetitsmike

Copy link
Copy Markdown
Contributor

Summary

On macOS, every keyboard shortcut label rendered with a middle-dot separator and Command first ("⌘·P", "⌘·⇧·P"). formatKeybind now emits the native macOS form: one run of symbols with no separator, modifiers ordered ⌃⌥⇧⌘ ("⌘P", "⇧⌘P", "⌃C"). Windows/Linux output ("Ctrl+Shift+P") is unchanged.

Background

The collapsed-sidebar hamburger tooltip showed "Open sidebar (⌘·P)". The same formatter feeds the command palette, Settings → Keybinds, sidebar collapse buttons, composer hints and every other shortcut hint, so the fix is in the one shared function. DirectoryPickerModal had hardcoded isMac() ? "⌘O" to dodge the dot; that workaround is removed now that the formatter produces the same string.

Implementation

ctrl still means Command on macOS (matching matchesKeybind) unless macCtrlBehavior: "control" or the keybind also sets meta, in which case it renders as ⌃. Only the presentation changed; matching logic and the KEYBINDS registry are untouched.

Validation

  • Unit tests cover separator, ⌃⌥⇧⌘ ordering, ctrl-as-Command vs ctrl-as-Control, multi-character keys, and the unchanged Linux/Windows format.
  • Remote dogfood UAT (browser build, macOS spoofed via navigator.userAgentData, then plain Linux): hamburger tooltip, 70 command-palette labels and 60 Settings → Keybinds labels contain no middle dot and keep ⌃⌥⇧⌘ order; Cmd+P / Cmd+Shift+P still work; Linux labels unchanged.

Risks

Low. Display-only change in one function; no keybind matching or registry changes.


Generated with xum • Model: anthropic:claude-fable-5-1 • Thinking: xhigh • Cost: $0.00

formatKeybind joined mac symbols with a middle dot and put Command
first ("⌘·⇧·P"). Match the macOS convention instead: no separator,
modifiers ordered ⌃⌥⇧⌘ ("⇧⌘P"). Windows/Linux output is unchanged.

Drop the DirectoryPickerModal hardcoded "⌘O" workaround and add
behavioral formatKeybind tests for both platforms.
@chatgpt-codex-connector

This comment has been minimized.

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: c532799d94

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

This comment has been minimized.

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: f51d382edd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

This comment has been minimized.

@ibetitsmike
ibetitsmike added this pull request to the merge queue Sep 2, 2026
Merged via the queue into main with commit ffa2780 Sep 2, 2026
19 of 20 checks passed
@ibetitsmike
ibetitsmike deleted the mike/mac-keybind-format branch September 2, 2026 08:15
asm pushed a commit to asm/mux that referenced this pull request Sep 2, 2026
…r#4056)

## Summary

At phone widths (`max-width: 768px`) the "Open sidebar" hamburger's
hover pill sat glued to the window's left edge with the icon spilling
out of its right side into the header title. This drops the CSS hack
that caused it so the hamburger is an ordinary centered icon button
again.

## Background

coder#1935 aligned the hamburger icon to a 12px gutter by zeroing the
header's left padding and forcing `padding-left: 12px` +
`justify-content: flex-start` onto the button. The button is a fixed
24px box, so the icon (14 to 16px) ended up at x=12..28 while the box
stayed at x=0..24: the hover background hugged the edge and the glyph
overflowed the box on the right. Follow-up to coder#4046, which only fixed
the tooltip label in the same screenshot.

## Implementation

Remove the two button overrides from the phone-width default. The
header's own `px-2` gutter plus normal centering puts the icon at x=12
(16px icons) or x=13 (the 14px icon in `WorkspaceMenuBar`), so the coder#1935
alignment is preserved while the box encloses the icon (x=8..32).

On coarse pointers the touch-target rule widens the button to 44px,
where centering would drift the icon to x=22, so a following
`(max-width: 768px) and (pointer: coarse)` block restores the original
gutter geometry (header padding 0, button `padding-left: 12px`,
`flex-start`). Real phones are unchanged; only fine-pointer narrow
windows get the corrected layout.

The `.mobile-sticky-header:has(.mobile-menu-btn)` override stays, but at
`0.5rem` instead of `0`. It exists because `WorkspaceMenuBar` applies a
60px inline inset when the left sidebar is collapsed (room for the
desktop reopen affordance); at phone widths the hamburger itself is that
affordance, so the header should fall back to its normal gutter.

## Validation

- Playwright geometry of the "Open sidebar menu" button in
`App/PhoneViewports/IPhone16e`, fine pointer (390px viewport) vs coarse
pointer (`isMobile` + `hasTouch`, so `(pointer: coarse)` matches, which
Pixel cannot emulate):

| CSS | coarse pointer | fine pointer |
| ------- | -------------------- | ------------------------------------
|
| main | box 0..44, icon x=12 | box 0..24, icon x=12 (overflows box) |
| this PR | box 0..44, icon x=12 | box 8..32, icon x=12 |

- Screenshots with the hover surface forced visible reproduce the
reported clipped pill on `main` and show the enclosed pill on this
branch.
- `test-storybook` for `App.phoneViewports` (8 stories) and `make
static-check` pass.

## Risks

Low; CSS only, scoped to `max-width: 768px` and the five
`mobile-menu-btn` call sites (workspace, project, scratch, settings,
analytics headers). Pixel snapshots for phone stories will shift by a
few pixels around the hamburger.

---

_Generated with `xum` • Model: `anthropic:claude-fable-5-1` • Thinking:
`xhigh` • Cost: `$45.36`_

<!-- mux-attribution: model=anthropic:claude-fable-5-1 thinking=xhigh
costs=45.36 -->
yermakoffivan pushed a commit to yermakoffivan/mux that referenced this pull request Sep 6, 2026
…4075)

## Summary

Reverts coder#4046 (merge commit ffa2780). macOS shortcut labels go back to
the previous middle-dot form ("⌘·P", "⌘·⇧·P") and `DirectoryPickerModal`
regains its hardcoded "⌘O" label. Windows/Linux output was never
affected.

## Background

Requested by Mike. This is a plain `git revert` of the squash-merged
commit; the only difference from the pre-coder#4046 tree is the unrelated
`SETTINGS_BACKUP_TOGGLE_PROJECTS` registry entry added later by coder#4043,
which auto-merged cleanly.

## Validation

- `src/browser/utils/ui/keybinds.test.ts` (35 tests) and `make
static-check` pass locally.
- Verified the two fully reverted files are byte-identical to
`ffa2780f^`, and `keybinds.ts` differs from it only by the coder#4043 hunk.

## Risks

Display-only; no keybind matching or registry changes.

---

_Generated with `xum` • Model: `anthropic:claude-fable-5-1` • Thinking:
`xhigh` • Cost: `$0.00`_

<!-- mux-attribution: model=anthropic:claude-fable-5-1 thinking=xhigh
costs=0.00 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant