Skip to content

Members tab subpaths + homepage search fixes#411

Merged
leerob merged 5 commits into
mainfrom
cursor/members-subpaths-and-search-fixes-fe84
Jun 9, 2026
Merged

Members tab subpaths + homepage search fixes#411
leerob merged 5 commits into
mainfrom
cursor/members-subpaths-and-search-fixes-fe84

Conversation

@leerob

@leerob leerob commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes three issues, plus a build failure discovered while deploying this branch:

1. Members page layout shift on hard reload

The Developers / Ambassadors / Companies tabs were a client-side ?tab= query param, so a hard reload on e.g. ?tab=companies first served the cached developers HTML and then shifted after hydration.

  • /members, /members/ambassadors and /members/companies are now dedicated fully prerendered static routes (verified ○ Static in the build output, 5m revalidate), each with its own tab-appropriate initial data (getMembers gained an ambassadorsOnly filter).
  • Tab switches are now prefetched <Link> navigations that carry the active q/sort params along, so client-side behavior matches the old query-param tabs.
  • Legacy URLs keep working via config redirects: /members?tab=ambassadors|companies → the new paths (plus a client-side cleanup of the leftover tab param), /companies/members/companies, and old paginated /members/:number URLs (digits only) → /members — the previous [...number] catch-all route is removed entirely. Footer and sitemap links updated.

2. Homepage: empty state on the first typed character

Fuse is configured with minMatchCharLength: 2, but search mode activated at 1 character — so the first keystroke always rendered "No plugins found". Search mode now requires two characters; until then the full leaderboard stays visible.

3. Homepage: exact match not first on Trending

Search results were re-sorted purely by the active tab metric (Trending = 30d install velocity), discarding relevance — searching "Vercel" ranked the exact match ~5th. While a search is active, plugins whose name or slug exactly matches the query are pinned to the top on every tab, and exact matches bypass Trending's has-installs filter so they can't disappear entirely. Non-exact matches keep their tab-metric order.

4. Build: USE_CACHE_TIMEOUT on /[slug] rule redirect pages

Every legacy rule redirect page (/[slug], ~3400 of them) awaited getRuleRedirects(), whose cache fill runs getPlugins({ fetchAll: true }) — the whole plugins table with all components, paged serially. With thousands of pages prerendering concurrently across build workers, waiting on that slow fill exceeded Next's use-cache prerender fill timeout and aborted the build.

Each page now resolves its own slug via a tiny per-slug cached query (getRuleRedirectTarget), and generateStaticParams uses a slugs-only query (getRuleRedirectSlugs) instead of the full-table fetch. The newest plugin still wins for duplicate rule slugs, matching the old map-building order.

Verification

  • bun run typecheck and bunx biome ci . pass (CI parity).
  • next build succeeds; new members routes are fully static and the prerendered HTML for each route contains the correct tab state (correct placeholder, active tab, content).
  • Ran the production server and verified redirects: /members?tab=companies/members/companies (307, preserves q/sort), /companies/members/companies (308), /members/2 and /members/15/members (308), /members/ambassadors and /members/companies → 200, /members/not-a-number → 404.
  • The sandbox has no DB credentials, so the USE_CACHE_TIMEOUT fix was validated structurally (build passes with the new query/page code); the real fix is that redirect pages no longer wait on the full-table plugins cache fill.
Open in Web Open in Cursor 

cursoragent and others added 3 commits June 9, 2026 13:43
/members, /members/ambassadors and /members/companies are now fully
prerendered static routes instead of a client-side ?tab= query param,
so hard reloads serve the exact tab HTML with no layout shift. Tab
switches are prefetched Link navigations that carry q/sort along.
Legacy ?tab= URLs and /companies redirect to the new paths; legacy
paginated /members/:n URLs still serve the developers page.

Co-authored-by: Lee Robinson <lee@leerob.com>
Fuse is configured with minMatchCharLength: 2, so filtering on the
first character always produced an empty result set and flashed the
'No plugins found' state. Keep showing the full leaderboard until the
query is at least two characters.

Co-authored-by: Lee Robinson <lee@leerob.com>
Search results were re-sorted purely by the active tab metric, so on
Trending an exact match like 'Vercel' could rank below fuzzier matches
with higher recent install velocity. While a search is active, exact
name/slug matches now sort first on every tab (and bypass Trending's
has-installs filter so they can't disappear entirely).

Co-authored-by: Lee Robinson <lee@leerob.com>
@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
cursor-directory Ready Ready Preview, Comment Jun 9, 2026 3:38pm

Request Review

The [...number] route only existed to serve old paginated URLs
(/members/2, ...) the same developers page. A digits-only permanent
redirect to /members does the job without an extra route; unknown
non-numeric paths now 404 instead of silently rendering the page.

Co-authored-by: Lee Robinson <lee@leerob.com>
Every /[slug] redirect page awaited getRuleRedirects(), whose cache
fill runs getPlugins({ fetchAll: true }) — the entire plugins table
with all components, paged serially. With ~3400 of these pages
prerendering concurrently across build workers, waiting on that slow
fill exceeded Next's use-cache prerender timeout and failed the build.

Each page now resolves its own slug with a tiny per-slug cached query
(getRuleRedirectTarget), and generateStaticParams uses a slugs-only
query (getRuleRedirectSlugs) instead of the full-table fetch. Newest
plugin still wins for duplicate rule slugs, matching the old map.

Co-authored-by: Lee Robinson <lee@leerob.com>
@leerob leerob merged commit 689fcba into main Jun 9, 2026
4 checks passed
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.

2 participants