## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.
YES
## What kind of change does this PR introduce?
Bug fix
## What is the current behavior?
On reference documentation pages (/reference/cli/*,
/reference/javascript/*, etc.), the sidebar navigation sometimes gets
"stuck"; clicking a different section scrolls the page correctly, but
the sidebar highlight remains on a previously selected item instead of
updating to the newly selected one.
This issue is intermittent and typically occurs after the page has been
idle for 2-3 minutes. It appears to be caused by Next.js's usePathname()
hook returning stale data after the internal router state becomes
desynced from the actual browser URL (which is updated via
history.pushState/replaceState).
## What is the new behavior?
The sidebar now reliably highlights the correct active section, both
when:
- Clicking sidebar links
- Scrolling through the page (scroll spy)
This is achieved by introducing a custom useCurrentPathname() hook that:
1. Reads directly from window.location.pathname (the source of truth)
2. Subscribes to history.pushState and history.replaceState changes
3. Uses React 18's useSyncExternalStore for proper external state
synchronization
The implementation uses a singleton pattern to ensure history methods
are only patched once, even when multiple components subscribe.
## Additional context
https://github.com/user-attachments/assets/87da13e0-6b01-44d9-8ce5-f12d0dcaa8fb
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Improved navigation reliability by enhancing active reference tracking
in menus when navigating between documentation pages.
* Fixed inconsistent pathname updates to ensure more reliable navigation
state synchronization across the documentation interface.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: Illia Basalaiev <illiab@IMB3.local>
Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
- Add validation for missing required variables
- Add validation for unexpected variables
- Provide detailed error messages showing expected vs provided variables
- Include partial path in error messages for better debugging
- Add comprehensive tests for new error scenarios
Error messages now clearly indicate:
- Which variables are missing
- Which variables are unexpected
- What variables were expected vs provided
Co-authored-by: Claude <noreply@anthropic.com>
* Remove extra file.
* Remove unneeded tsconfig.jsons.
* Add @/* alias for importing in-package files to all apps.
* Remove baseUrl from all apps except studio (it'll require changes in almost all files).
* Fix baseUrl issues in docs, ui-library and design-system.
* Fix the typecheck for cms app. Fix all baseUrl errors in the cms app.
* Add deprecated flag to baseUrl in www.
* fix(docs): multiple edits and enhancements
* fix: edited to remove typos and align with the linter
* fix: remove more typos and a bit more linter compliance
* fix: correct minor typos
* chore: add linter exclusion
* fix: exclude lint check for imgproxy
* fix: move disable lint to separate lines
* chore: make prettier happy
* chore: typos plus add linux docker desktop
* chore: fix typos and add link to postgres password guidelines
* chore: stress postgres password recommendation
* fix: use relative paths for docs references
* chore: add a note about all digits in dashboard password
* chore: add a note about no-telemetry and design partnerships if enterprise
* chore: initial import of a simpler jwt generator component
* fix: grammar, some sections reorg, use simpler generator
---------
Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
* feat(code-block): add word wrap functionality and controls to code blocks
* feat(code-block): enhance layout of code block with improved line number display and structure
* fix h-full issue
* fix Prettier issue
---------
Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
* Fix the error for babel/preset-typescript in docs.
* Unfix the version.
* Try using amaro for type stripping.
* Run prettier after stripping types.
* Fix tests.
---------
Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
* update configs for different clients
* add codex and minor fixes
* sort clients by popularity
* add onCopy handle to other mcp clients
* remove optional operator for onCopy
* fix system theme
* fix rebase
* fix mdx
A few troubleshooting guides aren't syncing properly, for miscellaneous
issues:
- Misformatted link
- Edge cases with Markdown parsing:
- GFM automatically wraps emails in angle brackets, which subsequently
breaks MDX because it expects anything wrapped in angle brackets to be a
JSX tag
- toMarkdown inserts sentinel comments between certain blocks, which
subsequently breaks MDX for the same reason
* docs: prefer project config for Claude Code
* docs: prefer CLI for Claude Code MCP installation
* docs: authentication instructions for Claude Code
* docs: update MCP authentication admonition
Not all clients automatically prompt login, and we now preselect the correct organization for project scoped MCP servers.
* fix: disable `contentEditable` on claude code codeblocks
* fix: only show "Authentication" note for hosted platform
* fix: platform/project selector wrapping for small screens
* fix: disable contentEditable on codeblock to hide system spellcheck
* feat: standalone codeblock for mcpUrl
* fix: use <Portal> for client select popover to improve scrollIntoView behavior
* feat: remove "Other" client option
* feat: tooltip specifying MCP transport / auth requirements
* feat: update auth tooltip copy, only show for hosted platform
* docs: remove old local Supabase MCP instructions
* feat: improve description on docs feature group
---------
Co-authored-by: Greg Richardson <greg.nmr@gmail.com>
* feat: MCP URL builder
- Creates an MCP URL builder component that allows a user to choose options via a UI, then automatically builds the URL and config needed for various MCP clients
- Adds this component to studio Config modal and docs MCP page
* fix(mcp url builder): mcp-remote options
mcp-remote handles OAuth, so no need to pass personal access token
* fix(docs): mcp
We are pushing the remote MCP server rather than the local one, so removing
references to the local server from documentation.
* fix(mcp url builder): ui messages
- Clarify read-only mode
- Storage is not enabled in the defautl configuration
* fix: mcp url builder
- Refactor unnecessary hook into a utility function
- Fix background color in dark mode
* feat: update remote MCP base URL
* docs: update MCP getting started
- Restores relevant content from prod
- Adds callout about authentication
- Adds next steps to remote MCP installation section
* Update apps/docs/content/guides/getting-started/mcp.mdx
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* feat: click selected project to unselect
This follows the unselect pattern from shadcn combobox example
https://ui.shadcn.com/docs/components/combobox
* Update apps/docs/content/guides/getting-started/mcp.mdx
Co-authored-by: Greg Richardson <greg.nmr@gmail.com>
* Update apps/docs/content/guides/getting-started/mcp.mdx
Co-authored-by: Greg Richardson <greg.nmr@gmail.com>
* Update apps/docs/content/guides/getting-started/mcp.mdx
Co-authored-by: Greg Richardson <greg.nmr@gmail.com>
* fix: light mode connection icons
* chore: format `mcp.mdx`
* fix: VS Code URL handler "name"
Based on docs the field is "name" instead of "id":
- https://code.visualstudio.com/docs/copilot/customization/mcp-servers#_commandline-configuration
- https://code.visualstudio.com/docs/copilot/customization/mcp-servers#_url-handler
* refactor: `NEXT_PUBLIC_MCP_URL` environment variable
* feat: move client selector below options
* feat: "Add to" buttons left aligned about config file
* feat: actionable login hint
* feat: condition supported feature groups on platform
* feat: platform selector, mcp url for self-hosted
* feat: update copy for platform selection
* fix: base URL logic, copy
* fix: form MCP url from apiUrl in self-hosted studio
* chore: unused file
* fix: don't populate apiUrl for docs
* fix: omit `project_ref` for self-hosted
* docs: tweak copy for CLI platform
* chore: optional instead of nullable `apiUrl`
* chore: type sharing / inference for platform type
* feat: 'development' self-hosted feature group
* feat: omit read-only switch/param for local/self-hosted
* refactor: remove claude desktop client option
Replay of https://github.com/supabase/supabase/pull/36867/commits/59670f6771bca8e81fa62c0d3115288b82bfbb5d
---------
Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Greg Richardson <greg.nmr@gmail.com>
Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com>
* feat: MCP URL builder
- Creates an MCP URL builder component that allows a user to choose options via a UI, then automatically builds the URL and config needed for various MCP clients
- Adds this component to studio Config modal and docs MCP page
* fix(mcp url builder): mcp-remote options
mcp-remote handles OAuth, so no need to pass personal access token
* fix(docs): mcp
We are pushing the remote MCP server rather than the local one, so removing
references to the local server from documentation.
* fix(mcp url builder): ui messages
- Clarify read-only mode
- Storage is not enabled in the defautl configuration
* fix: mcp url builder
- Refactor unnecessary hook into a utility function
- Fix background color in dark mode
* feat: update remote MCP base URL
* docs: update MCP getting started
- Restores relevant content from prod
- Adds callout about authentication
- Adds next steps to remote MCP installation section
* Update apps/docs/content/guides/getting-started/mcp.mdx
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* feat: click selected project to unselect
This follows the unselect pattern from shadcn combobox example
https://ui.shadcn.com/docs/components/combobox
* Update apps/docs/content/guides/getting-started/mcp.mdx
Co-authored-by: Greg Richardson <greg.nmr@gmail.com>
* Update apps/docs/content/guides/getting-started/mcp.mdx
Co-authored-by: Greg Richardson <greg.nmr@gmail.com>
* Update apps/docs/content/guides/getting-started/mcp.mdx
Co-authored-by: Greg Richardson <greg.nmr@gmail.com>
* fix: light mode connection icons
* chore: format `mcp.mdx`
* fix: VS Code URL handler "name"
Based on docs the field is "name" instead of "id":
- https://code.visualstudio.com/docs/copilot/customization/mcp-servers#_commandline-configuration
- https://code.visualstudio.com/docs/copilot/customization/mcp-servers#_url-handler
* refactor: `NEXT_PUBLIC_MCP_URL` environment variable
* feat: move client selector below options
* feat: "Add to" buttons left aligned about config file
* feat: actionable login hint
* refactor: remote claude desktop client option
---------
Co-authored-by: Matt Rossman <22670878+mattrossman@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Greg Richardson <greg.nmr@gmail.com>
Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com>
The filtering for `sdk:auth` feature flag on the navigation was a a bit too
aggressive, kicking in on the Management API reference when it should only apply
to the Client SDK references.
Previous behavior: $Show component only works with enabled feature
flags: if feature flag is on, content is shown
New behavior: $Show component also works with negated feature flags: if
feature flag is off, content is shown
Required for enabling custom content in forked builds
* Fix(docs): prevent SecurityError from rapid history.replaceState calls during fast scrolling
* url now chases the scroll
* fixing merge conflicts
* refactor: minor changes to safeHistoryReplaceState
---------
Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>