Tier-6

Merged
HU
3mo ago
+11838-5761
  • Added unit tests for the History and Overview components using Vitest and Testing Library, improving test coverage and reliability.
  • Introduced contract tests to ensure OpenAPI paths align with expected schemas, enhancing API stability.
  • Implemented visual regression tests with Playwright to capture UI changes and maintain visual consistency.
  • Updated README and ROADMAP to reflect new testing capabilities and deployment instructions, including a full staging pipeline command.
  • Upgraded Wrangler to version 4 across the project for improved development experience.

Summary by cubic

Raises quality and DX with unit, contract, and visual tests plus a one-command staging deploy. Also ships an offline-ready PWA, i18n, scorecard export, and static OpenAPI docs.

  • New Features

    • Offline read-only PWA: vite-plugin-pwa with Workbox NetworkFirst for GET /sessions*, React Query persistence, and an OfflineBanner that hides mutations when offline.
    • Scorecard export: print-ready HTML via exportSessionScorecard() and a header button on Session Detail.
    • i18n: react-i18next with an en locale for nav and session detail; scorecard labels localized.
    • API docs: scripts/export-openapi.mjs creates apps/web/public/openapi.json; Redoc served at /docs/.
    • File input UX: FileField uses a hidden input + visible button and shows the selected filename.
  • Refactors

    • Testing: component tests for History and Overview (vitest + @testing-library/react), OpenAPI contract tests, and Playwright visual snapshots.
    • Caching: KV TTL set to 60s (Cloudflare minimum) with HTTP max-age=15; best‑effort KV writes; X-Cache retained.
    • Validation: isSessionId UUID check added to session routes for cleaner 404s.
    • Deploy DX: npm run deploy:staging:full (migrate → force-rls → rls check → seed → deploy); README quick start updated.
    • Dependencies: Wrangler upgraded to ^4; added vite-plugin-pwa, react-i18next, @tanstack/react-query-persist-client, and optional analytics (VITE_PLAUSIBLE_DOMAIN or VITE_CF_WEB_ANALYTICS_TOKEN).