mirror of
https://github.com/supabase/supabase.git
synced 2026-10-15 14:19:11 +03:00
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.