diff --git a/src/App.svelte b/src/App.svelte index abf5137..44cec61 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -14,7 +14,19 @@ import { api, type NoteTemplate } from "./lib/api"; import { onMount } from "svelte"; import ThemeToggle from "./lib/components/ThemeToggle.svelte"; - import { Circle, Square, Trash2, Settings as SettingsIcon, AlertTriangle } from "@lucide/svelte"; + import Splitter from "./lib/components/Splitter.svelte"; + import { layout, clamp } from "./lib/stores/layout.svelte"; + import { + Circle, + Square, + Trash2, + Settings as SettingsIcon, + AlertTriangle, + PanelLeftClose, + PanelLeftOpen, + PanelRightClose, + PanelRightOpen, + } from "@lucide/svelte"; let showSettings = $state(false); let showConsent = $state(false); @@ -291,10 +303,89 @@ {/if} -
- +
+ + {#if !layout.leftCollapsed} + (layout.leftWidth = clamp(layout.leftWidth + d, 200, 480))} + onResizeEnd={() => layout.persist()} + /> + {:else} + + {/if}
- + {#if !layout.rightCollapsed} + (layout.rightWidth = clamp(layout.rightWidth - d, 240, 560))} + onResizeEnd={() => layout.persist()} + /> + {:else} + + {/if} +
@@ -592,25 +683,56 @@ } .panes { display: grid; - grid-template-columns: 260px 1fr 320px; + /* grid-template-columns set inline — depends on collapse/resize state (FR-UX-1). */ flex: 1; min-height: 0; } - .left, - .right { + .side { + display: flex; + flex-direction: column; + min-height: 0; border-color: var(--border); - overflow: auto; background: var(--bg-subtle); } - .left { + .side.left { border-right: 1px solid var(--border); } - .right { + .side.right { border-left: 1px solid var(--border); } + .side.collapsed { + align-items: center; + padding-top: 0.4rem; + } + .side-content { + flex: 1; + min-height: 0; + overflow: auto; + } + .pane-toggle { + display: flex; + align-items: center; + justify-content: center; + flex: none; + background: none; + border: none; + color: var(--muted); + cursor: pointer; + padding: 0.4rem; + border-radius: var(--radius-sm); + } + .pane-toggle:hover { + background: var(--bg-hover); + color: var(--fg); + } + .pane-toggle.inline { + align-self: flex-end; + margin: 0.3rem 0.3rem 0; + } .center { overflow: auto; background: var(--bg); + min-width: 0; } .vault-overlay { position: fixed;