Problem
Browsing bundled design systems from the home composer can feel sluggish on a slower daemon or filesystem. The picker eagerly resolves a full design-system detail for transient hover/focus states, and overlapping consumers can repeat the same read.
With a local production build and 300 ms simulated latency on GET /api/design-systems/:id, rapidly scanning the first eight official presets produced eight detail HTTP attempts and repeatedly replaced the preview pane with a loading state.
Reproduction
- Run
pnpm tools-dev run web --prod --no-env-file.
- Open the design-system picker from the home composer.
- Add 300 ms latency to
GET /api/design-systems/:id.
- Move quickly through the first eight official presets without selecting one.
Expected behavior
- Transient hover/focus states should not start a detail read.
- A stable preview target should load once, even when multiple consumers request it concurrently.
- Bundled preset details should be reusable during the browsing burst.
- Editable systems must still show fresh content immediately after a write.
- Reading one bundled detail should not require parsing the full design-system catalog.
Proposed scope
- Add a short shared hover/focus intent before activating the preview.
- Coalesce overlapping detail, preview, and showcase reads.
- Cache immutable bundled details briefly while keeping editable-system reads fresh.
- Invalidate and fence in-flight detail reads after successful mutations.
- Resolve bundled detail summaries directly with canonical, case-sensitive IDs.
Verification targets
- A red-on-main/green-on-branch test for hover/focus intent.
- Registry tests for coalescing, abort behavior, cache lifetime, write invalidation, and stale in-flight fencing.
- Daemon tests proving single-ID reads avoid a catalog scan and reject non-canonical casing.
- Local before/after measurement under the same simulated latency.
Problem
Browsing bundled design systems from the home composer can feel sluggish on a slower daemon or filesystem. The picker eagerly resolves a full design-system detail for transient hover/focus states, and overlapping consumers can repeat the same read.
With a local production build and 300 ms simulated latency on
GET /api/design-systems/:id, rapidly scanning the first eight official presets produced eight detail HTTP attempts and repeatedly replaced the preview pane with a loading state.Reproduction
pnpm tools-dev run web --prod --no-env-file.GET /api/design-systems/:id.Expected behavior
Proposed scope
Verification targets