From f4d4f23c8a3c4c6fbd7b905ccea1d7ba1aef74d4 Mon Sep 17 00:00:00 2001 From: Travis Hoover Date: Thu, 9 Jul 2026 12:17:09 -0700 Subject: [PATCH] docs(api): make Platform API documentation public --- sidebars.ts | 14 +------------- src/theme/DocSidebarItem/Category/index.tsx | 19 +++---------------- src/theme/DocSidebarItem/Link/index.tsx | 3 +-- 3 files changed, 5 insertions(+), 31 deletions(-) diff --git a/sidebars.ts b/sidebars.ts index 964e5ae3..3535c570 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -450,15 +450,9 @@ const baseSidebars: SidebarsConfig = { }, { type: 'category' as const, - // Original label when `platform-api` is off/unset; renamed to - // 'API Overview' when the flag is enabled (since the guides become - // shared across Client + Platform APIs). - label: 'Client API', + label: 'API Overview', collapsible: false, collapsed: false, - customProps: { - flagLabel: { flag: 'platform-api', label: 'API Overview' }, - }, items: [ { type: 'category', @@ -514,12 +508,6 @@ const baseSidebars: SidebarsConfig = { label: 'Platform API Reference', collapsible: false, collapsed: false, - // Gated behind the `platform-api` feature flag: when the flag is false or - // unset the section is omitted (original sidebar); when enabled (Edge - // Config or `?ff_platform-api=true`) it renders. - customProps: { - flag: 'platform-api', - }, items: [ { type: 'category', diff --git a/src/theme/DocSidebarItem/Category/index.tsx b/src/theme/DocSidebarItem/Category/index.tsx index 966f24d1..3fed27a9 100644 --- a/src/theme/DocSidebarItem/Category/index.tsx +++ b/src/theme/DocSidebarItem/Category/index.tsx @@ -157,26 +157,13 @@ export default function DocSidebarItemCategory({ } }, [collapsible, expandedItem, index, setCollapsed, autoCollapseCategories]); - // Feature-flag gating: hide a category (and its children) when it declares a - // `customProps.flag` that isn't enabled. Evaluated at the end so all hooks - // above always run in a stable order (see rules of hooks). Enable via Edge - // Config or the runtime query param, e.g. `?ff_platform-api=true`. + // Feature-flag gating is evaluated after all hooks to preserve hook order. const { isEnabled } = React.useContext(FeatureFlagsContext); const flag = (item as any).customProps?.flag as string | undefined; if (flag && !isEnabled(flag)) { return null; } - // Feature-flag-aware label: when a category declares `customProps.flagLabel` - // ({ flag, label }) and that flag is enabled, render the alternate label - // instead of the default. Lets the same static config show the original - // label when the flag is off and a new label when it's on. - const flagLabel = (item as any).customProps?.flagLabel as - | { flag: string; label: string } - | undefined; - const label = - flagLabel && isEnabled(flagLabel.flag) ? flagLabel.label : item.label; - return (
  • )} - {label} + {item.label} {href && collapsible && ( { e.preventDefault(); updateCollapsed(); diff --git a/src/theme/DocSidebarItem/Link/index.tsx b/src/theme/DocSidebarItem/Link/index.tsx index 5ac86d0e..bd3f3586 100644 --- a/src/theme/DocSidebarItem/Link/index.tsx +++ b/src/theme/DocSidebarItem/Link/index.tsx @@ -38,8 +38,7 @@ export default function DocSidebarItemLink({ const isActive = isActiveSidebarItem(item, activePath); const isExperimental = isExperimentalItem((item as any).docId); const isInternalLink = isInternalUrl(href); - // Feature-flag gating: hide a link when it declares a `customProps.flag` - // that isn't enabled (e.g. reveal via `?ff_platform-api=true`). + // Hide links whose declared feature flag is disabled. const { isEnabled } = React.useContext(FeatureFlagsContext); const flag = (item as any).customProps?.flag as string | undefined; if (flag && !isEnabled(flag)) {