Repository navigation
β¨ feat(ask-ai-button): spin the Fumadocs Ask AI dropdown out into a package - #117
Merged
Merged
Conversation
β¦ackage New `packages/ask-ai-button` (npm `ask-ai-button`): an "Ask AI about this page" component for docs sites, built from the AskAIDropdown and LLMCopyButton in template-fumadocs. - AskAIButton as a dropdown or a floating action button, AskAIPanel for inline use, CopyPageButton for copying the page Markdown - Message box for the visitor's own question, a link/page-text toggle, and Claude, ChatGPT, Gemini, Perplexity, Grok, Copilot, Le Chat, T3 Chat, Brave, QwkSearch and Cursor as providers - Custom providers by URL (getHref) or by handler (onSelect) for APIs - Copy prompt / copy page actions; a prompt too long for a URL falls back to the link prompt and puts the full prompt on the clipboard - Self-injected stylesheet that follows Fumadocs' theme tokens - Vitest suite, demo page, agent skill, CI matrix and Codecov flag template-fumadocs now uses the package in place of its local copies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RTY3Ukit459jDu8tLsT3FJ
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
β 2 Tests Failed:
View the top 2 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
New package
packages/ask-ai-button(npmask-ai-button, name is free on the registry), built from theAskAIDropdownandLLMCopyButtoninstarter-templates/template-fumadocs.AskAIButton:variant="dropdown"(page header) orvariant="fab"(floating, bottom-right/left)AskAIPanel: the same panel, embeddedinlineCopyPageButton: copies the page's raw Markdown (replacesLLMCopyButton)The panel has a message box for the visitor's own question, a Link to page / Include page text toggle, and the provider list: Claude, ChatGPT, Gemini, Perplexity, Grok, Copilot, Le Chat, T3 Chat, Brave, QwkSearch, Cursor. It also has Copy prompt, Copy page and an optional GitHub link. Picking a provider opens a new tab with the prompt pre-filled.
getHreffor any chat URL, oronSelectto hand the prompt to your own API without opening a tabmaxUrlLength(default 8000), the tab opens with the link prompt instead and the full prompt goes to the clipboardwindow.openstays synchronous and popup blockers don't stop it--color-fd-*tokens when they exist; the bundle starts with"use client"Wiring
template-fumadocsnow usesask-ai-button, and its two local component files are deletedskills/ask-ai-button,.claude/packages/ask-ai-button/CLAUDE.md, plus entries inSKILLS_BY_PACKAGE,test.yml,codecov.yml, the docs sync list, the root and packages READMEs, andoverview.mdValidation
bunx turbo run typecheck test coverage build --filter=ask-ai-button: all pass, 25 tests, about 87% statement coveragetemplate-fumadocsagainst the local package: no errors in the changed files. The only error is an Orama typing issue incomponents/fumadocs/layout/search.tsx, which was already there.bun run readmes:checkstill reports 11 stale headers in other packages. That drift was there before this PR and is left alone. The new package's header is current.Notes
template-fumadocs/package-lock.jsonisn't regenerated becauseask-ai-buttonisn't on npm until this merges and the publish workflow runs.template-nextjs-harness-cloudflare/template-fumadocsstill keep their own copies of the dropdown.π€ Generated with Claude Code
https://claude.ai/code/session_01RTY3Ukit459jDu8tLsT3FJ
Generated by Claude Code