From 38e34dcce35b8defc9ef281770acf6fbdccc643e Mon Sep 17 00:00:00 2001 From: Zeno Kapitein Date: Wed, 19 Nov 2025 11:26:16 +0100 Subject: [PATCH] Optimise page outline (#3813) --- .../PageAside/AsideSectionHighlight.tsx | 41 ------------------- .../src/components/PageAside/PageAside.tsx | 6 ++- .../PageAside/ScrollSectionsList.tsx | 32 +++++---------- 3 files changed, 16 insertions(+), 63 deletions(-) delete mode 100644 packages/gitbook/src/components/PageAside/AsideSectionHighlight.tsx diff --git a/packages/gitbook/src/components/PageAside/AsideSectionHighlight.tsx b/packages/gitbook/src/components/PageAside/AsideSectionHighlight.tsx deleted file mode 100644 index 9fb0186cd..000000000 --- a/packages/gitbook/src/components/PageAside/AsideSectionHighlight.tsx +++ /dev/null @@ -1,41 +0,0 @@ -'use client'; - -import { type ClassValue, tcls } from '@/lib/tailwind'; -import React from 'react'; - -export const AsideSectionHighlight = React.memo( - ({ - className, - }: { - className?: ClassValue; - }) => { - return ( -
- ); - } -); diff --git a/packages/gitbook/src/components/PageAside/PageAside.tsx b/packages/gitbook/src/components/PageAside/PageAside.tsx index 5bf96aeaf..8874c6ba0 100644 --- a/packages/gitbook/src/components/PageAside/PageAside.tsx +++ b/packages/gitbook/src/components/PageAside/PageAside.tsx @@ -169,7 +169,11 @@ async function PageAsideSections(props: { document: JSONDocument; context: GitBo const sections = await getDocumentSections(context, document); - return sections.length > 1 ? : null; + return sections.length > 1 ? ( +
+ +
+ ) : null; } function PageAsideActions(props: { diff --git a/packages/gitbook/src/components/PageAside/ScrollSectionsList.tsx b/packages/gitbook/src/components/PageAside/ScrollSectionsList.tsx index 37c24ba6f..0fb2bb263 100644 --- a/packages/gitbook/src/components/PageAside/ScrollSectionsList.tsx +++ b/packages/gitbook/src/components/PageAside/ScrollSectionsList.tsx @@ -7,7 +7,6 @@ import { tcls } from '@/lib/tailwind'; import { useBodyLoaded } from '@/components/primitives'; import { HEADER_HEIGHT_DESKTOP } from '../layout'; -import { AsideSectionHighlight } from './AsideSectionHighlight'; /** * The threshold at which we consider a section as intersecting the viewport. @@ -44,7 +43,7 @@ export function ScrollSectionsList({ sections }: { sections: DocumentSection[] } return (