Repository navigation
fix(terminal): link a framed multi-row URL when an overlay shows through - #21816
Conversation
A TUI that draws a box-framed modal over existing output leaves the screen underneath visible beside the frame, so the text left of the URL differs from row to row. The hard-wrap detector required that text to be byte-identical across rows, so the join stopped at the first row whose gutter differed and the candidate collapsed back to a single row, opening a truncated URL. Anchor continuation rows on the frame's cell column and the run between the frame and the URL instead, which is the part that is actually shared.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Pre-merge checks:
|
There was a problem hiding this comment.
Important
The fix joins the overlay case correctly, but the widened left guard no longer proves the continuation rows belong to the same logical line. A table whose column separator sits at the same cell column now over-joins unrelated rows into one corrupted URL. Repro and analysis inline.
Reviewed changes
- Frame-column anchor —
buildCandidateFromStartnow matches continuation rows by the frame character's cell column plus the run between that frame and the URL, instead of requiring the entire left prefix to be byte-identical to the start row. - Per-row fragment start — each row resolves its own URL start index and cell column, so a gutter containing wide characters lines up by cell column rather than string index.
- Tests — three cases added: a framed URL joins across four rows while the gutter differs, the same with a CJK gutter, and a frame that moves one column stops the join.
ℹ️ Nitpicks
schemeColumn(hard-wrapped-terminal-http-links.ts:62) is now used only for itsundefinedguard; the start row's fragment start column is re-derived fromcolumns[fragmentStart]at line 135, so the earlier guard is redundant with the non-null assertion.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
The start row's fragment start column is re-derived per row, so guard that value where it is used instead of asserting it non-null.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed the delta since the prior pullfrog review (fd8ce99): a behavior-preserving guard refactor in buildCandidateFromStart, plus the author's verified rebuttal to the earlier over-join finding.
- Dropped the redundant
schemeColumnguard — the start row's fragment start column is re-derived inside the row loop, so the earlyundefinedcheck at the function head is gone. - Guarded the per-row start column where it is consumed —
fragmentStartColumnis now checked before the width math and the non-null assertion is removed; an unmapped column breaks the loop and returns no candidate, matching the removed earlyreturn null. - Retired the prior over-join thread — base
9fbdfc5already joins the uniform-gutter and no-gutter variants (asserted by the pre-existing wide-char test), so the widened guard extends an existing trade-off rather than introducing a regression.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
There was a problem hiding this comment.
Important
The new outer-frame guard rejects a URL wrap that base joined: an overlay over an underlying frame whose left content is identical across the URL rows. It fires on mere frame presence rather than on the region between the frames differing, so previously clickable links go dead. Repro and a narrower alternative inline.
Reviewed changes
Re-reviewed the delta since the prior pullfrog review (8b55300): the new outer-frame guard in buildCandidateFromStart, its regression test, and an upstream merge.
- Outer-frame guard — continuation rows now break when the start row carries a second frame left of the URL and a continuation row has a frame at that frame's cell column.
- Shared-table test — new case asserting adjacent table cells do not over-join.
- Upstream merge —
c18c235mergedorigin/main; the PR still nets two changed files.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
Rows whose text left of the URL matches the start row are joined as before; only a changed prefix uses the overlay frame anchor and its table-cell guard. Restores nested-frame and overlay-over-frame wraps.
…ay-url # Conflicts: # src/renderer/src/components/native-chat/NativeChatQueuedMessageEditor.test.tsx

ELI5
When a terminal application draws a box over existing output, long URLs inside the box now hover and open in full even when different transcript text remains visible to its left.
What Changed
Match framed URL continuation rows by the frame's terminal cell column and the text between that frame and the URL. Preserve the existing identical-prefix path, including nested frames. When the prefix changes, a second stable left border prevents joining adjacent table cells. Each row resolves its own fragment columns, so wide and combining characters in the uncovered gutter do not shift the hit range.
Keep the existing right-border alignment, suffix, fill-ratio, minimum-row, URL-length, and scan limits. The shared wrapped-link provider and cold-click fallback use the resulting complete destination; explicit OSC 8 destinations remain authoritative.
Why
The previous detector required all text before the URL to match on every row. A changing transcript outside an overlay broke that condition and exposed only the first URL fragment. The overlay's frame provides the stable alignment evidence.
Linked Issue
Fixes #21814
Separate from #31713, which handles unframed padded rows.
Visual Proof
Public example URLs only. Each image combines crops of the rendered terminal rows and its hover destination.
Before, captured on unmodified main: hover and modified click resolve only the first physical row.
After: every row resolves the complete destination through
view=full#details. Only the hovered row underlines; frame and padding cells remain outside the hit range.Testing
pnpm tc:webpassed; changed-code quality and commit lint/format hooks passed.Local rendered validation ran on macOS. Linux, Windows, live SSH, and mobile were not exercised locally. Full repository checks run in CI.
AI Disclosure
Original contribution prepared with Claude Opus 5.
Review
Independent adversarial Opus review completed with no blocking findings. The reviewer ran side-by-side baseline probes using cursor-positioned overlays, Unicode11, wide characters overwritten by the frame, emoji/ZWJ/combining gutters, gutter links, frame/padding changes, adjacent tables, OSC 8 precedence, and cold clicks. All 151 related tests and the seven real-buffer integration cases passed independently. Bounded worst-case scan cost matched the existing identical-prefix baseline. The terminal diff is unchanged after the final main update; the final local suite passed 421 tests across 43 files.
Agent skill upstream boundary
Notes
Renderer-only buffer analysis, with no platform API, path, persistence, IPC, or protocol changes. Existing local/remote click routing is preserved, including mixed client/host versions and folder workspaces.
Reconstruction remains heuristic. A table without a second stable left border can look identical to an overlay and incorrectly join adjacent cells; the independent review reproduced this ambiguity. An overlay over an existing stable outer frame with changing labels is conservatively rejected by the table guard. The unchanged right-suffix guard also declines content printed after the right border. Explicit OSC 8 metadata avoids inference and remains authoritative.
Checklist