Repository navigation
Description
Task
T-085b· Milestone M8 — Dashboard · Size S · Priority P0 · Epic #8Implements FR-DSH-008
Branch
feat/t-085b-web-app-shell-router-all— one task = one branch = one PR (doc 32 §6)
Summary
Implement web/src/app/router.tsx with every route of doc 13 §2 (lazy-loaded feature pages with placeholder EmptyStates), providers.tsx (QueryClient, Theme, SSE provider stub), MarginRail (Bench, Campaigns, Trials, Spaces, Workbench, Settings, theme toggle) and a top-level error boundary rendering problem+json details.
Context / motivation
Gives every screen task a stable mount point so feature work can proceed in parallel without touching shared files.
Scope
In scope
- Route modules registered from
features/*/routes.tsx(one line each inrouter.tsx).
Implementation guidance
web/src/app/router.tsx:createBrowserRouterwith the routes of doc 13 §2:/,/campaigns/new,/campaigns/:id(nested tabsconsole|runs|casebook|atlas|insights|settings, defaultconsole),/runs/:id,/trials,/trials/:id,/spaces,/spaces/:id/:version,/workbench,/reports/:id, and*NotFound.- Each feature exports
routes.tsx(export const benchRoutes: RouteObject[]) usinglazy: () => import('./BenchPage');router.tsxonly concatenates arrays (one line per feature, append-only). providers.tsx:QueryClientProvider(defaults inlib/queryClient.ts:staleTime10 s, retry only on network errors, never on 4xx),ThemeProvider(initial theme from runtimedefaultTheme, user choice persisted inlocalStorage, setsdata-theme),SseProviderplaceholder (implemented in T-085d), RadixTooltipProvider.MarginRail(doc 13 §3.1): vertical nav with icons + accessible labels, active route viaaria-current="page", theme toggle at the bottom,MarginRailSlotcontext so features (e.g. the console Spine) can render into the rail; collapses to icons below 1024 px.- Error boundary: route
errorElementrendersProblemView(title, detail, copyable trace_id) forProblemError, a generic message otherwise. - Standards: respect the layering contracts (doc 16 §2) and conventions in doc 34; no hard-coded tunables — thresholds/defaults come from typed settings (doc 27); no magic numbers (ruff
PLR2004); public APIs typed (mypy strict) and documented.
Acceptance criteria
- Every route renders without errors (Vitest smoke over route list).
- MarginRail keyboard navigable with visible focus ring.
- Unknown route renders NotFound with a link back to Bench.
- Theme choice persists across reload.
- Each lazy route produces its own chunk (build manifest check).
- Tests listed below added and green in CI; coverage of new code meets the gate in doc 18 §3.
- Docs, config reference and CHANGELOG
Unreleasedupdated where behaviour, keys or interfaces changed. - Definition of Done (doc 32 §3) satisfied.
Tests required
web/src/app/router.test.tsx.- Vitest route smoke test iterating over the route table with MSW handlers.
Dependencies
Blocked by: #162 (T-085a)
Blocks: #165 (T-085d), #184 (T-115)
Parallelization notes
Files / paths owned by this task — avoid editing other paths; shared files (pyproject.toml entry points, cli/main.py, api/routers/__init__.py, router.tsx, docker/compose.yaml, ci.yml) are append-only:
web/src/app/**web/src/components/MarginRail/**
After this, features are independent folders.
Definition of Done
Per doc 32 §3 and AGENTS.md §5: lint, format, mypy strict and import-linter green; tests added and passing; docs updated; PR template completed with Closes #<this issue>; Conventional Commit messages referencing T-085b (doc 16 §6); commits authored only by the repository owner identity (AGENTS.md §4); CI green; reviewer checklist (doc 32 §5.1) satisfied.
References
Design docs: doc 13 §2 · doc 13 §5 · doc 13 §4
Requirements: FR-DSH-008 (traceability: doc 28)
External:
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsBacklog
Activity
/config.json), SSE client with reconnect/Last-Event-ID and query-cache patching #165g b,g c,/,j/k,r,?) and shortcuts dialog #184