Skip to content

Keep copy controls attached to the current explicit source - #3567

Closed
max-sixty wants to merge 1 commit into
mainfrom
audit/copy-current-source
Closed

max-sixty wants to merge 1 commit into
mainfrom
audit/copy-current-source

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Calling copyBlock again for a connected block now updates the existing control’s source reader. Automatic document-code discovery preserves that explicit reader, so copied text excludes renderer decorations and reflects later updates.

The regression uses a connected <pre><code> block whose visible text differs from its supplied source: the original implementation copies the first source, the first revision of this PR copied decorated DOM text, and this revision copies the updated explicit source. Three focused browser cases pass, including normal document copying and mixed selection. pnpm run check passes (132 browser/build checks, 522 runtime tests, 85 Worker tests); generated kernel files and the API reference are updated.

This was referenced Oct 22, 2026
@max-sixty max-sixty changed the title Refresh the source reader of retained copy controls Keep copy controls attached to the current explicit source Oct 22, 2026
@max-sixty
max-sixty force-pushed the audit/copy-current-source branch from 01081b9 to 9ac6b2b Compare October 22, 2026 15:24
@max-sixty

Copy link
Copy Markdown
Owner Author

Closing: no caller hits this. lf-code builds a new <pre> per render and lf-draft calls copyBlock once, so a block never gets a second source. The held-object indirection and its browser test buy a case that doesn't occur.

This was written by Claude Code on behalf of max-sixty

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.

1 participant