core/workbench-ui/README.md
Shay cdead696ed
feat(W-027): Workbench frontend shell — five-region grid + ten empty routes + live StatusFooter (ADR-0160 / ADR-0162) (#299)
- Five-region CSS grid shell (TopBar, LeftNav, Main, StatusFooter; Inspector collapsed)
- Ten placeholder routes with EmptyState cli/string variants and ApiErrorBoundary
- Extended EmptyState API: nextAction accepts string (button) | { kind: "cli", command }
- Updated CommandPalette: real fuzzy search over three commands (Chat, Proposals, Evals)
  with ↑/↓/Enter keyboard nav and useInRouterContext degradation for Branch 1 preview
- TanStack Query hooks for all W-026 endpoints; 30s polling on runtime/status
- TypeScript mirror of workbench/schemas.py at src/types/api.ts
- StatusFooter: mutation_mode badge, git_revision (copy on click), checkpoint_revision
  with amber warning + ADR-0157/ADR-0158 expansion note
- TopBar: CORE Workbench wordmark, ⌘K palette trigger, connection pill
- ApiErrorBoundary (class component) catches WorkbenchApiError → ErrorState
- scripts/dump-api-schemas.py: AST-based Python dataclass field extractor
- workbench-ui/api-schema-snapshot.json: checked-in drift sentinel
- 51 tests across 10 files (0 failures); enum-coverage 4/4; clean vite build
2026-05-26 12:09:12 -07:00

61 lines
1.5 KiB
Markdown

# CORE Workbench UI
React/Vite/TypeScript frontend for CORE Workbench — a local operator UI for
inspecting engine state, proposals, evals, and audit trails.
## Local development
```bash
# Terminal 1 — start the API (W-026)
uv run core workbench api
# Terminal 2 — start the frontend
cd workbench-ui
pnpm install
pnpm dev # http://127.0.0.1:5173
```
## Custom API URL
```bash
VITE_WORKBENCH_API_URL=http://127.0.0.1:9000 pnpm dev
```
## Design system baseline
```bash
pnpm preview # Serves dist/ on http://127.0.0.1:4173
# Navigate to /preview for the Branch 1 design-system baseline
```
## Tests
```bash
pnpm test # Vitest unit + component tests
pnpm test:enum-coverage # Badge enum coverage (requires uv)
```
## Schema drift detection
The TypeScript types in `src/types/api.ts` mirror `workbench/schemas.py`.
To check for drift after Python schema changes:
```bash
# From repo root
uv run python scripts/dump-api-schemas.py
# Then run: pnpm test (api.test.ts catches field-level drift)
```
## Architecture
- `src/app/` — Shell, TopBar, LeftNav, StatusFooter, ApiErrorBoundary
- `src/api/` — apiFetch client, TanStack Query hooks
- `src/types/` — TypeScript mirrors of Python schemas
- `src/routes/` — Route placeholder components
- `src/design/` — Branch 1 design-system substrate (DO NOT MODIFY except EmptyState and CommandPalette)
## ADR cross-references
- ADR-0160 — Workbench v1 architecture
- ADR-0162 — Design substrate (Branch 1)
- ADR-0156, ADR-0157, ADR-0158 — Engine-state checkpoint and reboot audit trail