Skip to content

perf: add skeleton loading state for heritage cards [closes #330]#370

Merged
zigzagdev merged 11 commits into
chore/improve-loading-speedfrom
perf/skeleton-loading
May 22, 2026
Merged

perf: add skeleton loading state for heritage cards [closes #330]#370
zigzagdev merged 11 commits into
chore/improve-loading-speedfrom
perf/skeleton-loading

Conversation

@zigzagdev
Copy link
Copy Markdown
Owner

Summary

  • New HeritageCardSkeleton: full-height pulse block matching thumbnail card dimensions
  • HeritageList: accepts isLoading — shows 6 skeletons while data loads
  • SearchResultsPage: accepts isLoading — shows 6 skeletons instead of empty grid
  • TopPageContainer: removed Loading… early return, passes isLoading to HeritageList
  • SearchHeritageResultsContainer: passes isLoading to SearchResultsPage

Test plan

  • Top page shows skeleton grid on initial load
  • Search results page shows skeleton grid while fetching
  • Skeletons disappear and cards appear without layout shift
  • animate-pulse shimmer is visible during loading

🤖 Generated with Claude Code

zigzagdev and others added 6 commits May 22, 2026 08:47
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…alidate in background

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…earch params

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… above-fold images

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zigzagdev zigzagdev force-pushed the perf/image-loading-optimization branch from 9a1fcf8 to eec7294 Compare May 21, 2026 23:53
zigzagdev and others added 5 commits May 22, 2026 08:54
…imensions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…hile fetching

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… grid while fetching

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… pass isLoading to HeritageList

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…eResultsContainer

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zigzagdev zigzagdev force-pushed the perf/skeleton-loading branch from 7c1f3fa to a705378 Compare May 21, 2026 23:54
@zigzagdev zigzagdev changed the base branch from perf/image-loading-optimization to chore/improve-loading-speed May 22, 2026 00:37
Copy link
Copy Markdown
Owner Author

@zigzagdev zigzagdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok 🌱

@zigzagdev zigzagdev merged commit 4f84495 into chore/improve-loading-speed May 22, 2026
1 check passed
@zigzagdev zigzagdev deleted the perf/skeleton-loading branch May 22, 2026 00:37
zigzagdev added a commit that referenced this pull request May 22, 2026
* perf: add stale-while-revalidate in-memory cache for heritage API calls [closes #333] (#368)

* perf: create api-cache utility with TTL-based get/set

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf: apply SWR cache to useTopPage — serve stale data instantly, revalidate in background

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf: apply SWR cache to useHeritageSearchQuery keyed by serialized search params

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf: add skeleton loading state for heritage cards [closes #330] (#370)

* perf: create api-cache utility with TTL-based get/set

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf: apply SWR cache to useTopPage — serve stale data instantly, revalidate in background

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf: apply SWR cache to useHeritageSearchQuery keyed by serialized search params

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(card): add isPriority prop — eager loading and fetchpriority for above-fold images

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(list): pass isPriority to first 3 cards in HeritageList

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(search): pass isPriority to first 3 cards in SearchResultsPage

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf: create HeritageCardSkeleton component matching thumbnail card dimensions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(list): add isLoading prop to HeritageList — show skeleton grid while fetching

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(search): add isLoading prop to SearchResultsPage — show skeleton grid while fetching

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(container): remove Loading… early return from TopPageContainer — pass isLoading to HeritageList

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(container): pass isLoading to SearchResultsPage in SearchHeritageResultsContainer

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf: lazy-load Map and DetailHeritageMap to shrink initial JS bundle [closes #331] (#372)

* perf: create api-cache utility with TTL-based get/set

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf: apply SWR cache to useTopPage — serve stale data instantly, revalidate in background

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf: apply SWR cache to useHeritageSearchQuery keyed by serialized search params

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(card): add isPriority prop — eager loading and fetchpriority for above-fold images

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(list): pass isPriority to first 3 cards in HeritageList

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(search): pass isPriority to first 3 cards in SearchResultsPage

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf: create HeritageCardSkeleton component matching thumbnail card dimensions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(list): add isLoading prop to HeritageList — show skeleton grid while fetching

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(search): add isLoading prop to SearchResultsPage — show skeleton grid while fetching

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(container): remove Loading… early return from TopPageContainer — pass isLoading to HeritageList

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(container): pass isLoading to SearchResultsPage in SearchHeritageResultsContainer

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(top): lazy-load Map component with React.lazy and Suspense pulse fallback

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* perf(detail): lazy-load DetailHeritageMap with React.lazy and Suspense pulse fallback

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(card): remove isPriority/fetchPriority/eager loading — caused 403 on UNESCO image URLs

fetchPriority="high" and loading="eager" triggered rate-limiting on UNESCO's
document server. Revert to loading="lazy" for all images. Keep width, height,
and decoding="async" for CLS prevention.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(card): revert image dimension attrs added for #332

Drop decoding="async", width/height hints — image optimization issue
is being closed without implementation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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