feat(web): cache trading page data #16

Merged
pregno merged 1 commit from feat/15-improve-page-data-loading into main 2026-06-17 08:55:21 +02:00
Owner

Summary

  • Add centralized TanStack Query defaults for the web app so recently loaded page data stays warm across navigation.
  • Tune Trading positions to reuse cached data while preserving the 15s mounted refresh interval.
  • Tune trade-automation overrides to stay warm longer and keep mutation invalidations on the affected query keys.
  • Add tests covering the query client defaults and Trading query option constants.

Closes #15

Test plan

  • npm exec -- vitest run (used local installed tooling because pnpm is not on PATH)
  • npm exec -- tsc --noEmit -p packages/shared/tsconfig.json
  • npm exec -- tsc --noEmit -p apps/server/tsconfig.json
  • npm exec -- tsc --noEmit -p apps/web/tsconfig.json

Risk notes

  • Trading positions can be up to 15 seconds stale on quick route re-entry, matching the existing refresh cadence.
  • Global query defaults disable window-focus refetch and use a 30s stale window; mutation invalidations still force updates after writes.
  • No backend/API behavior changed.
## Summary - Add centralized TanStack Query defaults for the web app so recently loaded page data stays warm across navigation. - Tune Trading positions to reuse cached data while preserving the 15s mounted refresh interval. - Tune trade-automation overrides to stay warm longer and keep mutation invalidations on the affected query keys. - Add tests covering the query client defaults and Trading query option constants. Closes #15 ## Test plan - `npm exec -- vitest run` (used local installed tooling because `pnpm` is not on PATH) - `npm exec -- tsc --noEmit -p packages/shared/tsconfig.json` - `npm exec -- tsc --noEmit -p apps/server/tsconfig.json` - `npm exec -- tsc --noEmit -p apps/web/tsconfig.json` ## Risk notes - Trading positions can be up to 15 seconds stale on quick route re-entry, matching the existing refresh cadence. - Global query defaults disable window-focus refetch and use a 30s stale window; mutation invalidations still force updates after writes. - No backend/API behavior changed.
pregno merged commit 66ac616d01 into main 2026-06-17 08:55:21 +02:00
pregno deleted branch feat/15-improve-page-data-loading 2026-06-17 08:55:21 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pregno/polymarket-screener!16
No description provided.