feat: nav-suite : sidebar layout variant + search dialog + mobile bar - #10
Merged
Conversation
… and Showcase components by adding icons and adjusting padding for improved user experience
…g OpenSearch method and JS interop
…unctionality, including responsive styling
…yout, enhancing user experience with layout variants and mobile support
… enhancing sidebar navigation and search capabilities
… enhanced search capabilities for pages and headings
…apsible sidebar functionality and a floating toolbar for improved navigation experience
… and introduce SearchIndex for enhanced navigation and search capabilities
…improving visual appeal and user experience
…nd heading entry generation from navigation graph
…earch parameter, allowing for flexible display on different layouts
…setting ShowSearch to false in HomeLayout, streamlining the layout for specific use cases
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
Two Phase-2 primitives landed together because they're tightly UX-coupled: a sidebar layout variant (drops the top nav; brand + search + collapse live in the sidebar itself, floating shadcn
sidebar-04aesthetic) and a full search dialog with build-time index + Cmd+K + fuzzy match. Consumer flips between the classic top-nav look and the new floating sidebar via one enum value.Combined into one branch because both surfaces need to know where search lives — TopNav puts a search chip in the header, Sidebar puts it in the sidebar. Designing both together avoids awkward intermediate states.
What's in it
Layout variant
DocsLayoutVariantenum (TopNav|Sidebar) onShellDocsOptions.TopNavremains the default.DocsLayout.razorbranches on the variant. TopNav →<DocsHeader />at top + sidebar underneath (unchanged). Sidebar → no top nav,<DocsSidebarHeader />mounted at the top of the sidebar with brand + search chip + collapse toggle.--background, sidebar = the only "floating" card (--cardbg, subtle border + shadow, inset margins). Content sits flush.Sidebar collapse
SidebarCollapseStatescoped service —IsCollapsed,Toggle,Expand,Collapse,OnChangeevent.DocsSidebarHeader(top-right of the sidebar header row) with apanel-left-closelucide icon.cardbg + border + shadow) surfaces two buttons: reopen-sidebar + search.Mobile bar (Sidebar variant only)
<DocsMobileBar />component. Sticky top row visible only below 1024px.<ThemeToggle />(pushed right).display: none, desktop keeps the sidebar-only chrome.Search primitives
SearchIndexinShellDocs.Core— walks the navigation graph, emits oneSearchEntryper page + per h2/h3 heading (headings extracted via fenced-code-safe regex against the markdown files at graph-build time).Url,Title,Description,Section(parent page/section title),Kind(Page|Heading).AddShellDocs.SearchStatescoped service — global open/close state observed by the dialog and any trigger (header chip, sidebar chip, Cmd+K keyboard, mobile bar).<SearchDialog />component — modal overlay + backdrop, input row with kbd hint, ranked results list with page/heading icons + section subtitle, keyboard-driven (↑/↓ navigate, Enter open, Esc close, mouse hover also highlights).shelldocs.js(bridges to Blazor viaDotNetObjectReference).Polish carried in
chevron-downpolyline that rotates 180° when the dropdown opens. Same geometry + spring easing as the collapsible section toggles — consistent iconography across all sidebar controls.↑↓→←. Kept CLI-console arrows (terminal aesthetic) and doc-comment arrows.--backgroundso content scrolls fully hidden beneath it (fumadocs pattern).display: flex; flex-direction: columnon the Sidebar-variant.docs-sidebar-slot+flex: 1; min-height: 0on the child<nav>. Fixes the theme toggle disappearing below the fold when the sidebar tree got tall..btn svg { width: 0.9rem; height: 0.9rem; }after arrow icons ballooned to the default 24×24 and wrapped labels across three lines.Preview app
Program.csflips toLayoutVariant = DocsLayoutVariant.Sidebarso the new layout is the default demo. Flip toTopNavto switch back.Tests
SearchIndexTests.cs— 5 tests. Builds a temp markdown tree viaNavigationGraphBuilder, verifiesSearchIndex.FromGraphemits one entry per page, headings for h2/h3 with anchored URLs, section attribution, and description carry-through.Notes
feat/sidebar-collapse-icon-railfollow-up. Ship the base + reopen toolbar first, iterate.search-index.jsonemission isfeat/search-index-buildfollow-up. Header + title matching covers 80% of docs-site search intent.ThemeStatechange scoped for sidebar-variant only? — no, ThemeToggle behaviour is unchanged. The mobile bar simply renders one alongside the other buttons.Test plan
dotnet build shelldocs.slnx— cleandotnet test— 99 passingSidebarvariant — brand + search + collapse-toggle visible in the sidebar header, floating card aestheticCmd/Ctrl+Kopens search dialog from any docs page; type "tabs" or "callout", ↑↓ ranks, Enter navigates, Esc closesLayoutVarianttoTopNav, confirm classic look still works untouchedNext branch:
feat/content-primitives— the small markdown components every docs page needs (Callout proper, Card, LinkCard, Tabs, Steps, FileTree). ~1 day of work, biggest immediate DX win for consumers.