core/workbench-ui/src/app/App.tsx
Shay 0ff3e3b2c8 feat(workbench): Settings route — wired prefs + read-only runtime status (Wave R2, final route)
Replaces SettingsRoutePlaceholder, completing all six placeholder routes.

- workbenchPrefs.ts: typed localStorage prefs with safe parse + live
  same-tab sync (useWorkbenchPrefs). Every pref has a real consumer — no
  toggle that does nothing:
    * landingRoute -> consumed by the App index redirect (Navigate)
    * inspectorDefaultOpen -> consumed by EvidenceProvider initial state
      (EvidenceUrlSync still force-opens on a ?inspect= deep link)
- SettingsRoute: two panels. Preferences (landing route select + inspector
  default switch, applied on next load, survive reload). Runtime (read-only
  /runtime/status: backend, git_revision DigestBadge, engine_state_present,
  checkpoint_revision, revision_warning with warning token, active_session_id,
  mutation_mode) under the standing statement 'Engine configuration is
  CLI-only. This page mutates nothing on the server.'
- no backend change, no new schema/subject, no NOT_YET_MIRRORED change, no
  engine mutation of any kind
- bespoke conformance block (Settings has no empty state — the prefs panel
  always renders); asserts the loading label + CLI-only statement + the
  error contract over the status fetch
- tests: workbenchPrefs (defaults / persist+reload / invalid+malformed
  fallback / partial merge) + SettingsRoute (both panels, landing-route
  persistence, inspector toggle, error-without-mutation)

DEFERRED (flagged, not shipped as theater): list-density pref — honest
wiring requires threading a density token through every list row, a
separate change; shipping a control that does nothing would violate
ADR-0160 (audit-native, not analytics theater). Token-only styling
(hexScan green); full vitest 363 green.
2026-06-12 21:39:41 -07:00

41 lines
1.9 KiB
TypeScript

import { BrowserRouter, Routes, Route, Navigate } from "react-router-dom";
import { QueryClientProvider } from "@tanstack/react-query";
import { queryClient } from "../api/queries";
import { Shell } from "./Shell";
import { PreviewPage } from "../preview/PreviewPage";
import { ChatRoute } from "../routes/ChatRoute";
import { ProposalsRoute } from "./proposals/ProposalsRoute";
import { TraceRoute } from "./trace/TraceRoute";
import { AuditRoute } from "./audit/AuditRoute";
import { ReplayRoute } from "./replay/ReplayRoute";
import { EvalsRoute } from "./evals/EvalsRoute";
import { RunsRoute } from "./runs/RunsRoute";
import { PacksRoute } from "./packs/PacksRoute";
import { VaultRoute } from "./vault/VaultRoute";
import { SettingsRoute } from "./settings/SettingsRoute";
import { getWorkbenchPrefs } from "./workbenchPrefs";
export function App() {
return (
<QueryClientProvider client={queryClient}>
<BrowserRouter>
<Routes>
<Route path="/" element={<Shell />}>
<Route index element={<Navigate to={`/${getWorkbenchPrefs().landingRoute}`} replace />} />
<Route path="chat" element={<ChatRoute />} />
<Route path="trace/:turnId?" element={<TraceRoute />} />
<Route path="replay/:artifactId?" element={<ReplayRoute />} />
<Route path="proposals/:proposalId?" element={<ProposalsRoute />} />
<Route path="evals/:laneId?" element={<EvalsRoute />} />
<Route path="runs/:sessionId?" element={<RunsRoute />} />
<Route path="packs/:packId?" element={<PacksRoute />} />
<Route path="vault" element={<VaultRoute />} />
<Route path="audit" element={<AuditRoute />} />
<Route path="settings" element={<SettingsRoute />} />
</Route>
<Route path="/preview" element={<PreviewPage />} />
</Routes>
</BrowserRouter>
</QueryClientProvider>
);
}