Files
supabase/apps
Alaister Young f1cee47485 fix(studio): normalise same-origin absolute hrefs in next/link shim
The previous \`splitInternalUrl\` treated anything starting with a scheme
(\`http://\`, \`https://\`, …) as external and bailed out of the path/search
split — handing TanStack a full URL like
\`http://localhost:8082/project/abc/editor/123?schema=public\` as its
\`to\` prop. TanStack then treated that as an external link and let the
browser navigate via native anchor → full page reload.

This was the actual cause of the table-editor entity sidebar full-reload
on click: \`buildTableEditorUrl\` returns \`new URL(...).toString()\`,
which always produces a full origin-prefixed URL. The FK \"open table\"
button worked because it composes a relative path string instead.

Now: parse the href against \`window.location.origin\` (or a placeholder
on SSR), and if the result is same-origin, normalise to a relative path
and split into pathname/search/hash. Genuinely cross-origin URLs are
still left untouched so TanStack handles them as external.
2026-05-08 17:14:32 +08:00
..
2026-05-07 18:44:15 -04:00