Skip to content

Keep the tool cards hidden until the stack is built, so they don't jump on load - #30

Merged
kvlonge merged 1 commit into
mainfrom
fix/tools-layout-first-paint
Dec 2, 2026
Merged

kvlonge merged 1 commit into
mainfrom
fix/tools-layout-first-paint

Conversation

@kvlonge

@kvlonge kvlonge commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Why

On a hard refresh the six tool cards painted as the plain three-column grid, then squashed into the right-hand column once tools.js built the disc stack.

Changes

  • theme.js (already a blocking script in the head) marks the page with a js class.
  • With that class, the tool grid stays hidden until tools.js adds is-exploded, then the picked card fades in where it ends up. A 3 s fallback shows the grid if tools.js never runs.
  • Without scripts, the cards still show as the plain grid.
  • Bumped the cache keys on styles.css and theme.js.

Verification

  • Hard load with an empty cache and slowed scripts: no grid before the stack is built (1440px).
  • Scripts off: all six cards visible at 1440 and 390px; scripts on: one card, no horizontal overflow.
  • npx playwright test: 9 passed.

@kvlonge
kvlonge merged commit 2bbc043 into main Dec 2, 2026
@kvlonge
kvlonge deleted the fix/tools-layout-first-paint branch December 2, 2026 18:17
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