Skip to content

Turn the AI dropdown into an Open in Claude split button - #3330

Draft
enf0rc3 wants to merge 1 commit into
mainfrom
wl/open-in-llm
Draft

Turn the AI dropdown into an Open in Claude split button#3330
enf0rc3 wants to merge 1 commit into
mainfrom
wl/open-in-llm

Conversation

@enf0rc3

@enf0rc3 enf0rc3 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Implements the SplitButton from Documentation vision / Open in LLM.

What changed

The "Use Octopus docs with AI" pill at the foot of the article is now an Open in Claude split button sitting under the page header, next to Edit on GitHub:

  • Primary half opens Claude with a prompt pointing at this page's .md URL.
  • Caret half opens a 256px menu with Open in Claude, Open in ChatGPT, Open in Gemini — link-styled rows with a provider logo and an external-link icon.
  • Both halves reuse the existing .btn component, so borders, radius, hover, pressed and focus states come from the design-system tokens already in main.css. The pair collapses into one divider via a negative margin, which keeps each half's focus ring unclipped.
  • Menu chrome uses --colorMenuListBackground* and --shadowMedium, so light and dark themes both work with no extra rules.
  • Four icons added under src/assets/icons/, exported from the Figma file and applied as CSS masks so they take --colorIconPrimary in the button and --colorTextLinkDefault in the menu.

The eligibility gate is unchanged: the control only renders on pages that have a .md companion.

Two things to call out

Gemini points at AI Studio. gemini.google.com/app has no native prompt parameter (the ?prompt= trick needs a browser extension), so the label stays "Open in Gemini" per the design while the href is aistudio.google.com/prompts/new_chat?prompt=…, which does prefill. Happy to change the label if that reads wrong.

The markdown actions are gone for now. Copy this page as markdown / open as markdown / open all docs as markdown are removed along with copy-markdown.js. They return as the secondary copy button from node 1561-20055 once #3317 lands the shared copy module.

Testing

astro build clean, 2673 pages. Verified in a real browser in both themes, closed and open.

tests/llm-endpoints.spec.ts — the two CopyMarkdown tests are rewritten to assert the primary button and all three menu links carry the same working .md URL.

Four tests in that spec fail on a Windows checkout, including the rewritten one. All four fail on the same pre-existing bug, not on this change: llm-md-emitter gets backslash-separated paths from globSync on Windows, so pathToSlug's /index$/ strip never fires and it writes dist/docs/argo-cd/index.md where the tests expect dist/docs/argo-cd.md. per-page .md endpoint serves clean markdown for an eligible page fails identically on an untouched main. Worth a separate fix.

🤖 Generated with Claude Code

The "Use Octopus docs with AI" pill offered three markdown actions. The
design replaces it with a split button: a primary "Open in Claude", and a
caret that opens a list of assistants. Each entry hands the assistant this
page's .md URL to read.

The markdown actions come back as a separate copy button once the shared
copy module lands.

Both halves reuse the .btn component, so the pair matches "Edit on GitHub"
beside it in the page actions row, and the whole control moves from the
foot of the article up under the header.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@team-marketing-branch-protections

Copy link
Copy Markdown

Pull request environment is available at https://stoctodocspr3330.z22.web.core.windows.net.

You can view the ephemeral environment status in Octopus Deploy.

This environment will be automatically deprovisioned when the pull request is closed, or after 7 days of inactivity.

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.

2 participants