Sidebar: collapse/expand toggle + narrow-viewport auto-hide #162
Labels
No labels
area:auth
area:ci
area:db
area:infra
area:native
area:pwa
area:service
epic
feature
foundation
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
james/carol#162
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Follow-up to #140 (closed by #161), which deferred collapse behavior:
Add a manual collapse/expand toggle to the left sidebar (
app/(app)/components/sidebar.tsx) and a narrow-viewport mode where the sidebar hides entirely and only the toggle button remains.Behavior
Wide viewport, expanded (default):
Wide viewport, collapsed:
titleattribute and a small visual tooltip component so sighted users see the label without waiting for the OS tooltip delay. Screen readers continue to use the link/button's accessible name.Narrow viewport (below ~900px, exact breakpoint TBD by implementer):
Persistence
carol:sidebar:collapsed→"1" | "0".Icon
Use
PanelLeft/PanelLeftClose(orSidebar/SidebarClose) fromlucide-react. Pick whichever pair reads most clearly as a "collapse the left rail" affordance. Same icon library already used bysidebar-nav.tsx.i18n
Add to
messages/en.jsonunder thenavnamespace:nav.collapseSidebar— "Collapse sidebar" (aria-label + tooltip when expanded)nav.expandSidebar— "Expand sidebar" (aria-label + tooltip when collapsed or hidden)Per CLAUDE.md, sibling locales fall back to English per-key — they don't need to be updated in the same PR.
Acceptance criteria
localStorageon the same browser.aria-current="page"on the active nav item still works in both states.nav.*i18n keys added tomessages/en.json.Out of scope
transitionon width is fine; no spring physics).Composes with
--surface,--text,--border,--accentaliases already insidebar.module.css).messages/en.jsonnavnamespace).