perf: wave B — CLS fixes for home and gallery#45
Merged
Conversation
- HeroCrystal3D: reserve square aspect-ratio on SSR placeholder so the post-hydration Three.js Canvas swap-in doesn't shift layout (target: home CLS < 0.1, was 0.16) - FamilyCard: add explicit width/height="568" to the <img> SVG fallback matching the crystal SVG viewBox; browser now reserves space before the SVG byte stream lands (target: gallery CLS < 0.1, was 0.258) - index.astro: replace the two SectionHeader React islands (client:load) with the existing Astro variant src/components/ui-astro/SectionHeader.astro; removes a no-op React hydration step from the home critical path (combined with wave A's HeroCrystal3D client:idle, this targets home mobile TBT < 200ms, was 581ms) Part of audits/perf-2026-05/ remediation.
|
🚀 Preview deployed to: https://5f4e3c61.gemmology-dev.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/components/crystal/HeroCrystal3D.tsx): SSR placeholder now reserves square aspect-ratio viastyle={{ aspectRatio: '1 / 1' }}, eliminating the layout shift when the Three.js Canvas mounts post-hydration. Target: home CLS < 0.1 (was 0.16).src/components/gallery/FamilyCard.tsx):<img>fallback given explicitwidth="568" height="568"matching the crystal SVG viewBox; browser reserves the slot before SVG bytes arrive. Target: gallery CLS < 0.1 (was 0.258).src/pages/index.astro): Two<SectionHeader client:load>React islands replaced with the static Astro variant (src/components/ui-astro/SectionHeader.astro), removing a no-op hydration step from the home critical path. Combined with wave A'sHeroCrystal3D client:idledemotion, targets home mobile TBT < 200 ms (was 581 ms).Part of
audits/perf-2026-05/remediation (wave B of the performance optimisation plan).Test plan
npm run buildpasses with no type errors or warningsnpm run lint-and-checkclean