Skip to content

Add AI Toolbar #2673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Add AI Toolbar #2673

wants to merge 15 commits into from

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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flag: don't merge This PR should not be merged at the moment 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant