Skip to content

fix(app): swap conflicting keyboard shortcuts#376

Merged
murongg merged 1 commit into
mainfrom
fix/keyboard-shortcut-conflicts
Jun 22, 2026
Merged

fix(app): swap conflicting keyboard shortcuts#376
murongg merged 1 commit into
mainfrom
fix/keyboard-shortcut-conflicts

Conversation

@murongg

@murongg murongg commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Normalize shortcut capture and matching through physical key codes for shifted digit and punctuation keys.
  • Preserve physical key data when menu and toolbar actions synthesize editor shortcuts.
  • Swap an existing shortcut when recording a chord already used by another action, avoiding silent rollback on conflicts.

Why

  • Fixes [Feature]: 关于快捷键修改的问题 #373.
  • Cmd/Ctrl+Shift+8 can arrive as key="*" with code="Digit8", so matching only event.key misses the saved Mod+Shift+8 binding.
  • Settings capture previously normalized duplicate shortcuts back to defaults, which made a conflicting shortcut look like it was not recorded.

Validation

  • pnpm --filter @markra/shared test -- keyboard-shortcuts.test.ts
  • pnpm --filter @markra/app test -- KeyboardShortcutsSettings.test.tsx useNativeBindings.test.tsx MarkdownPaper.test.tsx
  • pnpm --filter @markra/app build
  • pnpm --filter @markra/shared build
  • pnpm --filter @markra/editor build

@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
markra-web Ready Ready Preview, Comment Jun 22, 2026 1:30am

@murongg murongg marked this pull request as ready for review June 22, 2026 01:32
@murongg murongg merged commit 9da2746 into main Jun 22, 2026
4 checks passed
@murongg murongg deleted the fix/keyboard-shortcut-conflicts branch June 22, 2026 01:34
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.

[Feature]: 关于快捷键修改的问题

1 participant