This story restores the live Matters search box by connecting
?q= to the new GET /app/matters server-side
search contract from pramaan-spec#1271. The app no longer filters only
the rows already visible on the current page.
openapi/app-api.json was synced from
pramaan-functions/main, then pnpm codegen
regenerated src/gen.
| Contract point | Result |
|---|---|
AppListMattersQueryParams |
Includes optional q. |
| Deprecated matter-list cursor path |
cursor and limit are gone from the matter
list query contract.
|
MatterListResponse |
No longer exposes nextCursor. |
| File | Change |
|---|---|
src/lib/matters/gateway.ts |
Trims and forwards q as a backend query parameter,
keeps numbered page/page_size, and
returns the cursor-free response view.
|
src/app/[locale]/(workspace)/matters/page.tsx |
Passes parsed ?q= into mattersGateway.list
with status, type, page, and page size.
|
src/components/matters/live-matters-list-page.tsx |
Keeps the existing debounced SettingsSearch URL update
and page reset, then renders backend-returned rows directly.
|
src/app/api/internal/matters/route.ts |
Maps generated browser query params to the gateway without
limit fallback or nextCursor output.
|
The old client-side path searched only the rows already returned for the
active page. A matter on page 3 could never appear while the browser was
holding page 1 rows. Now the search term is part of the server request,
so total, page count, and returned rows all describe the
searched backend result set.
pnpm test tests/unit/matters-contract.test.ts tests/unit/matters-internal-route.test.ts pnpm typecheck pnpm lint pnpm test pnpm build git diff --check
17 file(s), +47 / -124 lines
| Path | Role | + | - |
|---|---|---|---|
| openapi/app-api.json | Config | +23 | -52 |
| src/app/[locale]/(workspace)/matters/page.tsx | App route | +2 | -1 |
| src/app/api/internal/matters/route.ts | App route | +2 | -2 |
| src/components/matters/live-matters-list-page.tsx | Component | +3 | -8 |
| src/components/matters/matters-live-filters.ts | Component | +0 | -23 |
| src/gen/client/appListMatters.ts | Generated contract | +1 | -1 |
| src/gen/hooks/useAppListMatters.ts | Generated contract | +1 | -1 |
| src/gen/hooks/useAppListMattersSuspense.ts | Generated contract | +1 | -1 |
| src/gen/schemas/matterListResponse.json | Generated contract | +0 | -5 |
| src/gen/types/AppListMatters.ts | Generated contract | +6 | -7 |
| src/gen/types/MatterListResponse.ts | Generated contract | +0 | -4 |
| src/gen/zod/appListMattersSchema.ts | Generated contract | +2 | -3 |
| src/gen/zod/matterListResponseSchema.ts | Generated contract | +0 | -7 |
| src/lib/matters/gateway.ts | Library | +1 | -1 |
| src/lib/matters/types.ts | Library | +1 | -1 |
| tests/unit/matters-contract.test.ts | Test | +2 | -4 |
| tests/unit/matters-internal-route.test.ts | Test | +2 | -3 |