Skip to content

Commit 7d1e806

Browse files
committed
feat(shell-docs): hide sidebar Quickstart entry until a framework is active
The root /quickstart page is a routing shim — it has no real content, just a pointer to the per-framework quickstarts. Showing it in the sidebar on / leads users into a dead-end click ("This page is a routing shim..."). Hide the entry until a framework is active in the URL or stored in localStorage; once either is set, SidebarLink prepends it and the click lands on real per-framework content.
1 parent 4711c7d commit 7d1e806

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

showcase/shell-docs/src/app/[[...slug]]/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ function OverviewNavItem({
148148
<div style={{ paddingLeft: `${indent}px` }}>
149149
<SidebarLink
150150
slug={node.slug}
151+
hideWhenUnscoped={node.slug === "quickstart"}
151152
className="block py-[5px] text-[13px] text-[var(--text-muted)] hover:text-[var(--text-secondary)] transition-colors"
152153
>
153154
{node.title}

showcase/shell-docs/src/components/docs-page-view.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ export async function DocsPageView({
140140
scope={scope}
141141
fallbackHref={`${slugHrefPrefix}/${node.slug}`}
142142
active={isActive}
143+
hideWhenUnscoped={node.slug === "quickstart"}
143144
className={`block py-[5px] text-[13px] transition-colors ${
144145
isActive
145146
? "text-[var(--accent)] font-medium"

showcase/shell-docs/src/components/sidebar-link.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ export interface SidebarLinkProps {
3434
* interface for call-site compatibility.
3535
*/
3636
fallbackHref?: string;
37+
/**
38+
* When true, the link does not render unless a framework is active
39+
* (URL-scoped) or stored in localStorage. Used for sidebar entries
40+
* whose root MDX is a routing shim — e.g. Quickstart, whose real
41+
* content lives per-framework. Without this, the entry shows on `/`
42+
* but clicks land on the shim page.
43+
*/
44+
hideWhenUnscoped?: boolean;
3745
}
3846

3947
export function SidebarLink({
@@ -43,6 +51,7 @@ export function SidebarLink({
4351
active,
4452
scope: _scope,
4553
fallbackHref: _fallbackHref,
54+
hideWhenUnscoped,
4655
}: SidebarLinkProps) {
4756
const { framework, storedFramework } = useFramework();
4857

@@ -52,6 +61,7 @@ export function SidebarLink({
5261
// avoiding the visible RouterPivot redirect that would otherwise flicker
5362
// in the URL bar.
5463
const activeFramework = framework ?? storedFramework;
64+
if (hideWhenUnscoped && !activeFramework) return null;
5565
const href = activeFramework ? `/${activeFramework}/${slug}` : `/${slug}`;
5666

5767
return (

0 commit comments

Comments
 (0)