Skip to content

feat: SW-2118 Evolve Data App Shell into composable AppShell container#183

Open
owilliams-tetrascience wants to merge 5 commits into
mainfrom
claude/cool-blackwell-4bebee
Open

feat: SW-2118 Evolve Data App Shell into composable AppShell container#183
owilliams-tetrascience wants to merge 5 commits into
mainfrom
claude/cool-blackwell-4bebee

Conversation

@owilliams-tetrascience

@owilliams-tetrascience owilliams-tetrascience commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Final PR of the Data App Shell Iteration (SW-2118, PR-6) — ties PR-1…PR-5 together by evolving the existing Data App Shell into a configurable grid container, matching the attached playground/movie (including the moved collapse triggers).

  • Grid zones per navVariant (vertical | horizontal, default vertical): CSS grid-template-areas place the primary nav, secondary (side), top bar, secondary bar, and body zones; slots absent from the tree collapse their track. New zone switches: showNavRail, showTopBar; new zones: secondaryBar (horizontal stepper) and the existing rightPanel. The shell knows zones, never domain concepts.
  • ShellContext publishes {navVariant, collapsed, setCollapsed, hideNavOnCollapse} (useDataAppShell / useOptionalDataAppShell exported).
  • One collapse toggle (controlled/uncontrolled via collapsed/defaultCollapsed/onCollapsedChange). The primary sidebar now renders expanded by default with the collapse chevron in the brand row; collapsed it becomes a 48px icon rail with the expand chevron directly under the logo — per the playground. A shared ShellCollapseButton keeps every zone's trigger identical.
  • hideNavOnCollapse collapses nav + secondary together into a single icon rail (the secondary rail carries the expand chevron; a floating expand button appears when no secondary exists).
  • Responsive: autoCollapse media query (default (max-width: 1023px), pass false to disable) auto-collapses on enter and restores on leave unless the user collapsed manually.
  • SecondaryNav: follows the shell's collapse when hideNavOnCollapse, owns its own toggle otherwise (explicit collapsed prop always wins). Horizontal orientation is now collapsible — collapsed it renders a compact step dropdown for the top bar, exactly like the playground's collapsed wizard.
  • Stories reworked to the agreed variant order (per Grace's comments on the ticket): 1 Default (left sidebar only, no right panel) · 2 Secondary Nav · Sidebar · 3 Workflow · Vertical (hideNavOnCollapse) · 4 Workflow · Horizontal · 5 With Right Panel · 6 Customizable (Storybook-controls-driven, like the ui/sidebar story) — plus a hidden overlay-panel test story.

Back-compat notes for reviewers: sidebarPanel, rightPanel, showNavRail, and all existing top-bar props are unchanged; the visible behavior change is the primary sidebar starting expanded (collapse to get the old rail, or set defaultCollapsed).

Type of Change

  • Feature (new functionality)
  • Bug fix
  • Refactor
  • Documentation
  • Chore (build, CI, dependencies)
  • Breaking change

Checklist

  • yarn lint passes
  • yarn build passes
  • yarn test:all passes (158 files / 1545 tests)
  • Storybook stories added/updated
  • Code coverage remains the same or increased (changed files 99.7–100% lines; total 96.76%)

Testing

Play tests cover: sidebar collapse/expand via the brand-row chevron, independent secondary collapse, one-toggle merge under hideNavOnCollapse, the horizontal stepper ⇄ top-bar step dropdown swap, step selection via dropdown, docked right panel (resize, persistence, focus, Esc) and the overlay variant. Unit tests cover responsive auto-collapse (matchMedia stub), manual-collapse precedence, zone hiding, navVariant="horizontal", ShellContext publication, and hook error behavior. New/reworked stories have parameters.zephyr.testCaseId left absent — apply the zephyr_sync label to generate IDs.

Verification

  • Deploys to preview environment for manual verification
  • All CI/E2E checks pass

Screenshots

Verified against the SW-2118 playground HTML and AppShell_Updates.mov in light + dark mode: Default (expanded sidebar, brand-row chevron), collapsed rail (chevron under logo), Secondary Nav · Sidebar (permanent rail + independent secondary), Workflow · Vertical (single-rail merge), Workflow · Horizontal (stepper bar ⇄ step dropdown by the breadcrumbs).

🤖 Generated with Claude Code

Ties the Data App Shell Iteration together (PR-6). The shell is now a
CSS-grid zone container driven by navVariant (vertical | horizontal,
default vertical) plus which slots are present — pass false to hide a
zone (showNavRail / showTopBar), and new secondaryBar + rightPanel zones.
It knows zones, never domain concepts.

- ShellContext (new) publishes {navVariant, collapsed, setCollapsed,
  hideNavOnCollapse}; useDataAppShell / useOptionalDataAppShell exported.
- One collapse toggle (controlled/uncontrolled). The primary sidebar now
  expands by default with the collapse chevron in the brand row and
  collapses to an icon rail with the expand chevron under the logo —
  matching the SW-2118 playground/movie. ShellCollapseButton (new) is the
  shared affordance so every zone's trigger looks identical.
- hideNavOnCollapse collapses nav + secondary together into a single icon
  rail (secondary carries the expand chevron; a floating expand button
  appears when there is no secondary).
- Responsive: auto-collapse below a breakpoint via the autoCollapse media
  query (leaves restore the expanded state unless the user collapsed
  manually).
- SecondaryNav: follows the shell collapse when hideNavOnCollapse, owns
  its collapse otherwise; horizontal orientation is now collapsible —
  collapsed it renders a compact step dropdown for the top bar (like the
  playground's collapsed wizard).
- Stories reworked to the agreed variant order: Default (sidebar only),
  Secondary Nav · Sidebar, Workflow · Vertical, Workflow · Horizontal,
  With Right Panel, Customizable (controls-driven), plus a hidden overlay
  test story. Play tests cover collapse, zone hiding, the step dropdown,
  and the right panel; unit tests cover responsive auto-collapse,
  ShellContext, and zone switches.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 17, 2026 17:49
@owilliams-tetrascience
owilliams-tetrascience requested review from a team as code owners July 17, 2026 17:49
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ts-lib-ui-kit-storybook Ready Ready Preview, Comment Jul 17, 2026 7:53pm

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Evolves DataAppShell into a more composable “zone-based” AppShell container with a shared collapse model and context, enabling vertical/horizontal navigation variants and additional layout slots while keeping the shell domain-agnostic.

Changes:

  • Introduces ShellContext (+ hooks) to publish shell layout state (navVariant, collapsed, etc.) to zone children.
  • Refactors DataAppShell into a CSS-grid “zones” layout, adds responsive auto-collapse, and unifies collapse behavior across zones (optionally via hideNavOnCollapse).
  • Reworks SecondaryNav, stories, and adds unit tests to cover new collapse/zone behaviors.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/components/composed/DataAppShell/ShellContext.tsx Adds context + hooks for publishing shell layout state to children.
src/components/composed/DataAppShell/SecondaryNav.tsx Updates secondary nav to optionally follow shell collapse; adds collapsed horizontal dropdown mode; uses shared collapse button.
src/components/composed/DataAppShell/index.ts Exposes new context hooks/types and shared collapse button from the module entrypoint.
src/components/composed/DataAppShell/DataAppShell.tsx Converts layout to grid “zones”, adds single collapse model + auto-collapse, primary sidebar behavior, and provider wiring.
src/components/composed/DataAppShell/DataAppShell.stories.tsx Reworks stories around a single configurable demo composition; updates play tests for new behaviors.
src/components/composed/DataAppShell/CollapseButton.tsx Introduces shared collapse/expand affordance component.
src/components/composed/DataAppShell/tests/DataAppShell.test.tsx Adds unit coverage for auto-collapse, zone visibility, horizontal nav, and context behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/composed/DataAppShell/CollapseButton.tsx Outdated
Comment thread src/components/composed/DataAppShell/DataAppShell.stories.tsx
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…lapse toggle

- The secondary (side) zone now starts below the top bar in the vertical
  grid, so breadcrumbs span the full width beside the primary nav —
  matching the playground layout.
- When a secondary nav is present, the collapse chevron renders only
  there; the primary sidebar's brand-row chevron is suppressed so there
  is exactly one collapse affordance.
- The collapsed horizontal workflow stays in its own bar below the
  breadcrumbs, folding its items into the compact step dropdown in place
  (no longer moved into the top bar by the story).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Follow-up to the review suggestion: use the design-system cn() helper so
consumer classes properly override the base via tailwind-merge instead of
plain string concatenation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The Data App Shell section now lists only Docs + the agreed variants
(Default, Secondary Nav · Sidebar, Workflow · Vertical, Workflow ·
Horizontal, With Right Panel, Customizable). The auxiliary regression
stories (breadcrumbs, help button, mobile nav, TDP links, nav groups,
etc.) are tagged !dev — hidden from the sidebar but still executed by
the test runner, so their play coverage is unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 96.76% (🎯 83%)
⬆️ +0.04%
22862 / 23626
🟢 Statements 96.76% (🎯 83%)
⬆️ +0.04%
22862 / 23626
🟢 Functions 95.95% (🎯 74%)
⬆️ +0.04%
997 / 1039
🟢 Branches 90.38% (🎯 81%)
⬆️ +0.11%
4388 / 4855
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/components/composed/DataAppShell/CollapseButton.tsx 100% 100% 100% 100%
src/components/composed/DataAppShell/DataAppShell.tsx 100%
🟰 ±0%
95.71%
⬆️ +7.14%
92.85%
⬆️ +3.97%
100%
🟰 ±0%
src/components/composed/DataAppShell/SecondaryNav.tsx 99.72%
⬇️ -0.28%
90.52%
⬇️ -1.37%
100%
🟰 ±0%
99.72%
⬇️ -0.28%
358
src/components/composed/DataAppShell/ShellContext.tsx 100% 83.33% 100% 100%
Generated in workflow #1032 for commit b2fa23d by the Vitest Coverage Report Action

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants