From d767d9578fd689130c0f70d59be18afcaf499124 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Wed, 9 Jul 2025 23:20:32 -0700 Subject: [PATCH] feat: implement reusable pane system components MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add BasePane and Pane components for consistent panel UI - Create pane-manager store for centralized pane state management - Support for different pane positions and animations - Establish foundation for unified pane behavior across the app 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/lib/components/ui/BasePane.svelte | 170 ++++++++++++++++++++++++++ src/lib/components/ui/Pane.svelte | 99 +++++++++++++++ src/lib/stores/pane-manager.ts | 32 +++++ 3 files changed, 301 insertions(+) create mode 100644 src/lib/components/ui/BasePane.svelte create mode 100644 src/lib/components/ui/Pane.svelte create mode 100644 src/lib/stores/pane-manager.ts diff --git a/src/lib/components/ui/BasePane.svelte b/src/lib/components/ui/BasePane.svelte new file mode 100644 index 0000000..1e15383 --- /dev/null +++ b/src/lib/components/ui/BasePane.svelte @@ -0,0 +1,170 @@ + + +{#if isOpen} + +{/if} + + diff --git a/src/lib/components/ui/Pane.svelte b/src/lib/components/ui/Pane.svelte new file mode 100644 index 0000000..ce76738 --- /dev/null +++ b/src/lib/components/ui/Pane.svelte @@ -0,0 +1,99 @@ + + + + {#if title || showCloseButton} +
+ {#if title} +

{title}

+ {/if} + {#if showCloseButton} + + {/if} +
+ {/if} + + {#if children} + {@render children()} + {/if} +
+ + diff --git a/src/lib/stores/pane-manager.ts b/src/lib/stores/pane-manager.ts new file mode 100644 index 0000000..b437115 --- /dev/null +++ b/src/lib/stores/pane-manager.ts @@ -0,0 +1,32 @@ +import { writable } from 'svelte/store' + +interface PaneState { + activePane: string | null +} + +function createPaneManager() { + const { subscribe, set, update } = writable({ + activePane: null + }) + + return { + subscribe, + open: (paneId: string) => { + update((state) => ({ + ...state, + activePane: paneId + })) + }, + close: () => { + update((state) => ({ + ...state, + activePane: null + })) + }, + isActive: (paneId: string, state: PaneState) => { + return state.activePane === paneId + } + } +} + +export const paneManager = createPaneManager()