Skip to content

Wrap @theme-original/Root so the markdown plugin keeps its injection - #2713

Merged
kaankacar merged 1 commit into
mainfrom
2712-regression-open-markdown-button-missing-on-all-docs-pages-since-2698
Jul 30, 2026
Merged

Wrap @theme-original/Root so the markdown plugin keeps its injection#2713
kaankacar merged 1 commit into
mainfrom
2712-regression-open-markdown-button-missing-on-all-docs-pages-since-2698

Conversation

@kaankacar

Copy link
Copy Markdown
Contributor

Closes #2712.

Root cause

docusaurus-markdown-source-plugin provides its own theme/Root.js, which injects the "Open Markdown" dropdown into the article header and smooth-scrolls to URL hashes. The user-land src/theme/Root.tsx added in #2698 (cc @oceans404) shadows the plugin's Root completely, so its injection never ran and the button disappeared from every docs page in production. Evidence and build-by-build comparison in #2712.

Fix

One-file change: src/theme/Root.tsx now wraps @theme-original/Root instead of replacing it, following the same wrapper pattern the repo already uses for DocItem/Footer, DocCardList, and ApiExplorer. The plugin's Root keeps running and the "For agents" panel still mounts once above the router.

Verification

Full pnpm build passes with the change. Served the build and checked in a real browser:

  • /docs/build/building-with-ai: exactly one .markdown-actions-container (the button is back) and exactly one "For agents" trigger, no console or page errors.
  • Hash navigation (#stellar-skills) scrolls to the section, confirming the plugin Root's scroll handling is active again.
  • API reference pages unchanged (they get their button from Fix markdown twins and "Open Markdown" button on API reference pages #2644, which is separate).

docusaurus-markdown-source-plugin ships its own theme Root, which is
what injects the Open Markdown dropdown and the hash-scroll behavior.
The user-land Root added in #2698 shadowed it outright, removing the
button site-wide. Wrapping the original Root keeps the plugin running
and still mounts the For agents panel once above the router.

Fixes #2712
Copilot AI review requested due to automatic review settings July 30, 2026 13:40
@kaankacar kaankacar self-assigned this Jul 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@stellar-jenkins-ci

Copy link
Copy Markdown

@kaankacar
kaankacar requested a review from ElliotFriend July 30, 2026 13:49
@kaankacar
kaankacar merged commit 888e6e1 into main Jul 30, 2026
9 checks passed
@kaankacar
kaankacar deleted the 2712-regression-open-markdown-button-missing-on-all-docs-pages-since-2698 branch July 30, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: "Open Markdown" button missing on all docs pages since #2698

3 participants