Web Dashboard Development
Extend the strict TypeScript dashboard without breaking query, routing, API, cluster, or design contracts.
Every cache and request that varies by cluster must include or clear cluster scope to prevent cross-cluster stale data.
Application architecture
React and Vite use explicit routing, query caches, reusable components, Monaco, and terminal primitives.
API and state contracts
The shared request layer owns credentials, CSRF, errors, cluster selection, and streaming reconnect behavior.
Develop and verify
Use strict build, lint, Vitest/MSW, and the appropriate Playwright mode; UI changes cite Pencil node IDs.
WEB CHECK
Build and type checking
npm run build— TypeScript strict compile (tsc -b) followed by Vite bundling. Fails on type errors; never bypass with@ts-ignoreoranywithout explicit justification.npm run lint— ESLint checks; must pass before commit.npm test— Vitest unit suite with MSW mocking of the API layer; runs in parallel by default.
E2E testing
npm run test:e2e:mock— Playwright against a local dev server and mocked API responses (fast, ~2 min).npm run test:e2e:live— Playwright against the live e2e Kind cluster (slower, ~10 min; requiresmake e2e-upand the Go e2e suite, which writes the admin password totest/e2e/.tmp/; or runmake test-web-e2e-live).npm run screenshots— Capture UI screenshots for design comparison (mock mode).
Dev server
Run make web-dev from the repo root to start the Vite dev server with a proxy to the in-cluster API (requires make dev-up first). The dev server hot-reloads on save; CSS changes apply instantly, component changes reload with state preserved.
Design and PRs
UI changes must be designed first in design.pen (Pencil MCP, never edit directly) before writing React code. When submitting a PR with visual changes:
- Export the touched design nodes to
design-export/json/<id>.jsonanddesign-export/screenshots/<id>.png(automated during design export). - Cite the Pencil node ID in your PR description (e.g., “Implements design node
ZwM1N(Web Dashboard Development…)”). - Reference the screenshot in the PR for visual comparison.
This ensures the design source remains canonical and reviewers can compare intent to implementation without re-opening the design tool.