From 71c4654361619eb8bad78930a31716491e97c355 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Sun, 5 Apr 2026 17:48:07 -0400 Subject: [PATCH] Collapsible sidebar for mobile, fix logout button visibility On mobile: hamburger button in top bar opens sidebar as a slide-over with a backdrop overlay. Nav links and source selector close it on tap. On desktop: sidebar is static as before. Logout button now sits alongside the close button in the sidebar header with a gap so both are always visible. Co-Authored-By: Claude Sonnet 4.6 --- ui/src/App.jsx | 126 +++++++++++++++++++++++++++++-------------------- 1 file changed, 76 insertions(+), 50 deletions(-) diff --git a/ui/src/App.jsx b/ui/src/App.jsx index bd0f86a..615ad7e 100644 --- a/ui/src/App.jsx +++ b/ui/src/App.jsx @@ -20,6 +20,7 @@ export default function App() { const [authed, setAuthed] = useState(false) const [sources, setSources] = useState([]) const [source, setSource] = useState(() => localStorage.getItem('selectedSource') || '') + const [sidebarOpen, setSidebarOpen] = useState(false) async function handleLogin(user, pass) { setCredentials(user, pass) @@ -53,64 +54,89 @@ export default function App() { if (!authed) return + const sidebar = ( +
+ {/* Header */} +
+ Dataflow +
+ + +
+
+ + {/* Source selector */} +
+
+ + setSidebarOpen(false)}>+ +
+ +
+ + {/* Nav */} + +
+ ) + return (
- {/* Sidebar */} -
-
- Dataflow - -
- {/* Source selector */} -
-
- - {/* nav handled by link */}} - >+ -
- -
+ {/* Mobile overlay */} + {sidebarOpen && ( +
setSidebarOpen(false)} /> + )} - {/* Nav */} - + {/* Sidebar — fixed on mobile, static on desktop */} +
+ {sidebar}
{/* Main */} -
- - } /> - } /> - } /> - } /> - } /> - } /> - +
+ {/* Mobile top bar */} +
+ + Dataflow +
+ +
+ + } /> + } /> + } /> + } /> + } /> + } /> + +