Skip to content

Render the gallery on the server again, so search can see the templates - #429

Merged
singhharsh1708 merged 1 commit into
mainfrom
fix/gallery-ssr
Oct 3, 2026
Merged

singhharsh1708 merged 1 commit into
mainfrom
fix/gallery-ssr

Conversation

@singhharsh1708

Copy link
Copy Markdown
Owner

Fixes a regression I shipped an hour ago in #428.

Reading the filters with useSearchParams put the whole gallery behind a Suspense boundary, which bails out of prerendering. The served HTML then carried zero of the 22 cards: I counted them on production. Search is the second and fourth largest source of visitors after GitHub, so that page is exactly the one that must arrive complete.

The filters are now read from the server's own searchParams and handed to the client as its starting state. The browser still owns them after that, and still writes them back to the URL.

Measured on a production build: /templates serves 22 cards in the HTML, and /templates?for=SaaS&background=gradient serves 2, with the template names in the markup rather than only in a script. Driving it in Chrome after hydration behaves as before: Launch narrows to 1 and writes ?for=Launch, Clear filters restores 22, a shared link restores both chips and the A to Z order.

A test now fails if the gallery goes back to reading its filters in the browser, or grows a Suspense boundary again. vitest 682 of 682.

@vercel

vercel Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
scrollcraft Ready Ready Preview Oct 3, 2026 10:39am UTC

@singhharsh1708
singhharsh1708 merged commit 90e5db5 into main Oct 3, 2026
3 checks passed
@singhharsh1708
singhharsh1708 deleted the fix/gallery-ssr branch October 3, 2026 10:39

This branch was successfully deployed

1 active deployment
Preview — 64a54f1f Deployed Oct 3, 2026 by vercel[bot]
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