Files
supabase/apps
Alaister Young 2d71129bd9 fix(studio): preserve query params and hash across redirects
Next's redirects() carries the incoming query string and hash through to
the redirect destination; the TanStack beforeLoad redirects dropped them —
deep links like /project/x/sql/quickstarts?template=... lost the template
on the rewrite to /sql/examples, and /?next=new-project&projectName=foo
lost projectName.

matchRedirect (redirects.shared.ts) now merges the incoming query and hash
onto the destination via a new pure preserveQueryAndHash helper: params
already set on the destination win, keys the rule matched on (`has`) are
consumed, and a destination hash (e.g. billing#invoices) wins over the
incoming one. The `/` index route redirect does the same, consuming `next`
only when it matched. The shared module stays runtime-agnostic; the config
consumers (next.config.ts / vercel.ts) only import the tables and are
unaffected.

Claude-Session: https://claude.ai/code/session_01MLH8WVg8zBJnmZTYTV3ooo
2026-07-07 02:02:17 +08:00
..