feat(ui): show hovered URL in the status bar#79
Merged
Conversation
When the mouse hovers a linked cell (OSC 8 hyperlink or auto-detected URL), render the full URL in the center slot of the status bar, in place of the pane title. Over-long URLs are shortened with a middle ellipsis so both the scheme/host and the path tail stay visible.
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.
Summary
When the mouse hovers a linked cell (OSC 8 hyperlink or auto-detected URL), the full URL is now shown in the status bar. Previously
hovered_urlonly underlined the cell; it was never surfaced as text.Changes
Renderer::drawtakes a newhovered_url: Option<&str>argument, forwarded intodraw_status_bar.render_ops.rspassesself.state.hovered_url.as_deref()on every frame.hovered_url.or(pane_title)); it is suppressed during Search mode just like the pane title.draw_pane_title_centerednow truncates over-long center text with a middle ellipsis via a newtruncate_middle_ellipsishelper, keeping the URL scheme/host and path tail visible.drawcall sites to pass the new argument.How to test
cargo test(1218 pass, includes newdraw_status_bar_hovered_url_does_not_panic).cargo clippy --locked -- -D warnings(clean).printf '\e]8;;https://example.com/some/long/path\e\\link\e]8;;\e\\\n', hover the rendered link, and observe the URL centered in the status bar (truncated with an ellipsis when very long).