feat(ui): collapse the room sidebar to the enclave rail (LC-270) #313
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-270-sidebar-collapse-rail"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Adds a desktop toggle (in the enclave rail) that collapses the wide room sidebar to just the rail - reclaiming ~16rem for the conversation - and expands it back (LC-270). The choice is per-device and persisted, so it sticks across reloads.
How
base.htmlno-flash bootstrap: readslc-sidebarfrom localStorage and setsdata-lc-sidebar="collapsed"on<html>BEFORE the stylesheets, so a collapsed sidebar never flashes wide on load (same pattern as theme/density). Exposeswindow.__lcToggleSidebar()to flip + persist + update the toggle's aria.main.css: on desktop (@media (min-width: 768px))html[data-lc-sidebar="collapsed"] #sidebar { display: none; }. Mobile is untouched - the sidebar is an overlay there with its ownlcOpenNavtoggle, so the desktop preference must not hide it. The toggle chevron rotates via CSS.enclave_switcher.html: adata-lc-sidebar-togglebutton at the bottom of the rail (desktop-onlyhidden md:flex,aria-controls="sidebar").layout.html: on load, syncs the toggle'saria-expandedto the persisted state (the collapse state is client-only, so the server can't render it).Device-local (like theme/density); no new route, DB, or env var. Not operator-visible.
Tests
routes_drafts::page_ships_sidebar_collapse_toggleasserts the rail ships the toggle and the bootstrap exposes the flipper.just testandjust test-saaspass.QA note
The toggle + persistence + no-flash are JS/CSS, so worth a quick manual pass before merge: on desktop, collapse the sidebar (only the enclave rail remains, the message area widens, chevron flips) and reload (stays collapsed, no wide-sidebar flash); expand and reload (stays expanded); shrink to mobile width and confirm the hamburger overlay sidebar still opens/closes regardless of the collapse preference.