feat(dom): text-select on rendered surfaces (data-surface="block")#141
Open
adnaan wants to merge 1 commit into
Open
feat(dom): text-select on rendered surfaces (data-surface="block")#141adnaan wants to merge 1 commit into
adnaan wants to merge 1 commit into
Conversation
Extends lvt-fx:text-select to rendered Markdown (host data-surface="block"): a native selection resolves to the touched [data-from]/[data-to] blocks' source line range + the exact rendered phrase, instead of character columns (rendered text can't map to source offsets). No caret and arrow keys are left alone on the block surface. The default "code" surface (char ranges + caret) is unchanged. Fixes text selection producing no Comment button in the rendered Preview view. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ey41dRwDpRgLtVHZjhYLKt
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.
Follow-up to #140.
lvt-fx:text-selectonly resolved selections on the code surface ([data-line]rows), so in a host's rendered view (e.g. prereview's Markdown Preview) selecting text produced no Comment button. This adds ablocksurface.What's new
data-surface="block"on the host → a native selection resolves to the touched[data-from]/[data-to]blocks' source line range + the exact rendered phrase ({fromLine,toLine,text},fromCol=toCol=0). Rendered text can't map to source columns (**b**renders asb), so this is line-precision with the phrase captured.codesurface (character ranges + keyboard block caret) is unchanged.Tests
tests/text-select.test.ts: 4 new block-surface cases (within-block, cross-block, outside-host, collapsed). Full suite green (789).🤖 Generated with Claude Code