diff --git a/src/theme/Root.tsx b/src/theme/Root.tsx index fe8e4146a..4109b1ec3 100644 --- a/src/theme/Root.tsx +++ b/src/theme/Root.tsx @@ -1,4 +1,5 @@ import React, { type ReactNode } from 'react'; +import Root from '@theme-original/Root'; import ForAgentsPanel from '@site/src/components/ForAgentsPanel'; @@ -10,12 +11,18 @@ interface Props { * `Root` wraps the whole app above the router, so anything rendered here * survives client-side navigation. That is what the "For agents" panel needs: * one instance for the entire site rather than one per page (#2586). + * + * This must WRAP `@theme-original/Root`, not replace it: + * `docusaurus-markdown-source-plugin` ships its own Root, which injects the + * "Open Markdown" dropdown and the hash-scroll behavior on docs pages. A + * user-land Root shadows it outright, which is exactly the regression that + * removed the button site-wide (#2712). */ -export default function Root({ children }: Props): ReactNode { +export default function RootWrapper({ children }: Props): ReactNode { return ( - <> + {children} - + ); }