[Story-1045] Clients client-cache pilot

Story 1045Epic 92525 files · +1566/−103

PR #240 · pramaan-io/pramaan-app · merged 2026-06-05

How it flows

sequenceDiagram
  autonumber
  participant browser as Browser
  participant server as Next.js Server
  participant api as Internal API
  browser->>server: GET /app/clients
  server->>api: Kubb → /api/internal/clients
  api->>server: clients list
  server->>server: embed data in page
  server->>browser: HTML + cached hooks
  browser->>browser: first paint: table ready
  browser->>browser: /clients/new server-action (untouched)

clients-client.test.tsx

Methodin → outwhat it does
ResizeObserver(class)browser API mock so jsdom tests for the table layout run reliably

What changed, file by file

Test file for the clients view; adds a ResizeObserver mock so jsdom-based table tests pass reliably for the new client-cache pilot.

new classsignature
ResizeObserver(class)

What does NOT happen

session + key server-side
Storybook fallback used
add route untouched
route messages only
hardcoded copy grep has pre-Story-1045 hits only
Clerk test persona unavailable in this worktree

Files changed (25)

File±
docs/walkthroughs/story-1045-clients-pilot.png+0
docs/walkthroughs/story-1045-walkthrough.html+154
messages/en.json+1
messages/hi.json+1
src/app/[locale]/(workspace)/clients/clients-client.test.tsx ★+120
src/app/[locale]/(workspace)/clients/clients-client.tsx ★+143
src/app/[locale]/(workspace)/clients/clients-empty-state.tsx+39
src/app/[locale]/(workspace)/clients/clients-header.tsx+59
src/app/[locale]/(workspace)/clients/clients-pager.tsx+60
src/app/[locale]/(workspace)/clients/clients-table-row.tsx+67
src/app/[locale]/(workspace)/clients/clients-table.tsx+56
src/app/[locale]/(workspace)/clients/clients-tabs.tsx+41
src/app/[locale]/(workspace)/clients/clients-view.tsx+72
src/app/[locale]/(workspace)/clients/page.test.tsx+9 −6
src/app/[locale]/(workspace)/clients/page.tsx+23 −26
src/app/[locale]/(workspace)/clients/presentation.ts+100
src/app/api/internal/clients/route.ts+77
src/components/clients/clients-cache-pilot.stories.tsx ★+161
src/lib/clients/gateway.ts+97 −39
src/lib/clients/query.ts+17
src/lib/kubb-client.ts+3
src/lib/query/client.ts+17 −13
tests/unit/clients-contract.test.ts+46 −7
tests/unit/clients-internal-route.test.ts+136
tests/unit/lib/kubb-client.test.ts+67 −12