Skip to content

Console layout: collapsible sidebar + new swirl-sidebar-navigation - #1731

Draft
lukasballier wants to merge 1 commit into
mainfrom
act-3612-console-layout-sidebar-navigation
Draft

Console layout: collapsible sidebar + new swirl-sidebar-navigation#1731
lukasballier wants to merge 1 commit into
mainfrom
act-3612-console-layout-sidebar-navigation

Conversation

@lukasballier

Copy link
Copy Markdown
Collaborator

Console layout: collapsible sidebar + new swirl-sidebar-navigation

Linear: ACT-3612 — Update the Swirl console layout

Draft — built design-first with Claude Code. Needs a dev pass against the Swirl PR checklist (a11y/SR, dark theme, design parity) before merge. Open questions at the bottom.

What this does

Adds a hideable/collapsible navigation to swirl-console-layout (expanded ↔ hidden) and extracts the sidebar chrome into a new reusable swirl-sidebar-navigation component, so it can be reused in other apps.

New component: swirl-sidebar-navigation

A 296px sidebar shell:

  • logo slot (falls back to the Flip mark), appName wordmark
  • Collapse button → emits collapseButtonClick (host decides behavior)
  • Scrollable default slot for nav content, with scroll-state dividers on the header/footer that appear only while content is scrolled (mirrors the swirl-console-layout app-bar pattern)
  • user footer slot
  • elevated shadow variant; focusCollapseButton() method

swirl-console-layout (backward-compatible — additions only)

  • Renders the sidebar through swirl-sidebar-navigation
  • Desktop sidebar can be hidden (collapse button) and reopened (floating translucent button, or the app-bar toggle when an app bar is shown); state persists to localStorage
  • New: sidebarVisibilityChange event, logo slot, sidebarVisibilityStateStorageKey prop
  • New shell styling per Web Components 2.0: ambient radial-glow background on a sunken surface (themeable via --swirl-console-layout-background), rounded content card, translucent 296px sidebar
  • Focus is moved to the visible toggle on hide/show (keyboard users don't lose their place)
  • Fixed a grid min-height overflow so the layout fills its container and scrolls internally instead of growing to content height

Behavior change to flag: toggleSidebar()/showSidebar()/hideSidebar() now affect desktop too (previously mobile-only). If a consumer calls hideSidebar() on route change to close the mobile drawer, it should guard with a viewport check. The mobile drawer is now full-height and overlays the app bar.

Design

Figma — Web Components 2.0: console layout / background, sidebar nav. Expanded/hidden states from Flip Fusion: expanded, hidden.

Verification

  • yarn test — full suite green (505+ tests); the two touched components: 22/22
  • yarn lint clean; prettier clean
  • Manually checked in Storybook (light theme): expanded/hidden toggle, localStorage persistence across reload, mobile drawer (open/Escape/outside-click/collapse), focus move on hide/show, 296px width, scroll-state dividers, and short-viewport (no overflow / internal scroll)

Preview

  • Hosted: this PR auto-deploys Storybook to Azure SWA (a preview URL is posted as a PR comment by the deploy workflow). Stories: Admin / SwirlConsoleLayout and Components / SwirlSidebarNavigation.
  • Local: cd packages/swirl-components && yarn stencil:build && yarn storybook:starthttp://localhost:6006

Open questions for review

  1. Clash Grotesk — the appName uses "Clash Grotesk Variable" per design, but the font isn't bundled in Swirl; it falls back to Inter unless the host app loads it. Should we add an @font-face, or leave it to consumers?
  2. Sidebar widthswirl-sidebar-navigation stays width: 100% (fills its container; the 296px is set by swirl-console-layout and the story). Prefer a hardcoded 296px default on the component instead?
  3. Mobile drawer — closes on outside-click but isn't fully modal (no backdrop, background stays tabbable). Make it properly modal (inert + focus trap), or keep as-is (matches prior behavior)?
  4. :host { height: 100vh } — unchanged from the original; if the layout is ever embedded in a sized parent rather than the viewport, this may want to be 100%.
  5. Dark theme — the shell background has a safe solid surface-sunken dark default (no dark design was provided); confirm or supply the dark spec.

🤖 Generated with Claude Code

…avigation

- Add swirl-sidebar-navigation: reusable 296px sidebar shell (logo slot with
  Flip fallback, appName, collapse button, scrollable nav with scroll-state
  header/footer dividers, user footer slot, elevated variant)
- Redesign swirl-console-layout: hideable/collapsible desktop sidebar with a
  floating reopen button, localStorage persistence, ambient-glow shell,
  296px nav, internal scroll (no min-height overflow)
- Backward-compatible API; adds sidebarVisibilityChange event, logo slot, and
  sidebarVisibilityStateStorageKey prop

ACT-3612

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@linear-code

linear-code Bot commented Jun 23, 2026

Copy link
Copy Markdown

ACT-3612

@github-actions

Copy link
Copy Markdown
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://icy-water-049ec4003-1731.westeurope.3.azurestaticapps.net

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant