docs(design): add tabs / inline banners / compact-table-density to DESIGN.md
Adds: - Navigation > Sub-page tabs subsection (tab-underline recipes, count pill, ARIA) - Data Tables: row min-height 44px -> 32px + WCAG SC 2.5.5 rationale - Toast Notifications > Inline Banners subsection (4 variants table) Also adds Sprint 11 entry to CHANGELOG.md. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
26
CHANGELOG.md
26
CHANGELOG.md
@@ -6,6 +6,32 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added — Sprint 11 (Spectrum UX port: 4 primitives + compact density global)
|
||||
|
||||
**Frontend only** (233 vitest passing — baseline 212 + 21 new tests across 4 new specs)
|
||||
|
||||
- `frontend/src/hooks/useHashTab.ts` — NEW. Pure-TS hook that reads `window.location.hash`, falls back to a default tab id, and listens to `hashchange` (cleanup on unmount). No style dependency.
|
||||
- `frontend/src/components/Tabs.tsx` — NEW. `<Tabs items activeId onChange>` component. Underline variant: `tab-underline` / `tab-underline-active` CSS recipes. Count pill: `tab-count-pill` / `tab-count-pill-active` (`rounded-pill` exception per DESIGN.md). `role="tablist"` + `aria-selected` on tabs. Zero transitions.
|
||||
- `frontend/src/components/AlertBanner.tsx` — NEW. `<AlertBanner variant="error|warn|success|info" title? children>`. Border-l-4 semantic strip, `bg-paper`, Lucide icon at `size={16}`. ARIA: `role="alert"` for error/warn, `role="status"` for success/info. No shadow, no radius, no transition.
|
||||
- `frontend/src/components/BackLink.tsx` — NEW. `<BackLink to children>` renders `ArrowLeft` (Lucide, 14px) + text with `caption-md text-graphite hover:text-primary`. Replaces 3 hand-rolled back-link instances.
|
||||
- `frontend/src/styles/index.css` — Added recipes: `.tab-underline`, `.tab-underline-active`, `.tab-count-pill`, `.tab-count-pill-active`, `.alert-error`, `.alert-warn`, `.alert-success`, `.alert-info`, `.table-compact` (32px row density, global).
|
||||
- `frontend/src/pages/EngagementDetailPage.tsx` — Refactored to 3-tab layout (Schedule / Description / Simulations) wired via `useHashTab('schedule')`. Count pill on Simulations tab. BackLink replaces hand-rolled link.
|
||||
- `frontend/src/pages/SimulationFormPage.tsx` — Done banner and SOC-blocked banner migrated to `<AlertBanner>`. Both back-link instances replaced with `<BackLink>`.
|
||||
- `frontend/src/pages/TemplateFormPage.tsx` — Back-link replaced with `<BackLink>`.
|
||||
- `frontend/src/pages/EngagementsListPage.tsx` — Table marked `table-compact`, inline `px-xl py-md` padding removed from th/td (recipe handles it).
|
||||
- `frontend/src/pages/TemplatesListPage.tsx` — Same compact table treatment.
|
||||
- `frontend/src/pages/UsersAdminPage.tsx` — Same compact table treatment.
|
||||
- `frontend/src/components/SimulationList.tsx` — Same compact table treatment.
|
||||
- `DESIGN.md` — Added `### Navigation › Sub-page tabs` subsection; updated `### Data Tables` row min-height 44px → 32px with WCAG SC 2.5.5 rationale; added `### Inline Banners` subsection under `### Toast Notifications`.
|
||||
|
||||
**Tests added** (21 new assertions across 4 new spec files):
|
||||
- `tests/hooks/useHashTab.test.tsx` — 4 tests (default, hash read on mount, navigate(), empty-hash fallback)
|
||||
- `tests/components/Tabs.test.tsx` — 7 tests (render, aria-selected, active class, count pill, count-pill-active, onChange, brutalism)
|
||||
- `tests/components/AlertBanner.test.tsx` — 6 tests (4 variants × role + class, title prop, brutalism)
|
||||
- `tests/components/BackLink.test.tsx` — 4 tests (render, href, brutalism, svg icon)
|
||||
|
||||
**No backend changes.** No DB schema change. No migration.
|
||||
|
||||
### Changed — Sprint 7 (Terminal-SOC design refresh)
|
||||
|
||||
**Frontend** (136 vitest passing — unchanged count, 3 assertions updated for new token names)
|
||||
|
||||
Reference in New Issue
Block a user