Commit Graph

54 Commits

Author SHA1 Message Date
Gildas Garcia 7f4b02f2a7 chore: update radix (#45111)
## Problem

In order to update to react 19, we need to update several dependencies

## Solution

- migrate to the `radix` umbrella package to ease upgrade
- update some dependencies


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Consolidated Radix UI usage to a single unified package across apps
and packages, updated package manifests and workspace catalog entries.
No user-facing behavior, visuals, or public APIs changed.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2026-04-27 11:03:28 +02:00
Devanshu Sharma 36a4a774f7 refactor(docs): enhance the docs sidebar UI (#38869)
* 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>
2025-10-16 10:04:07 -04:00
Greg Richardson 52cb7f82b2 Docs: MCP with AI tools (#33610)
* docs: mcp

* fix: change admonition type to note

* chore: add 'npx' to dictionary

* feat: adds windsurf example

* fix: adds codium to dictionary
2025-02-18 21:07:02 +00:00
Charis 2fb8b9f74c feat(docs): ai prompts section (#30342)
Co-authored-by: Francesco Sansalvadore <f.sansalvadore@gmail.com>
2024-11-26 13:43:04 -05:00
Charis 41d924b074 feat: new docs ia (#29364)
New Docs IA, mainly splitting up the miscellaneous bucket that is Platform into multiple sections
2024-10-09 12:38:34 -04:00
Francesco Sansalvadore 084294fe79 feat: docs breadcrumbs (#27929)
docs guides breadcrumbs
2024-07-15 10:25:13 +02:00
Charis ac192a5024 refactor(docs): migrate home page to app router (#27221) 2024-06-24 18:47:53 -04:00
Charis fa8c9f360b fix: docs sidebar collapse and highlight (#22108)
* fix: make sidebar collapse work when hash is selected

* fix: persist sidebar highlight when hash is selected

* chore: cleanup

* fix: fix enterprise sso case
2024-03-25 10:31:00 -04:00
Greg Richardson 4f9c7da788 chore: remove unused active prop on nav menus 2023-05-08 22:46:46 -06:00
Greg Richardson bc6dc86dab fix: prevent prefetch of hidden page links 2023-05-04 16:32:01 -06:00
pratikt 75b951ce86 docs: Visual bug on sidemenu #13421 2023-04-04 19:02:45 +05:30
Jonathan Summers-Muir 1b755c9713 move guides and fix accordion issue 2023-03-23 12:26:11 +08:00
Jonathan Summers-Muir 1aaa365670 init prop to force no collapse on docs side menu 2023-03-22 12:54:14 +08:00
Jonathan Summers-Muir 33f1c83710 Update NavigationMenuGuideList.tsx 2023-02-21 14:23:10 +08:00
Isaiah Hamilton 9e7623eb17 fix: docs sidebar 2023-02-20 23:11:05 -05:00
Terry Sutton f2a9aec58a Add Postgres Resources section to menu 2023-01-25 17:16:56 -03:30
Jonathan Summers-Muir c6cd65991d memo some components 2022-12-20 15:28:22 +08:00
Jonathan Summers-Muir 9bad9a7f0e more optimizing 2022-12-15 01:13:32 +08:00
Jonathan Summers-Muir 948132c406 do same with red docs 2022-12-14 01:47:41 +08:00
Jonathan Summers-Muir 6bc027997d start using react.memo to stop re-renders 2022-12-14 01:39:57 +08:00
Terry Sutton 79ae510d6f Fix self-hosting reference icons in menu items 2022-12-13 11:10:13 -03:30
Terry Sutton f146b0a371 Merge pull request #10912 from Hallidayo/docs-get-image-errors
docs: changed url paths
2022-12-13 10:42:34 -03:30
Ollie Halliday 0fd6dbc324 changed url paths 2022-12-13 13:51:17 +00:00
Jonathan Summers-Muir 2232dd1331 try more 2022-12-13 04:06:47 +08:00
Jonathan Summers-Muir a0afbdab3b moved state 2022-12-13 03:42:39 +08:00
Jonathan Summers-Muir a8811a49f4 use shallow links 2022-12-13 03:35:37 +08:00
Jonathan Summers-Muir 9f4187806b fixing mobile menu 2022-12-12 20:08:44 +08:00
Jonathan Summers-Muir 425f1992c7 fixed sidebar scrolling issues 2022-12-12 19:18:10 +08:00
Jonathan Summers-Muir 2ad16dcbc5 fix formatting on old docs 2022-12-12 17:59:26 +08:00
Jonathan Summers-Muir 64238c3ae7 moved a lot of docs around 2022-12-12 17:37:56 +08:00
Jonathan Summers-Muir a296f94d3f fixes to height issues of guide nav 2022-12-12 13:59:43 +08:00
Jonathan Summers-Muir 3e66153f5a more fixes 2022-12-11 14:48:12 +08:00
Terry Sutton 600ae9d9db Remove unneeded slashes before url path 2022-12-07 15:55:31 -03:30
Terry Sutton a069fab32b Add preamble files to top of ref 2022-12-06 09:55:05 -03:30
Jonathan Summers-Muir d2ca13e03e lots of homepage stuff 2022-12-06 16:28:00 +08:00
Terry Sutton d3bd00b4ca Fix light-dark icons in nav 2022-12-05 21:02:15 -03:30
Terry Sutton fef9f8e8d8 Fix unique key warnings 2022-12-05 10:14:45 -03:30
Jonathan Summers-Muir 756b932eb7 added passwordless page 2022-12-05 17:53:08 +08:00
Jonathan Summers-Muir b84cfa64c8 Added sub menus to sidebar 2022-12-05 13:37:59 +08:00
Terry Sutton 547acaf56d Add middleware to redirect bots to a single-file slug 2022-12-02 16:28:36 -03:30
Jonathan Summers-Muir b351649307 mobile menu changes 2022-11-28 14:53:42 +08:00
Terry Sutton 65f2feb59e Start mocking storage api spec 2022-11-24 15:58:22 -03:30
Terry Sutton 1584a831e0 Add cli config parsing 2022-11-24 14:06:05 -03:30
Jonathan Summers-Muir 74bbfd0f97 fix active states on side menu 2022-11-24 17:00:39 +08:00
Jonathan Summers-Muir a9df0d9f73 fix la menu 2022-11-21 21:00:21 +08:00
Jonathan Summers-Muir 8d5f05aa84 more nav fixes 2022-11-21 20:25:28 +08:00
Jonathan Summers-Muir 4316e9629c moved all guides to be on /docs. removing the temp path 2022-11-21 19:12:54 +08:00
Jonathan Summers-Muir 6c4bca8f0e started prepping for old vs new docs setup 2022-11-21 16:05:03 +08:00
Jonathan Summers-Muir 95e3dff290 adding GlassPanel, amended layouts a bit 2022-11-16 20:41:27 +08:00
Jonathan Summers-Muir ef7b86e87e use Link 2022-11-16 01:34:43 +08:00