Skip to content

Text comments in the rendered Preview (Markdown) view - #84

Merged
adnaan merged 1 commit into
mainfrom
text-select-preview
Jul 1, 2026
Merged

Text comments in the rendered Preview (Markdown) view#84
adnaan merged 1 commit into
mainfrom
text-select-preview

Conversation

@adnaan

@adnaan adnaan commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #83. Text selection produced no Comment button in the rendered Markdown Previewlvt-fx:text-select was wired only to the code/diff view. Reported: selecting a phrase in Preview did nothing (v0.15.0). This wires it to the rendered view.

What's new

  • lvt-fx:text-select + data-surface="block" on .md-view: a selection anchors to the touched [data-from]/[data-to] blocks' source line range with the exact phrase quoted. Rendered text can't map to source columns (**bold**bold), so FromCol/ToCol = 0 — line precision, phrase captured.
  • LineSpan/SelectionLabel: text comments with 0 columns render as a plain line span (L42), not L42:0-0.
  • The quoted phrase shows on the card (Comment.Snippet, .ic-snippet) and in the handoff stream (StreamComment.Text) so the LLM sees what was selected.
  • Vendored client bundle updated (source: feat(dom): text-select on rendered surfaces (data-surface="block") client#141).

Not applicable

  • Rendered HTML preview: its content is a sandboxed cross-origin <iframe> the page can't read a selection from — keeps its draw-a-region (region-select). Documented in CLAUDE.md.

Tests

E2E TestE2E_TextSelectRenderedMarkdown (the reported scenario: select prose → button → composer → save → card + CSV kind=text,...,0,0). Existing markdown block-commenting + keyboard + code-view text-select e2e all still green; unit CSV/MarkRanges/LineSpan/drift green; client jest 789.

🤖 Generated with Claude Code

Text selection produced no Comment button in the rendered Markdown view — the
directive was wired only to the code/diff view. Wire lvt-fx:text-select onto the
.md-view with data-surface="block": a selection anchors to the touched blocks'
source line range with the exact phrase quoted (rendered text can't map to
source columns, so FromCol/ToCol are 0).

- Template: lvt-fx:text-select + data-surface="block" on .md-view.
- LineSpan/SelectionLabel: text comments with 0 columns render as a plain line
  span (L42), not L42:0-0.
- Card shows the quoted phrase (Comment.Snippet); handoff stream carries it
  (StreamComment.Text) so the LLM sees what was selected.
- Rendered-HTML preview keeps region-select (its text is in a sandboxed iframe
  the page can't read).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ey41dRwDpRgLtVHZjhYLKt
@adnaan
adnaan merged commit a68a059 into main Jul 1, 2026
7 checks passed
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