Repository navigation
Seat a draft's Copy through its toolbar declaration, and delete copyBlock - #6141
Merged
Merged
Conversation
…lock A draft now declares its Markdown the way lf-code declares its code: `data-lf-copy`, `lfCopy()`, and `lfBar` naming the toolbar Leaf stands Copy last in. That leaves `copyBlock` with no caller, so the second route to the same control goes from the runtime, the public package API and module-reading.md. The draft's toolbar is unchanged: Edit and Copy at rest, Save, Discard and Copy while editing. The Copy journey in tests/journeys/test_render_anchors.py drops its lf-code's note: since #6109 a block with notes seats Copy in its notes toolbar, so the note had moved the control the journey checks out of the after-the-block seat. The notes toolbar test now presses Copy there and checks the clipboard holds the code without the note.
leaf-agent
approved these changes
Nov 16, 2026
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.
A draft now hands Leaf its Copy the same way
lf-codedoes since #6109: it marks itselfdata-lf-copy="Markdown", returns its source fromlfCopy(), and names its toolbar aslfBar, so Leaf stands Copy last in that toolbar. Nothing callscopyBlockafter that, so it goes fromcode-copy.js, the public package API (widget-api.js) andmodule-reading.md, leaving one route for a widget to place Copy. The draft's toolbar is unchanged on base and head: Edit and Copy at rest, Save, Discard and Copy while editing (checked withleaf-dev probe --base).HTMLElement.lfCopyandlfBarnow admitundefined, aslfCommandsdoes, so a widget can assign them on itself underexactOptionalPropertyTypes.The Copy journey in
tests/journeys/test_render_anchors.pywas left failing by #6109: itslf-codehad a note, which now seats Copy in the notes toolbar instead of after the block. Its note goes, so it keeps checking the after-the-block seat, and the notes toolbar test now presses Copy and checks the clipboard holds the code without the note's words.Max asked for this as the follow-up to #6109. Tests: the draft editing and sending tests that press Copy or its toolbar, the Copy journey, the code-reading tests,
pnpm run test:runtimeandpnpm run check:browser.