feat(ui): toggle the diagram-list sidebar

Add a ☰ toolbar button (and ⌘/Ctrl+B shortcut) to show/hide the left sidebar
for a wider editing/preview area. The preview re-fits when the sidebar — or the
Optimize panel — toggles, so the diagram stays centred.
This commit is contained in:
2026-05-22 21:50:06 +03:00
parent c35960761b
commit e1b5f31f87
4 changed files with 19 additions and 2 deletions

View File

@@ -34,6 +34,11 @@
e.preventDefault();
void store.save();
}
// ⌘/Ctrl+B: toggle the diagram-list sidebar.
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'b') {
e.preventDefault();
store.showSidebar = !store.showSidebar;
}
// ⌘/Ctrl+E: jump into viewer mode and toggle the quick-edit drawer.
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === 'e') {
e.preventDefault();
@@ -54,7 +59,9 @@
<div class="app">
<Toolbar />
<div class="body">
<Sidebar />
{#if store.showSidebar}
<Sidebar />
{/if}
{#if store.activeId}
<div class="split" bind:this={splitHost} class:splitting>
{#if store.layout !== 'preview'}