Background
Inspired by the Zellij + Yazi + Helix + Lazygit one-key navigation pattern described in 脱IDE。AI時代の開発を支えるRust製ターミナル環境.
The article demonstrates seamless keyboard-driven transitions between file manager → editor → git client. MarkUpsideDown has the same three panels (Sidebar file tree, CodeMirror editor, Git panel) but the Git panel lacks a direct keyboard shortcut.
Current state
| Shortcut |
Action |
⌘1 |
Toggle Sidebar (file tree) |
⌘2 |
Toggle Editor |
⌘3 |
Toggle Preview |
⌘4 |
Toggle Table of Contents |
⌘5 |
Semantic Search |
| — |
Git panel: no shortcut (click nav button only) |
The sidebar has an internal panel system (SidebarPanel = "files" | "git" | "clone") with switchPanel() exported from sidebar.ts, but main.ts does not import or use it.
Proposal
⌘6 — Toggle Git Panel
Behavior:
- If sidebar is collapsed → expand sidebar + switch to git panel
- If sidebar is visible but on a different panel → switch to git panel
- If sidebar is visible and already showing git panel → collapse sidebar
This follows the toggle pattern already used by ⌘1 (sidebar) and ⌘4 (TOC).
Implementation
- Import
switchPanel from sidebar.ts in main.ts
- Add a
toggleGitPanel() function:
function toggleGitPanel() {
const isCollapsed = sidebarEl.classList.contains("collapsed");
const isGitActive = /* check current active panel */;
if (!isCollapsed && isGitActive) {
toggleSidebar(); // collapse
} else {
if (isCollapsed) toggleSidebar(); // expand
switchPanel("git");
}
}
- Add
⌘6 handler in the keydown listener (between ⌘5 and the ⌘C handler)
- Register in command palette:
{ id: "view.gitPanel", label: "Toggle Git Panel", shortcut: "⌘6", category: "View", run: toggleGitPanel }
Files to modify
ui/src/main.ts — import switchPanel, add keydown handler + command registration
ui/src/sidebar.ts — may need to export activePanel getter (currently activePanel is a module-level let)
Scope
Small change — no new dependencies, no architectural changes. Keyboard-only workflow improvement.
Background
Inspired by the Zellij + Yazi + Helix + Lazygit one-key navigation pattern described in 脱IDE。AI時代の開発を支えるRust製ターミナル環境.
The article demonstrates seamless keyboard-driven transitions between file manager → editor → git client. MarkUpsideDown has the same three panels (Sidebar file tree, CodeMirror editor, Git panel) but the Git panel lacks a direct keyboard shortcut.
Current state
⌘1⌘2⌘3⌘4⌘5The sidebar has an internal panel system (
SidebarPanel = "files" | "git" | "clone") withswitchPanel()exported fromsidebar.ts, butmain.tsdoes not import or use it.Proposal
⌘6— Toggle Git PanelBehavior:
This follows the toggle pattern already used by
⌘1(sidebar) and⌘4(TOC).Implementation
switchPanelfromsidebar.tsinmain.tstoggleGitPanel()function:⌘6handler in the keydown listener (between⌘5and the⌘Chandler)Files to modify
ui/src/main.ts— importswitchPanel, add keydown handler + command registrationui/src/sidebar.ts— may need to exportactivePanelgetter (currentlyactivePanelis a module-levellet)Scope
Small change — no new dependencies, no architectural changes. Keyboard-only workflow improvement.