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:
@@ -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'}
|
||||
|
||||
Reference in New Issue
Block a user