Skip to content

Batch fetch results for smoother card transitions#51

Merged
brdv merged 1 commit intomainfrom
fix/optimize-loading
Mar 29, 2026
Merged

Batch fetch results for smoother card transitions#51
brdv merged 1 commit intomainfrom
fix/optimize-loading

Conversation

@MathijsR94
Copy link
Copy Markdown
Collaborator

@MathijsR94 MathijsR94 commented Mar 28, 2026

Summary

  • Replace progressive per-user setResults calls with Promise.allSettled + a single batched state update
  • Cards now stay in skeleton state until all fetches complete, then transition together with badges already computed
  • Eliminates badge flickering caused by computeBadges re-running on every individual result update

Test plan

  • Fetch with 2+ users — all cards should show skeleton, then appear together with badges
  • Trigger a fetch error (e.g. typo in username) — errored card shows error, others show data, all in one transition
  • Change date range mid-fetch — stale results should not be applied (abort guard)
  • Add a single user via settings — still updates progressively (uses fetchUser, not fetchAll)

@MathijsR94 MathijsR94 requested a review from brdv March 28, 2026 11:49
@MathijsR94 MathijsR94 added the ui & polish Visual refinements and animations label Mar 28, 2026
@brdv brdv force-pushed the fix/optimize-loading branch from 812d28c to dca6b7e Compare March 29, 2026 14:56
@brdv brdv merged commit 21ef5ba into main Mar 29, 2026
1 check passed
@brdv brdv deleted the fix/optimize-loading branch March 29, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui & polish Visual refinements and animations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants