Repository navigation
callouts: let readers select the text of a bubble - #11
Merged
Merged
Conversation
…bble A pointerdown in a bubble turns on user-select: text for that bubble, so a drag across the code still leaves callouts out of the selection and the copy. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.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.
Closes #10
Readers can now select and copy the text of an inline callout bubble. A selection that starts in the code still leaves every bubble out, so the paste never has prose in the middle of the code.
This takes a different route from the proposal in the issue. A new client module (
client/callouts.ts, loaded only on blocks withdata-scb-callouts) listens forpointerdownon the document. Apointerdownin a bubble turns onuser-select: textfor that bubble until the nextpointerdown. The wrapper, its padding and the arrow keepuser-select: none. The proposedcopyhandler would let a drag across the code highlight the bubble but then leave its text out of the paste, so the paste would differ from what the reader sees selected. DECISIONS.md already rejects acopyhandler for hidden lines for that reason. With this approach, what is highlighted is what gets copied, and no clipboard text has to be rebuilt. If you prefer thecopyhandler, say so and I will switch to it.Other changes:
copyhandler now lets through a selection that is wholly inside a callout. Before, it would have copied an empty string, because it leaves out everything under auser-select: noneancestor.data-scb-calloutsonly when it has a callout, and a Playwright test on the callouts page. The test drags inside a bubble and checks the selection and the clipboard, then drags from the first code line to the second, across the bubble, and checks that the bubble text is not in the selection or the clipboard.pnpm lint,pnpm test,pnpm docs:build,pnpm lint:docsand the full Playwright suite pass (733 passed, 302 skipped).🤖 Generated with Claude Code