ViewComponents
SidebarDisplayHelper
SourceNormalizes AppSurface Docs sidebar labels, grouping, and namespace display names.
Remarks
SidebarDisplayHelper treats the authored Namespaces route family specially so API reference pages stay grouped together. Path inputs are trimmed, slash-normalized, and allowed to be empty only where the method explicitly documents the fallback.
GetGroupName
2 overloads
string GetGroupName(DocNode node)
Source
Gets the sidebar group for a documentation node, honoring explicit metadata except for namespace pages.
Parameters
nodeThe documentation node to classify.
Returns
The normalized group name, Namespaces for namespace pages, or a path-derived fallback.
string GetGroupName(string path)
Source
Gets the sidebar group implied by a source path.
Parameters
pathA source or docs path. Directory separators and leading or trailing slashes are normalized.
Returns
Namespaces for namespace paths, General for root files, or the containing directory.
NormalizeGroupName
string? NormalizeGroupName(string? groupName)
Source
Trims an authored group name and converts blank values to null.
Parameters
groupNameThe authored group name.
Returns
A trimmed group name, or null when no meaningful group was authored.
IsTypeAnchorNode
bool IsTypeAnchorNode(DocNode node)
Source
Determines whether a node represents a generated type-anchor entry below a parent API page.
Parameters
nodeThe node to inspect.
Returns
true when the node has a parent, no body content, and a fragment path.
GetFullNamespaceName
string GetFullNamespaceName(DocNode node)
Source
Gets the full namespace represented by a namespace documentation node.
Parameters
nodeA node from theNamespacesroute family or a fallback titled node.
Returns
The namespace path after Namespaces/, an empty string for the root, or the node title fallback.
GetNamespaceFamily
string GetNamespaceFamily(string fullNamespace, IReadOnlyList<string> namespacePrefixes)
Source
Gets the top-level namespace family after configured prefix simplification.
Parameters
fullNamespaceThe full namespace to simplify.namespacePrefixesPrefixes that may be removed before family extraction.
Returns
The first simplified namespace segment, or the whole simplified value when it has no dot.
GetNamespaceDisplayName
string GetNamespaceDisplayName(string fullNamespace, IReadOnlyList<string> namespacePrefixes)
Source
Gets the display name for a namespace after removing its family segment.
Parameters
fullNamespaceThe full namespace to simplify.namespacePrefixesPrefixes that may be removed before display extraction.
Returns
The namespace remainder after the family segment, or the simplified namespace when no remainder exists.
SimplifyNamespace
string SimplifyNamespace(string fullNamespace, IReadOnlyList<string> namespacePrefixes)
Source
Removes the first matching configured namespace prefix from a namespace.
Parameters
fullNamespaceThe namespace to simplify. Blank values becomeNamespaces.namespacePrefixesCandidate prefixes, with optional trailing dots.
Returns
The simplified namespace, the last prefix segment for exact prefix matches, or the original namespace.
GetDerivedNamespacePrefixes
string[] GetDerivedNamespacePrefixes(IEnumerable<DocNode> docs)
Source
Derives shared namespace prefixes from the root namespace pages in a docs set.
Parameters
docsThe harvested documentation nodes.
Returns
The shared prefix with and without trailing dot, or an empty array when no common prefix exists.
GetLastNamespaceSegment
string GetLastNamespaceSegment(string namespaceValue)
Source
Gets the last segment of a namespace value.
Parameters
namespaceValueA dot-delimited namespace value.
Returns
The segment after the last dot, or the original value when no dot exists.
DocSectionDisplayBuilder
SourceShapes public-section snapshots into the grouped link structures used by section pages and the shared sidebar.
BuildGroups
IReadOnlyList<DocSectionGroupViewModel> BuildGroups(DocSectionSnapshot snapshot, string? currentHref = null, IReadOnlyList<string>? namespacePrefixes = null, string docsRootPath = "/docs")
Source
Builds grouped section links for one public section snapshot.
Parameters
snapshotThe public-section snapshot to group for display.currentHrefThe current docs href, if known. When provided, matching links are marked current for accessibility and styling.namespacePrefixesOptional namespace prefixes used to shorten API-reference labels and family headings. When omitted, API-reference groups derive prefixes from the visible pages insnapshot.docsRootPathThe app-relative docs root path used to build canonical links for the current surface.
Returns
The grouped link model for the supplied section snapshot.
Remarks
Editorial sections stay flat and task-oriented, while DocPublicSection.ApiReference delegates to the namespace-aware grouping path so API reference content stays organized by family. API-reference groups intentionally omit generated type-anchor children from these global navigation models, and deeper namespace children are nested under their nearest useful parent so repeated namespace prefixes do not dominate the primary sidebar. Non-namespace API pages, such as JavaScript public API groups, remain visible under their own family groups. Readers reach type, member, and item anchors from the page-local outline, source links, or search instead of loading every symbol into the primary sidebar.
SidebarViewComponent
SourceA view component that renders the sidebar navigation for public documentation sections.
Remarks
The component returns a DocSidebarViewModel whose DocSidebarViewModel.Sections contain normalized public section links and whose DocSidebarViewModel.Diagnostics is populated only when maintainer diagnostics chrome is visible for the configured options and host environment.
InvokeAsync
Task<IViewComponentResult> InvokeAsync()
Source
Retrieves the normalized public sections and optional diagnostics chrome, then shapes them into the sidebar display model.
Returns
A view result containing the section-first sidebar view model and optional diagnostics chrome.
Remarks
InvokeAsync returns a DocSidebarViewModel whose sections come from normalized public section snapshots and whose DocSidebarViewModel.Diagnostics value is resolved by ResolveDiagnosticsAsync. Diagnostics chrome is controlled separately from route responses: chrome exposure decides whether the sidebar may advertise a tool, while route exposure decides whether the row receives an href. Health resolution uses DocAggregator.GetHarvestHealthAsync(CancellationToken) only when health chrome is visible; route-inspector links remain independent of health lookup success.
ResolveDiagnosticsAsync
Task<SidebarDiagnosticsResolution> ResolveDiagnosticsAsync()
Source
Resolves optional diagnostics chrome for the current sidebar request.
Returns
The diagnostics sidebar resolution for the current request.
Remarks
Returns an empty resolution when neither health nor route-inspector chrome is visible. When one source is visible, the returned model includes only the rows whose chrome policy and route policy allow them. A health row can be status-only when health chrome is visible but routes are hidden.