mirror of
https://github.com/hoornet/vega.git
synced 2026-05-07 20:59:12 -07:00
Sidebar improvements (roadmap #10)
- sidebarCollapsed now persisted to localStorage — remembered across sessions - Explicit ‹/› toggle button always visible in the header; no longer requires knowing to click the WRYSTR wordmark - Expanded: WRYSTR on left, ‹ collapse button on right - Collapsed: centered › expand button fills the header - Write article (✦) now visible in collapsed mode as icon-only with tooltip, consistent with the rest of the nav - Nav items have title tooltip in collapsed mode for discoverability - Status footer: collapsed shows just the connection dot with tooltip; expanded shows dot + online/offline text + note count as before Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -19,9 +19,11 @@ interface UIState {
|
||||
toggleSidebar: () => void;
|
||||
}
|
||||
|
||||
const SIDEBAR_KEY = "wrystr_sidebar_collapsed";
|
||||
|
||||
export const useUIStore = create<UIState>((set, _get) => ({
|
||||
currentView: "feed",
|
||||
sidebarCollapsed: false,
|
||||
sidebarCollapsed: localStorage.getItem(SIDEBAR_KEY) === "true",
|
||||
selectedPubkey: null,
|
||||
selectedNote: null,
|
||||
previousView: "feed",
|
||||
@@ -34,5 +36,9 @@ export const useUIStore = create<UIState>((set, _get) => ({
|
||||
currentView: s.previousView !== s.currentView ? s.previousView : "feed",
|
||||
selectedNote: null,
|
||||
})),
|
||||
toggleSidebar: () => set((s) => ({ sidebarCollapsed: !s.sidebarCollapsed })),
|
||||
toggleSidebar: () => set((s) => {
|
||||
const next = !s.sidebarCollapsed;
|
||||
localStorage.setItem(SIDEBAR_KEY, String(next));
|
||||
return { sidebarCollapsed: next };
|
||||
}),
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user