diff --git a/docs/superpowers/specs/2026-07-07-sidebar-icon-rail-design.md b/docs/superpowers/specs/2026-07-07-sidebar-icon-rail-design.md new file mode 100644 index 0000000..6018a45 --- /dev/null +++ b/docs/superpowers/specs/2026-07-07-sidebar-icon-rail-design.md @@ -0,0 +1,64 @@ +# Sidebar collapse-to-icon-rail — Design Spec + +## Problem + +The main sidebar (`app-menu-bar`) is a fixed 260px-wide column with icons + Thai text labels for every menu item. The only existing toggle (hamburger button in the toolbar) hides the entire sidebar off-screen via a negative `margin-left` — there is no "shrink to icon-only rail" mode like the reference screenshots the user provided (a narrow ~64-72px column showing just icons, with a small `>>` affordance to re-expand). + +## Goal + +Repurpose the existing hamburger toggle so it switches the sidebar between: +- **Full mode** (current behavior): 260px wide, icons + text, current accordion sub-menus. +- **Rail mode** (new): ~64-72px wide, icons only. Leaf items still navigate on click. Items with children (accordion groups) show a floating flyout popup (triggered by hover/click) listing the children as full-text links. + +The hamburger no longer hides the sidebar entirely — it only toggles between these two width states. State persists across reloads via `localStorage`. + +## Current architecture (relevant files) + +- `src/app/layout/main-layout/main-layout.component.{ts,html}` — owns `isExpanedMenu: boolean`, applies `margin-left: -280px` to hide the sidebar, listens to `(expanedMenu)` from the toolbar. +- `src/app/layout/components/tool-bar/tool-bar.component.ts` — hamburger `