Skip to content

Move split view shortcut off Ctrl+H#135

Merged
alecdotdev merged 1 commit intoalecdotdev:masterfrom
wargoblin:fix/split-view-shortcut
May 7, 2026
Merged

Move split view shortcut off Ctrl+H#135
alecdotdev merged 1 commit intoalecdotdev:masterfrom
wargoblin:fix/split-view-shortcut

Conversation

@wargoblin
Copy link
Copy Markdown
Contributor

@wargoblin wargoblin commented May 6, 2026

Fixes #123.

Summary

  • Move Toggle Split View from Ctrl/Cmd+H to Ctrl/Cmd+\ so Monaco Replace can keep the standard Ctrl+H shortcut.
  • Bind both Backslash and IntlBackslash for international keyboard layouts.
  • Guard the app-level shortcut against Shift and Alt/AltGr so Ctrl+Alt combinations are not intercepted.
  • Use the existing silentSave hotkey path when the shortcut closes split view.
  • Update the split-view toolbar tooltip/menu shortcut label.

Test plan

Copilot AI review requested due to automatic review settings May 6, 2026 09:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR resolves the Ctrl+H shortcut conflict (Split View vs Monaco Replace) by moving “Toggle Split View” to Ctrl/Cmd+Backslash, adding support for international backslash scancodes, and updating the UI labels to reflect the new shortcut.

Changes:

  • Rebind Toggle Split View in Monaco from Ctrl/Cmd+H to Ctrl/Cmd+Backslash (including IntlBackslash).
  • Update the app-level (document) shortcut handling to use KeyboardEvent.code for Backslash/IntlBackslash and ignore Shift/Alt/AltGr-modified combinations.
  • Update the TitleBar tooltip and menu shortcut label to display the new shortcut.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/lib/MarkdownViewer.svelte Updates document-level keydown handling for split view to Ctrl/Cmd+Backslash (Backslash/IntlBackslash) with Shift/Alt guards.
src/lib/components/TitleBar.svelte Updates tooltip and menu shortcut label for Split View to show Backslash.
src/lib/components/Editor.svelte Updates Monaco action keybindings for Toggle Split View to Ctrl/Cmd+Backslash (including IntlBackslash).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/lib/MarkdownViewer.svelte Outdated
if (cmdOrCtrl && key === 'h') {
if (cmdOrCtrl && !e.shiftKey && !e.altKey && (code === 'Backslash' || code === 'IntlBackslash')) {
e.preventDefault();
if (tabManager.activeTabId) toggleSplitView(tabManager.activeTabId);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 1f23672: the document-level shortcut now calls toggleSplitView(activeTabId, true), so the hotkey path follows the existing silentSave contract. Toolbar/menu split-view clicks still use the interactive default path. Re-ran npm run check: 0 errors, existing warnings only.

@wargoblin
Copy link
Copy Markdown
Contributor Author

Hey @alecdotdev, this is a small shortcut-conflict fix for #123.

It moves Toggle Split View from Ctrl/Cmd+H to Ctrl/Cmd+\ so Monaco Replace can keep Ctrl+H, and includes the keyboard-layout hardening that came out of review: IntlBackslash, no Shift, no Alt/AltGr, and silentSave=true for the hotkey path.

Pre-submit checklist:

  • Rebased on latest master
  • One squashed commit
  • npm run check clean: 0 errors, existing warnings only
  • cargo check passed: existing APP_NAME warning only
  • cargo test passed: 0 tests
  • Upstream CI test passed
  • Internal review PR completed: [Review] Move split view shortcut off Ctrl+H wargoblin/Markpad#7
  • Codex review feedback handled (IntlBackslash)
  • Copilot review feedback handled (AltGr guard and silentSave hotkey path)
  • Claude review completed on the internal review PR

Happy to adjust the replacement shortcut if you prefer a different keybinding policy.

@alecdotdev alecdotdev merged commit 490dc64 into alecdotdev:master May 7, 2026
1 check passed
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.

Shortcut CTRL + H duplicated

3 participants