Turn "Copy as markdown" into a split button and delete "Use Octopus docs with AI" - #3384
Open
enf0rc3 wants to merge 7 commits into
Open
Turn "Copy as markdown" into a split button and delete "Use Octopus docs with AI"#3384enf0rc3 wants to merge 7 commits into
enf0rc3 wants to merge 7 commits into
Conversation
|
Pull request environment is available at https://stoctodocspr3384.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. |
enf0rc3
marked this pull request as ready for review
August 19, 2026 02:05
enf0rc3
commented
Aug 19, 2026
| @@ -1,57 +0,0 @@ | |||
| --- | |||
enf0rc3
commented
Aug 19, 2026
| // `href`, a plain button forbids one - so the link attributes are handed over as | ||
| // a set rather than as three possibly-undefined props. `target` and `rel` say | ||
| // where a link opens, and mean nothing on a button. | ||
| const primaryLink = href ? { href, target, rel } : {}; |
Contributor
Author
There was a problem hiding this comment.
allows "non href" button that doesn't link anywhere. (client side only)
…ocs with AI" The "Open this page as markdown" link moves from the menu at the bottom of the article into a dropdown on the copy action, built on the shared SplitButton the "Open in Claude" button uses. "Open all docs as markdown" is dropped: llms-full.txt is too large to use with any current model. SplitButton now takes an optional href and a slotted primary label, so the copy button can stay a <button> with its three stacked state labels. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Both callers pass a label or slot markup, so the check guarded against a caller that does not exist. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The copy half needs a data attribute and a state class on the button itself. Both now sit on the wrapping control instead, so SplitButton takes no new props: the copy listener matches the primary half and reads the URL from its ancestor, and the CSS and tests reach the button through .octo-copy-md .split-btn__primary. label goes back to required. The rest label comes from the prop and the two results are slotted, stacked with it in one grid cell so the button is still sized by the longest of the three. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Writing text to the clipboard is not something a reader can act on the failure of, and clipboard.js already logs whichever rung of the write chain refused. A failed copy now leaves the button as it was and announces nothing, so the button carries one label and one result rather than three stacked states. The heading and code-block copy buttons keep their own tooltip failure reporting. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The clipboard, the reporting width and the menu belong with the other copy buttons. llm-endpoints keeps what is about the endpoints themselves: the .md URL resolving, page eligibility, and llms-full.txt no longer being linked. The width test was already in llm-endpoints and moves across with them. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Nothing outside CopyAsMarkdown, its script and its tests uses these classes, so main.css was holding component-private rules. They go in the component's own <style>, the way OpenInLlm, SplitButton and Menu already do it. SplitButton, Button and Menu render the elements the rules land on, so those carry their own scope and are reached with :global(). The .octo-copy-md the wrapper is given does carry this component's scope, which is what keeps the rules off every other button. main.css now only loses lines for this change: the old "Use Octopus docs with AI" block and the copy action's rules, 189 in total. Also drops two tests that only guarded deleted markup staying deleted. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
enf0rc3
force-pushed
the
willlaugesen/nes-294-copy-as-markdown-split-button
branch
from
August 19, 2026 04:11
ed1d2de to
f53e46a
Compare
rosslovas
reviewed
Aug 19, 2026
Contributor
There was a problem hiding this comment.
Ellen provided an icon in Slack that looked quite different to this one. I see in the PR description it's mentioned that it should be switched.
Contributor
Author
There was a problem hiding this comment.
Oh didn't notice that, ill update it to use the one she provided, thanks for spotting that!
Replaces the stand-in with design's asset. The badge is filled with the M and the arrow knocked out of it, where the stand-in drew the badge as an outline. Also drops commonmark from the dictionary, which the stand-in's comment was the only thing needing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

NES-294
"Open this page as markdown" moves from the menu at the bottom of the article into a dropdown on the copy action, built on the shared
SplitButtonthat "Open in Claude" uses.MarkdownLinks.astroand its script are deleted."Open all docs as markdown" is dropped rather than moved —
llms-full.txtis nearly 2 million tokens and unusable with any current model. The route and its tests stay; only the UI link goes.Behaviour change: a failed copy no longer reports anything. It used to show "Copy failed"; it now leaves the button as it was and announces nothing. The heading and code-block copy buttons keep their own failure tooltips.
SplitButtontakes two changes and no new props:hrefbecomes optional, and the primary gets a<slot />. The class anddata-copy-md-urlsit on the control, and the copy listener matches the primary half so the caret does not copy the page on its way to opening the menu.The copy action's styles move out of
main.cssinto the component, alongside howOpenInLlmandMenualready do it, somain.cssonly loses lines here.The menu item uses design's
markdown.svg, checked at 16px in both themes.Before
After
🤖 Generated with Claude Code