## 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>
We use the quota term for actual billing quotas, so using "Quota" as a term for configurable Realtime limits is confusing. While there are varying per-plan limits, they are not used for billing. Realtime Quotas on plans refer to Realtime Messages and Realtime Peak Connections
* chore(docs): add python type gen using CLI guide
* chore: use relative URL instead of absolute one
* chore: add python type gen to docs
* fix: change users to movies
* chore: change .ts to .py
* chore: fix syntax
* Prettier
* fix(docs): instantiate client in the example
* Update apps/docs/content/guides/api/rest/generating-python-types.mdx
---------
Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>
Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
* docs: fix silent 404/build error on SSR guide (missing partial)
* Move file
* Make it possible for server-side doc to act as top level and menu toggle
* Prettier
---------
Co-authored-by: Aymeric Giraudet <neadj59@gmail.com>
* feat: Add Flask quick start
* feat: Add Flask (python) quick start to the menu
* Small changes
---------
Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
* feat: Add an Expo quick start
* feat: Add Expo quick start to the side menu
* Add new partials
---------
Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
* Delete
* Add redirect and remove menu items from the sidebar
* Remove more
* Tidy redirects
* Revert "Delete"
This reverts commit 4a2726a0a6.
* Redirect
* Reapply "Delete"
This reverts commit 9f92a111ef.
* docs: improve BYOM guide for MCP server deployment and OAuth integration
* fix rebase
* fix pnpm.lock
* docs: clarify MCP guide and example naming
* fix pnpm-lock
* docs: remove basePath from MCP tutorial and example
- Remove misleading comment about Edge Functions routing
- Remove basePath as it's not needed - Edge Functions automatically strip /functions/v1/<functionName> prefix
- Simplify code to just use const app = new Hono()
* docs: clarify --no-verify-jwt flag and authentication options
- Explain that omitting --no-verify-jwt enables JWT verification at Edge Function layer
- Clarify this provides basic protection for internal servers but not full MCP auth
- Update authentication section to be consistent
- Add tip in deployment section about omitting the flag
* fiox format
* PR feedback
* chore: restore pnpm-lock.yaml from master
* docs: improve BYOM guide for MCP server deployment and OAuth integration
* fix tutorial for simple mcp server
* remove authentication section
* fix rebase
* fix pnpm.lock
* add Zod to dictionary
* remove authentication from the beginning
* fix mcp-lite link
* change order of deno.json
* fix mcp-handler
- Move from Audit Trail naming to more explicit "Auth Audit Logs" / "Platform Audit Logs" (we were throwing in the term trails on the pricing page but using logs in dashboard and docs)
- New Platform Audit Logs docs under security
- Moved Platform Audit Logs under Security on pricing page given it is not just for dashboard (previous category), but also for API
- Added tooltips for both on pricing page
* docs: update Refine svg in HeroFrameworks
* docs: use capital R for Refine mentions
* docs: use main branch for Refine repository references
* docs: update connect interface example code for Refine
* docs: update Refine quick start tutorial with Refine v5
* examples(refine-user-management): upgrade to Refine v5
* docs: update Refine getting started tutorial with Refine v5
* chore(studio): update Refine icon on Connect modal
* docs: update Refine svg
* docs: update welcome screen screenshot in Refine tutorial
* docs: update dimensions of welcome screen screenshot in Refine tutorial
* chore: remove leftover dist assets from Refine example
* chore(linter): add Refine to Rule001 and Rule003
* chore: format getting started with Refine.mdx
* chore: remove .prettierrc file from the example
* fix(QueuesSettings): skip PostgREST config update for self-hosted projects
* docs(queues): add guide to expose self-hosted queues
* feat(QueuesSettings): add docs link for exposing pgmq_public schema in self-hosted instance
* fix ui, open link in new tab
* fix lint issues
---------
Co-authored-by: Ali Waseem <waseema393@gmail.com>
Co-authored-by: Andrey A. <56412611+aantti@users.noreply.github.com>
* Fix childProps in Admonition so that they're added as a prop to the main div.
* Replace the admonition with Alert in Wrapper tab page to add a gap between childs.
* Add s3 vectors fdw.
* Minor fix to FormSection.
* Update the fdw mutations to support passing in options.
* Refactor the vector flow to create fdws.
* Revert cron description change.
* If the bucket can't be created, don't create a fdw.
* Update/delete the fdw when deleting a table or a bucket.
* Minor fixes.
* Clean up the delete modal.
* Handle edge cases when missing a wrapper.
* Remove the admonition in the create bucket modal.
* Fix the loading state when creating a bucket.
* Fix the createWrapper sheet to work with s3 vectors.
* Fix undefined wrapperMeta issue.
* Create the schema when installing a wrapper.
* Tiny cleanup.
* Clean up unneeded useState. Create a wrapper only if the all conditions are met.
* Fix all comments.
* Add s3 vectors for docs.
* Add a link and fix the file name for S3 Vectors in docs.
* Hide the table editor button if the wrapper instance is missing.
* Small fixes.
* #40024 fixed unreachable pages from navigation menu
* simplified nav item name
* fixed format using pnpm run format command
* fixed more sections, replaced `url: "/"` with overview path
---------
Co-authored-by: Paul <ibeabuchi@worklio.cz>
* Add Pedro Rodrigues to humans.txt
* docs: add MCP-lite Edge Functions tutorial
- Add comprehensive tutorial on building MCP servers with mcp-lite on Supabase Edge Functions
- Add navigation entries in Examples and Third-Party Tools sections
- Based on Fiberplane blog post about mcp-lite and Supabase integration
* docs: remove redundant 'supabase init' step from MCP-lite tutorial
The template from 'npm create mcp-lite@latest' already initializes Supabase, so this step is not needed.
* docs: clarify local development steps for MCP-lite tutorial
- Separate 'supabase start' and 'supabase functions serve' into distinct steps
- Clarify that npm run dev only serves the function, not starts Supabase
- Make it clear these should be run in separate terminals
* style: format MCP-lite tutorial with prettier
* Update apps/docs/content/guides/functions/examples/mcp-server-mcp-lite.mdx
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Fix rules
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
* refactor(docs): enhance NavigationMenuGuideListItems component
* cleanup..
* Resolve formatting conflicts in NavigationMenuGuideListItems
* Came up with a crazy recursive approach...
* some changes.
* More cleanups...
* more cleanups....
* formatting the stuff
* refactor(navigation): remove sample menu data and optimize icon rendering in RecursiveNavigation
* cleanup...
* feat: enhance navigation with recursive dropdown indicators and performance optimizations
- Add visual chevron indicators for expandable sidebar items
- Implement recursive navigation system using existing NavMenuSection types
- Auto-expand accordion sections containing current active page on load/refresh
- Extract LinkContainer as independent component to prevent recreation on renders
- Fix React 19 compatibility issues with ref handling using useCallback pattern
- Resolve duplicate key warnings with improved key generation strategy
- Optimize accordion transition timing (500ms duration with ease-in-out) to prevent element overlap
- Preserve existing icon logic with hasLightIcon support for theme variants
- Maintain backward compatibility with existing navigation data structures
Performance improvements:
- Memoized recursive components to prevent unnecessary re-renders
- Stable component references for better React reconciliation
- Proper TypeScript interfaces with explicit prop definitions
UX improvements:
- Smooth accordion animations with physics-based easing
- Clear visual indicators for expandable menu items
- Automatic expansion of sections containing current page
- Professional-grade transition animations
Technical details:
- Uses existing NavMenuSection recursive type structure
- Implements containsActivePath helper for active page detection
- Leverages Radix UI accordion with proper data-state attributes
- Maintains all existing functionality including dynamic menu injection
* Cleanup...
* feat: implement cookie-based persisted state for navigation accordion
- Replace localStorage with cookie-based persistence for SSR compatibility
- Add proper cookie helpers with SameSite=Lax and 30-day expiration
- Implement initialization state to prevent hydration mismatches
- Maintain auto-expand functionality for active page sections
- Preserve user's manual accordion state across page refreshes and sessions
- Add debounced cookie updates (300ms) for performance optimization
- Use proper cookie naming convention: 'supabase-docs-nav-state'
Benefits:
- SSR compatible: Works with server-side rendering
- Cross-session persistence: Maintains state across browser sessions
- Better security: Cookies are more secure than localStorage
- Performance: Debounced updates prevent excessive cookie writes
- User experience: Seamless navigation state preservation
* refactor: implement individual item-based persistence following reference pattern
- Replace global state management with individual item persistence
- Use sessionStorage with 'nav-expansion-' prefix for each item
- Follow the exact pattern from reference: usePersistedExpansionState hook
- Maintain auto-expansion for active page sections
- Simplify state management by removing complex global state
- Each accordion item manages its own expansion state independently
- Preserve user's manual toggle state across page refreshes
- Use sessionStorage instead of cookies for better performance
Benefits:
- Cleaner architecture: Each item manages its own state
- Better performance: No global state updates
- Simpler logic: Direct item-to-storage mapping
- Reference pattern compliance: Follows established patterns
- Individual control: Each section can be toggled independently
- Session persistence: Maintains state during browser session
* refactor: implement URL-driven navigation state following Supabase docs pattern
- Replace sessionStorage persistence with URL-driven expansion state
- Follow the established Supabase docs pattern: URL as single source of truth
- Remove individual item persistence hooks in favor of pathname-based logic
- Implement useUrlDrivenExpansion hook that determines open sections from current URL
- Use getSectionsContainingPath to find all sections that should be expanded
- Remove manual toggle functionality - sections open/close based on URL navigation
- Maintain smooth transitions and visual indicators for expandable sections
- Ensure consistency and reliability by using URL as the definitive state source
Benefits:
- Reliability: URL is always the single source of truth
- Consistency: Matches existing Supabase docs navigation behavior
- Simplicity: No complex state management or storage concerns
- Performance: No localStorage/sessionStorage operations
- SSR Compatible: Works perfectly with server-side rendering
- Predictable: Navigation state is always consistent with current page
* persistant state.
* file delete
* cleanup..
* file cleanup
* cleanup...
* cleanup..
* formatting..
* aww shit that it.
---------
Co-authored-by: Alan Daniel <stylesshjs@gmail.com>