Skip to content

fix(terminal): link a framed multi-row URL when an overlay shows through - #21816

Merged
nwparker merged 13 commits into
stablyai:mainfrom
mmarabel:fix/framed-url-links-under-tui-overlay
Oct 22, 2026
Merged

nwparker merged 13 commits into
stablyai:mainfrom
mmarabel:fix/framed-url-links-under-tui-overlay

Conversation

@mmarabel

@mmarabel mmarabel commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

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.

Before: truncated framed URL destination

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.

After: complete framed URL destination

Testing

  • Reproduced before applying the fix in a real headless terminal buffer and a hidden macOS Electron renderer: hover and modified click opened the truncated first fragment.
  • Added real-buffer integration coverage for ASCII, wide, emoji, and combining-character gutters; full destinations and excluded margins on every row; OSC 8 BEL/ST authority; and adjacent table cells. Existing detector regressions cover shifted frames and nested-frame compatibility.
  • Related suite: 404 tests across 42 files passed, including URL/file link detection, provider behavior, hit ranges, hover resets, and pane creation. After the final main update, these and the queued editor suite passed again: 421 tests across 43 files.
  • Hidden Electron CDP: 32 actual hover and cold modified-click checks passed across four rows of ASCII/wide/emoji/combining gutters, unchanged/nested prefixes, and OSC 8 BEL/ST links with different explicit destinations. Frame and padding hover checks passed.
  • pnpm tc:web passed; 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

  • Not applicable: no upstream skill implementation copied or translated.

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

  • Focused on the framed-overlay failure.
  • Reproduced before fixing; before/after screenshots attached.
  • Automated and rendered regression checks passed.
  • Cross-platform, remote, mobile, folder-workspace, compatibility, and scan-cost implications reviewed.
  • Local typecheck and changed-code quality passed; full CI and the aggregate PR gate passed on the final head.

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.
@coderabbitai

coderabbitai Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: c7d66014-4c96-476f-be86-0ad38054319b

📥 Commits

Reviewing files that changed from the base of the PR and between fd8ce99 and 8b55300.

📒 Files selected for processing (1)
  • src/renderer/src/components/terminal-pane/hard-wrapped-terminal-http-links.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📝 Walkthrough

The hard-wrapped HTTP URL detector now anchors URL fragments to the frame’s cell column instead of the full row prefix. It finds the frame before the URL scheme, matches continuation rows by frame position and prefix, and stops when alignment is absent. Tests cover varying gutter text, double-width characters, and shifted frame columns.

Priority: ➖ Normal

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Linked Issues check Passed The changes satisfy issue #21814. The detector anchors continuation rows to the shared frame cell column, so varying underlying gutters no longer stop URL joining. The implementation retains frame ali…
Out of Scope Changes check Passed The pull request changes the framed hard-wrapped HTTP detector and its focused regression tests. These changes directly support issue #21814. The reviewed scope contains no unrelated product behavior …
Title check Passed The title clearly identifies the main change: fixing clickable, framed multi-row URLs when overlay content appears outside the frame.
Description check Passed The pull request description is complete and follows the repository template. It explains the user impact, implementation, rationale, linked issue, visual proof, testing, AI use, review findings, comp…
Full details: Linked Issues check

Explanation

The changes satisfy issue #21814. The detector anchors continuation rows to the shared frame cell column, so varying underlying gutters no longer stop URL joining. The implementation retains frame alignment, suffix, row-count, and fill-ratio safeguards. Regression tests cover varying gutters, wide characters, and shifted frames. The tests also verify that gutter text is excluded from the URL.

Full details: Out of Scope Changes check

Explanation

The pull request changes the framed hard-wrapped HTTP detector and its focused regression tests. These changes directly support issue #21814. The reviewed scope contains no unrelated product behavior or unrelated files.

Full details: Description check

Explanation

The pull request description is complete and follows the repository template. It explains the user impact, implementation, rationale, linked issue, visual proof, testing, AI use, review findings, compatibility considerations, and checklist status.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 — buildCandidateFromStart now 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 its undefined guard; the start row's fragment start column is re-derived from columns[fragmentStart] at line 135, so the earlier guard is redundant with the non-null assertion.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using 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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 schemeColumn guard — the start row's fragment start column is re-derived inside the row loop, so the early undefined check at the function head is gone.
  • Guarded the per-row start column where it is consumed — fragmentStartColumn is 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 early return null.
  • Retired the prior over-join thread — base 9fbdfc5 already 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.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Changes how terminal URLs are detected across wrapped lines.

The PR does not appear safe to merge while nested framed URLs can still be truncated.

Findings

  1. P1 Nested framed links are truncated ▶

Summary

The PR changes framed terminal URL detection to align continuation rows on the frame’s cell column rather than requiring identical text to its left.

  • Adds coverage for overlay text, wide-character gutters, nested table cells, and a shifted frame.
  • The change since the previous review adjusts the shifted-frame regression test.

Reviews (2) · Last reviewed commit: "test(terminal): isolate shifted URL fram..."

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 — c18c235 merged origin/main; the PR still nets two changed files.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using 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.
@nwparker
nwparker merged commit ea10994 into stablyai:main Oct 22, 2026
39 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.

[Bug]: Framed multi-row URL is only clickable on its first line when a TUI overlay lets the screen underneath show through

3 participants