perf(web): batch dashboard tile hydration #51

Merged
vince merged 2 commits from codex/dashboard-batch-tiles into main 2026-06-20 15:18:26 +02:00
Owner

Summary

Add batch dashboard tile hydration for the client and server.

Why

The dashboard should reduce request overhead by resolving queued tile hydration work in chunks while preserving the existing single-tile route as a fallback.

Changes

  • Adds POST /api/dashboard/tiles accepting { "tiles": DashboardTileReference[] }.
  • Returns { "state": "ready", "tiles": DashboardTileResolution[] }.
  • Resolves batch items through the same tile cache/coalescing path with server concurrency capped at 6.
  • Updates the client viewport hydration queue to send tile chunks of 6 to the batch endpoint.
  • Falls back to existing single-tile routes when batch hydration fails.
  • Adds router, route, concurrency, and client queue tests.

Testing

  • bun --filter @dimensionlab/web test -- src/server/index.test.ts src/server/routes/dashboard.test.ts src/lib/client/dashboard-refresh.test.ts src/App.test.tsx
  • bun --filter @dimensionlab/web check
  • bun install --frozen-lockfile
  • bun run check
  • bun run test

Notes

Existing /api/dashboard and /api/dashboard/tile/... routes remain compatible. No packages/ui changes.

## Summary Add batch dashboard tile hydration for the client and server. ## Why The dashboard should reduce request overhead by resolving queued tile hydration work in chunks while preserving the existing single-tile route as a fallback. ## Changes - Adds POST /api/dashboard/tiles accepting { "tiles": DashboardTileReference[] }. - Returns { "state": "ready", "tiles": DashboardTileResolution[] }. - Resolves batch items through the same tile cache/coalescing path with server concurrency capped at 6. - Updates the client viewport hydration queue to send tile chunks of 6 to the batch endpoint. - Falls back to existing single-tile routes when batch hydration fails. - Adds router, route, concurrency, and client queue tests. ## Testing - bun --filter @dimensionlab/web test -- src/server/index.test.ts src/server/routes/dashboard.test.ts src/lib/client/dashboard-refresh.test.ts src/App.test.tsx - bun --filter @dimensionlab/web check - bun install --frozen-lockfile - bun run check - bun run test ## Notes Existing /api/dashboard and /api/dashboard/tile/... routes remain compatible. No packages/ui changes.
vince added 1 commit 2026-06-20 15:12:33 +02:00
vince added 1 commit 2026-06-20 15:16:53 +02:00
vince merged commit a66f1fdd57 into main 2026-06-20 15:18:26 +02:00
Sign in to join this conversation.
No description provided.