From 930a4165b74d51d26b0a3ae952be1088a8bf744f Mon Sep 17 00:00:00 2001 From: Anna Nguyen Date: Thu, 10 Sep 2026 13:58:11 -0400 Subject: [PATCH 01/13] Anchor docs search and Ask AI in the toolbar. Makes the Kapa assistant discoverable from the docs header and keeps the reading layout stable across regular and API pages. Co-authored-by: Cursor --- js/documentation/pages/_app.tsx | 47 +++-- js/documentation/pages/_document.tsx | 5 + .../src/components/Breadcrumbs.tsx | 97 ++++++++- .../src/components/DocsSearch.tsx | 187 ++++++++++++++++++ .../src/components/ExternalScripts.tsx | 16 +- .../src/components/GlobalStyles.tsx | 4 +- .../src/components/MainContent.tsx | 9 +- js/documentation/src/components/PageGrid.tsx | 81 +++++--- .../src/components/PageHeader.tsx | 22 ++- .../RestApiReference.styles.ts | 9 +- .../RestApiReference/SidebarNav.tsx | 64 ++++-- .../src/components/RestApiReference/index.tsx | 158 +++++++-------- js/documentation/src/components/SideNav.tsx | 38 ++-- .../src/components/TableOfContents.tsx | 27 ++- .../src/components/types/window.d.ts | 9 +- js/documentation/src/lib/kapa.ts | 49 +++++ 16 files changed, 618 insertions(+), 204 deletions(-) create mode 100644 js/documentation/src/components/DocsSearch.tsx create mode 100644 js/documentation/src/lib/kapa.ts diff --git a/js/documentation/pages/_app.tsx b/js/documentation/pages/_app.tsx index 356ec612a1..573d77731f 100644 --- a/js/documentation/pages/_app.tsx +++ b/js/documentation/pages/_app.tsx @@ -42,6 +42,7 @@ import MainContent from '@src/components/MainContent' import PageFooter from '@src/components/PageFooter' import { ContentContainer, + MainColumn, PageGrid, SideCarContainer, SideNavContainer, @@ -169,29 +170,33 @@ function App({ Component, pageProps = {}, swrConfig }: MyAppProps) { )} - - - - - - {isClient ? ( - Loading table of contents...}> - - - ) : ( - + + + + + {toc?.length > 0 && ( + + {isClient ? ( + Loading table of contents...}> + + + ) : ( + + )} + )} - + )} diff --git a/js/documentation/pages/_document.tsx b/js/documentation/pages/_document.tsx index 8245cf98de..1c2d464b1d 100644 --- a/js/documentation/pages/_document.tsx +++ b/js/documentation/pages/_document.tsx @@ -43,6 +43,11 @@ class MyDocument extends Document { type="text/javascript" data-widget-position="bottom-right" /> +