Repository navigation
Fix terminal URLs split across padded output rows - #31713
Merged
Merged
Conversation
Contributor
|
Warning Review limit reachedYou'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. View limit details
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. Comment |
11 tasks done
8 of 9 tasks
7 of 9 tasks
8 of 9 tasks
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.
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
pnpm tc:web,pnpm run check:code-quality:changed, andgit diff --checkpassed.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 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:
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
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
doneis 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