Skip to content

fix(muya): correct inline code/math shortcut labels in the format toolbar - #4611

Merged
Jocs merged 1 commit into
developfrom
fix/inline-toolbar-shortcut-labels-3630
Jun 21, 2026
Merged

Jocs merged 1 commit into
developfrom
fix/inline-toolbar-shortcut-labels-3630

Conversation

@Jocs

@Jocs Jocs commented Jun 21, 2026

Copy link
Copy Markdown
Member

Summary

The inline format toolbar's tooltips advertised Cmd/Ctrl+E for inline code and Shift+Cmd/Ctrl+E for inline math, but no platform binds those keys. The actual defaults (in keybindings{Darwin,Windows,Linux}.ts) are:

  • inline code: Cmd+\`` / Ctrl+`(Linux:Ctrl+Y`)
  • inline math: Shift+Cmd+M / Ctrl+Shift+M

So the popup's shortcuts disagreed with the keyboard-shortcut settings — exactly the reporter's complaint.

Fix

Update the two labels in inlineFormatToolbar/config.ts to the backtick (inline code) and M (inline math) defaults.

Scope

This corrects the displayed labels (the reported mismatch). The toolbar's separate in-editor key-interception layer (index.ts FORMAT_SHORTCUTS) and propagation of user-customized keybindings into muya are a deeper concern tracked under #3681 — out of scope here.

Tests (TDD)

Added to config.spec.ts (deterministic, verified RED→GREEN):

  • inline_code advertises the backtick key, not E
  • inline_math advertises M, not E

Verified: lint, lint:types clean.

Fixes #3630

🤖 Generated with Claude Code

…lbar

The inline format toolbar advertised `Cmd/Ctrl+E` for inline code and
`Shift+Cmd/Ctrl+E` for inline math, but no platform binds those keys. The
actual defaults are `Cmd/Ctrl+\`` for inline code (Linux uses `Ctrl+Y`) and
`Shift+Cmd/Ctrl+M` for inline math, so the tooltips disagreed with the
keyboard-shortcut settings.

Update the labels to match the real default keybindings.

Fixes #3630

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@Jocs
Jocs merged commit 4078830 into develop Jun 21, 2026
7 checks passed
@Jocs
Jocs deleted the fix/inline-toolbar-shortcut-labels-3630 branch June 21, 2026 12:46
Jocs pushed a commit that referenced this pull request Jun 21, 2026
)

#4611 corrected the inline format toolbar labels to match the real
keybindings (inline code Ctrl+`, inline math Shift+Ctrl+M), but the
characterization tests in format-menu-state.spec.ts still asserted the
old, buggy Ctrl+E / Shift+Ctrl+E toolbar values, so they fail on develop.

Bring the tests in line with the corrected behavior:
- inline_math now agrees with the Format menu on Windows and Linux, so it
  moves into the reconcilable (matches) set.
- inline_code now matches on Windows (Ctrl+`); Linux intentionally binds
  Ctrl+Y, so the remaining Linux-only divergence is what the test pins.
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