Docs nav alternate: land on section pages and route "All" to the home page#4074
Draft
twjeffery wants to merge 2 commits into
Draft
Docs nav alternate: land on section pages and route "All" to the home page#4074twjeffery wants to merge 2 commits into
twjeffery wants to merge 2 commits into
Conversation
…l search Make the docs side nav behave like navigation rather than an in-menu expander. - Clicking a top level section (Components, Get started, Foundations) now lands on that section's index page instead of only swapping the in-menu view. The destination page derives and shows the matching submenu from the URL. - A submenu's "All" item now navigates to the home page and auto-opens global search, reinforcing search as a primary way to navigate, instead of silently collapsing back to the parent menu. Auto-open is driven by an openSearch=1 marker that SearchModal checks on mount and then strips from the URL. The shared "All" item is extracted into AllHomeItem, and the now unused in-menu state handlers (onSelectSection, onBack) are removed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014KqafCHdPSm7GsgVWwAVHN
|
Preview links
Built from commit 0c2d294. Previews are removed automatically when this PR closes. |
Auto-opening the global search modal when clicking "All" felt intrusive, like it opened something the user did not intend. "All" now simply navigates to the home page, where the hero search field is already front and center, keeping search emphasized without forcing the modal open. Removes the openSearch marker, the SearchModal mount-time auto-open effect, and the now unused search-utils helpers. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014KqafCHdPSm7GsgVWwAVHN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is an alternate version of the docs side navigation, put up for comparison against current production. Use this PR's preview link as "version B" and production as "version A". It is not necessarily meant to be merged as is.
It addresses a mismatch between how the side menu looks and how it behaves: the top sections look clickable but only expand an in menu view, and the "All" item looks like a back/navigation control but only collapses the menu.
What changes
1. Sections navigate to their page
Clicking a top level section now lands on that section's index page instead of only swapping the in menu view:
/components(All Components)/get-started/foundationsThe destination page still shows the matching submenu (it is derived from the URL). Tokens and Examples are unchanged.
2. "All" goes back to the home page
The "All" item at the top of each submenu now navigates to the home page instead of silently collapsing back to the parent menu. The home page's hero search field is front and center, so search stays emphasized without anything popping open.
How it works
SiteNavderives which submenu to show from the URL, so no in menu click state is needed./). The shared "All" item is extracted intoAllHomeItem, and the now unused in menu state handlers (onSelectSection,onBack) were removed.Before / After
Before: Components, Get started, and Foundations expand a secondary in menu view without navigating. "All" (arrow back icon) collapses the submenu with no page change.
After: those sections navigate to their index page. "All" navigates back to the home page.
Compare the preview link against production for the visual before/after.
Steps to test
Notes
astro check. The changed files introduce no new type errors. Remaining check errors are pre existing artifacts of the unbuilt web components dist, on lines not touched here.🤖 Generated with Claude Code
https://claude.ai/code/session_014KqafCHdPSm7GsgVWwAVHN