Move split view shortcut off Ctrl+H#135
Conversation
There was a problem hiding this comment.
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.codefor 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.
| if (cmdOrCtrl && key === 'h') { | ||
| if (cmdOrCtrl && !e.shiftKey && !e.altKey && (code === 'Backslash' || code === 'IntlBackslash')) { | ||
| e.preventDefault(); | ||
| if (tabManager.activeTabId) toggleSplitView(tabManager.activeTabId); |
There was a problem hiding this comment.
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.
77c0354 to
1f23672
Compare
|
Hey @alecdotdev, this is a small shortcut-conflict fix for #123. It moves Toggle Split View from Pre-submit checklist:
Happy to adjust the replacement shortcut if you prefer a different keybinding policy. |
Fixes #123.
Summary
Ctrl/Cmd+HtoCtrl/Cmd+\so Monaco Replace can keep the standardCtrl+Hshortcut.BackslashandIntlBackslashfor international keyboard layouts.Ctrl+Altcombinations are not intercepted.silentSavehotkey path when the shortcut closes split view.Test plan
npm run check(0 errors, existing warnings only)cargo check(passes, existingAPP_NAMEwarning only)cargo test(passes, 0 tests)