Skip to content

Fix terminal URLs split across padded output rows - #31713

Merged
nwparker merged 7 commits into
mainfrom
nwparker/notion-split
Oct 22, 2026
Merged

nwparker merged 7 commits into
mainfrom
nwparker/notion-split

Conversation

@nwparker

@nwparker nwparker commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​534 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​534
Prod 17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​392 $\color{#cf222e}{\Huge{\mathbf{−}}}$​137 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​255

ELI5

Long web links printed across padded terminal rows now hover and open as one complete URL from either row.

What Changed

Reconstruct hard-wrapped HTTP links using consistent content margins, and register a provider that shares the click fallback's reconstruction. Keep link ranges within the actual text on each row, preserve native soft-wrap handling and explicit OSC 8 destinations, and refresh hovered links when their source rows change.

Reject non-URL rows before cell translation, bound backward scans for heavily indented output, and reject oversized reconstructed URLs without advertising a shorter prefix. Keep shared reconstruction independent of click routing and UI state. No protocol, persistence, or remote-host API changes.

To restore the full lint gate after updating the branch, move unchanged client-hosted browser props into its existing types module and unchanged question-dismissal identity into a focused module, preserving the original export.

Why

Some terminal applications lay out a long URL themselves and write each row independently. The terminal has no soft-wrap metadata for those rows, so the existing hover provider exposed a truncated destination.

Linked Issue

Related: #21816 addresses framed output with changing content before the frame; this change handles unframed padded rows.

Visual Proof

Public example URLs only. Crops show the terminal rows and bottom hover strip together.

Before: existing single-row provider (wrapped provider disabled for this capture); destination stops at the physical row.

(screenshot removed: contained real product data)

After: complete destination, including ?view=full#details; opening was verified against the exact full URL.

(screenshot removed: contained real product data)

Testing

  • Manually tested in a hidden macOS Electron renderer through Playwright CDP.
  • Automated tests added/updated.
  • Reproduced before editing with the installed terminal application loading a saved assistant session; a live model request was unavailable because its configured credentials failed.
  • Initial focused validation covered provider reconstruction, OSC URL/file routing, remote ownership, click priming, mouse suppression, and pane creation. After review fixes, 146 tests passed across 13 files, including length boundaries, streaming refresh, pane creation, file-provider detection/batching, and cell-range mapping.
  • pnpm tc:web, pnpm run check:code-quality:changed, and git diff --check passed.
  • Rendered checks: both rows, plain-click menus, Cmd-click, cold clicks under mouse reporting, native soft wraps, OSC 8 BEL/ST targets differing from visible text, neighboring URLs/file links, and continuation-row rewrites. No mouse bytes reached the PTY during terminal-owned link clicks.
  • Headless cases cover left-only and symmetric margins, wide cells, alternate buffers, labels, misalignment, sibling links, and streaming rewrites.
  • Deeply indented non-link scan median improved from approximately 11 ms to 0.006 ms in the same local benchmark. Timing is indicative; a deterministic scan-count test covers the bound.
  • Linux/Windows and live SSH/mobile were not run locally. Existing platform-modifier and remote-routing tests passed; this change preserves their routing callbacks.
  • After updating from main: full oxlint, web typechecking, 105 focused terminal tests, and 23 question-parser/dismissal tests passed locally. The full build and repository-wide tests run in CI.

Review

Completed a post-publication adversarial review of provider precedence, explicit hyperlink authority, padding hit ranges, stale output, alternate buffers, scan bounds, length limits, routing boundaries, and dependency direction.

Review findings fixed:

  • A reconstructed URL over 2,048 characters could expose an intermediate prefix as a complete link. Publish only the final candidate and reject it on overflow; real terminal-buffer tests cover 2,048, 2,049, and 2,200 characters from both ends.
  • The new provider imported click-routing/UI dependencies. Move existing reconstruction and deduplication into focused, pure modules shared by the providers and click handlers; file-provider regressions pass.

A further adversarial pass reproduced and fixed two more failures: an earlier separate URL on the start row prevented reconstruction of the final wrapped URL, and uppercase HTTP/HTTPS schemes left continuation rows unlinked. Regression tests include embedded schemes to prevent accidentally splitting redirect URLs. A fresh hidden-renderer run passed 16 hover-and-open checks across padded/native wraps, OSC 8 BEL/ST, neighboring links, preceding links, uppercase schemes, and embedded schemes. The latest focused suite passed 91 tests across seven files; web typechecking and changed-code quality checks passed.

Final independent review fixes:

  • Prefer complete candidates containing hard wraps consistently for hover and cold clicks, including mixed soft/hard output.
  • Require written right padding when inferring a symmetric content margin; unwritten cells after a complete URL no longer cause following prose to be appended.
  • Support hanging continuation indentation bounded by the URL start column, including padded list output.

Each failure was reproduced before its fix. The resulting six-file suite passed 89 tests after the final sibling-link regression fix. A fresh hidden renderer passed 22 hover/open checks, including six cold-click checks of the review cases. Web typechecking and changed-code quality gates passed after these fixes.

Final Opus verification at 656850e0234: no blocking findings. The reviewer confirmed the cold-click sibling fix matches its independently validated fix and reran the sibling/mixed-wrap probes plus all 39 provider tests. The review also ran 6,628 related terminal/pane tests on the preceding review head and 344 related tests with the final minimal sibling fix.

The final follow-up preserves a soft-wrapped sibling URL that begins on the hard-wrapped URL's tail row: reconstructed candidates skip their single-row matches, allowing native wrap detection to provide the complete sibling destination.

No additional blocking finding remains within the tested scope. The hard-newline ambiguity below remains, and platform/live-agent validation gaps are listed above.

Agent skill upstream boundary

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

Notes

Wrapped links underline the hovered row only; each row opens the same complete destination. Per-row ranges keep the margins outside the hit target.

Hard-newline reconstruction is heuristic: a URL exactly filling a padded row followed by an equally indented token such as done is indistinguishable from a real URL continuation and can still be joined. Explicit OSC 8 metadata avoids this ambiguity and remains authoritative.

Other reviewed limits: symmetric margins cleared with EL/ECH rather than written spaces do not reconstruct; fully painted indented rows can retain the same continuation ambiguity; hostile narrow columns of repeated scheme tokens can cost roughly 35 ms to scan. URLs over 2,048 characters are declined by the reconstruction provider, but the existing single-row fallback can still expose a physical prefix. These are documented non-blocking limitations, not claims of complete terminal parity.

Checklist

  • Focused on terminal URL reconstruction and hover/click consistency.
  • Explained the before/after behavior and mechanism.
  • Before/after screenshots attached.
  • Post-publication adversarial review completed; findings fixed and revalidated.
  • Cross-platform, folder-workspace, remote, and mobile implications considered.
  • Focused local checks passed; CI covers the broader build/test gates.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 69ab7cbb-cca3-4add-8e6d-b368cc50d0e0
📥 Commits

Reviewing files that changed from the base of the PR and between b0fcdb4 and 656850e.

📒 Files selected for processing: 22
  • src/renderer/src/components/browser-pane/ClientHostedBrowserPagePane.tsx
  • src/renderer/src/components/browser-pane/describe-page/browser-page-types.ts
  • src/renderer/src/components/terminal-pane/edge-wrapped-terminal-http-links.test.ts
  • src/renderer/src/components/terminal-pane/edge-wrapped-terminal-http-links.ts
  • src/renderer/src/components/terminal-pane/terminal-file-link-hit-testing.ts
  • src/renderer/src/components/terminal-pane/terminal-http-logical-lines.ts
  • src/renderer/src/components/terminal-pane/terminal-http-url-extraction.ts
  • src/renderer/src/components/terminal-pane/terminal-link-handlers.ts
  • src/renderer/src/components/terminal-pane/terminal-link-logical-line-deduplication.ts
  • src/renderer/src/components/terminal-pane/terminal-link-row-range.ts
  • src/renderer/src/components/terminal-pane/terminal-osc-link-cells.ts
  • src/renderer/src/components/terminal-pane/terminal-url-link-hit-testing.ts
  • src/renderer/src/components/terminal-pane/wrapped-terminal-http-link-limits.test.ts
  • src/renderer/src/components/terminal-pane/wrapped-terminal-http-link-provider.test.ts
  • src/renderer/src/components/terminal-pane/wrapped-terminal-http-link-provider.ts
  • src/renderer/src/lib/pane-manager/pane-dom-creation.test.ts
  • src/renderer/src/lib/pane-manager/pane-dom-creation.ts
  • src/renderer/src/lib/pane-manager/terminal-linkifier-hover-reset-on-write.test.ts
  • src/renderer/src/lib/pane-manager/terminal-linkifier-hover-reset-on-write.ts
  • src/renderer/src/lib/pane-manager/terminal-linkifier-hover-reset.ts
  • src/shared/native-chat-ask-dismiss-key.ts
  • src/shared/native-chat-ask.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

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