Skip to content

Conversation

@pwizla
Copy link
Collaborator

@pwizla pwizla commented Aug 12, 2025

This PR creates an extensible "AI toolbar" system.
The toolbar is displayed below h1 items, and includes a few actions:

  • copy Markdown code
  • view LLMs.txt
  • view LLMs-full.txt

The architecture is flexible enough to accept more buttons.
The code includes:

  • an actions folder, with dedicated and reusable actions (for now, we have one to copy the Markdown, and another one to navigate to another page)
  • a config folder which for now only includes one config. file, where you can define the buttons details (icon, title, description, etc.)

The Heading component from Docusaurus has been swizzled to include the AiToolbar rendering, which means the toolbar is rendered whenever an h1 is rendered.

A useBadgeReorder hook has also been created to ensure badges added below an h1 (<EnterpriseBadge /> and so on) are rendered in this order: 1. h1, 2. badges (within a container), and 3. AiToolbar component. Without this hook, the toolbar is rendered in between h1 and badges, which was not really reflecting the originally intended design for the h1s and associated badges.

As a bonus, the PR finally introduces a DebugComponent that can be used to test various scenarios while developing custom components.

AiToolbar.demo.mov
@pwizla pwizla requested a review from meganelacheny as a code owner August 12, 2025 15:17
@vercel
Copy link

vercel bot commented Aug 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Project Deployment Preview Comments Updated (UTC)
documentation Ready Preview Comment Aug 14, 2025 1:47pm
@pwizla pwizla self-assigned this Aug 13, 2025
@pwizla pwizla added this to the 6.6.8 milestone Aug 13, 2025
@pwizla pwizla added source: repo PRs/issues not targeting a specific documentation but rather affecting the whole repo pr: chore pr: new content PRs for new product features or new documentation sections and removed pr: chore labels Aug 13, 2025
@pwizla pwizla mentioned this pull request Aug 13, 2025
5 tasks
@pwizla pwizla added the flag: don't merge This PR should not be merged at the moment label Aug 13, 2025
@pwizla pwizla removed the flag: don't merge This PR should not be merged at the moment label Sep 3, 2025
@pwizla pwizla merged commit a843b61 into main Sep 3, 2025
4 of 5 checks passed
@pwizla pwizla deleted the repo/ai-toolbar branch September 3, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: new content PRs for new product features or new documentation sections source: repo PRs/issues not targeting a specific documentation but rather affecting the whole repo

1 participant