Skip to content

CL-5773: Adopt TanStack Query as the web data layer - #17

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-5773-adopt-tanstack-query-as-the-web-data-layer
Aug 9, 2026
Merged

CL-5773: Adopt TanStack Query as the web data layer#17
TheGreatAxios merged 2 commits into
mainfrom
cl-5773-adopt-tanstack-query-as-the-web-data-layer

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

  • Introduce a shared TanStack Query client for the signed-in shell (query-client.ts, catalog dep).
  • Rewrite useAPIQuery / useTenantQuery / useAgentDirectory on TQ while keeping the APIQuery discriminant pages already render through QueryView.
  • Bench switch removeQueries on the tenant prefix; mutations invalidate instead of reloadKey.
  • Routines deep-link selects from the cached list (no racey second fetch); test harness wraps shell components in a QueryClientProvider.

Test plan

  • bun run typecheck (apps/web + monorepo)
  • bun run lint
  • bun test in apps/web (142 pass, stable across 3 runs)
  • Manual: sign in, switch benches, confirm principals reuse and tenant data refreshes; approve/reject, create agent, toggle routine — lists update without full reload

Closes CL-5773

Cover query-key mapping and the APIQuery adapter, and wrap shell
component tests in a shared QueryClientProvider so they exercise the
same provider boundary the signed-in app will use.
Replace hand-rolled useEffect fetch machines with a shared QueryClient
for the signed-in shell. APIQuery stays the page-facing discriminant;
hooks map TQ results into it. Bench switch drops tenant-scoped keys;
mutations invalidate instead of bumping reloadKey.
@TheGreatAxios
TheGreatAxios merged commit 4a3b61f into main Aug 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant