Skip to content

Show a long link in full and let Enter open it - #531

Merged
robzolkos merged 3 commits into
mainfrom
open-long-links
Sep 30, 2026
Merged

robzolkos merged 3 commits into
mainfrom
open-long-links

Conversation

@robzolkos

@robzolkos robzolkos commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

In a thread, a selected link could only be opened when its whole destination fit on the footer row. Long tracking URLs, which newsletters are full of, were stuck behind "Enlarge the terminal to inspect this link" on anything but a very wide terminal.

A destination too long for one row now wraps onto as many rows as it needs. You still see exactly where the link goes before pressing Enter, and Enter opens it. The extra rows come out of the thread only while that link is selected, and the thread scrolls to keep the selected link on screen. Short links still take a single row, so moving between them doesn't resize anything.

If the terminal is too short for all of the rows, the enlarge hint comes back and Enter does nothing, as before.

Basecamp card: https://app.basecamp.com/2914079/buckets/48521764/card_tables/cards/10356872225


Summary by cubic

Lets you open a selected link in a thread as soon as the footer can show the whole destination, even when it wraps onto multiple rows instead of fitting one.

  • A destination too long for one row wraps onto the rows it needs, taken from the thread content while that link is selected; Enter opens the complete URL. When the terminal is too short for all those rows, the "Enlarge the terminal to inspect this link" hint comes back and Enter does nothing.
  • Updates docs/tui.md so the link-row text no longer promises a one-row display of the complete destination.

Written for commit 654f926. Summary will update on new commits.

Review in cubic

Recorded against the local dev server. Both takes open a thread with one long link, Tab to it, and press Enter. xdg-open is stubbed to log whatever it's handed, so the last line shows what actually got opened.

Before After
before after

A selected link could only be opened when its whole destination fit on the
footer row, so a long tracking URL was stuck behind "Enlarge the terminal"
on all but the widest screens. The footer now keeps the scheme and host in
full and cuts the rest of the path short, which still says where the link
goes, and Enter opens it. A destination with no host, like a mailto link,
still has to fit in full.
@robzolkos
robzolkos requested a review from a team as a code owner September 30, 2026 16:07
Copilot AI balanced review requested due to automatic review settings September 30, 2026 16:07

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

The TUI documentation still incorrectly promises that the complete destination is always displayed.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Enables opening long thread links once their scheme and host are visible.

Changes:

  • Truncates long URL paths in the footer.
  • Opens the complete URL after review.
  • Adds tests and TUI documentation.

[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

File Description
internal/​tui/​mail.go Adds host-preserving footer truncation.
internal/​tui/​mail_test.go Tests truncation and full URL opening.
docs/​tui.md Documents long-link behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/tui.md Outdated
Trimming the path kept the host readable, but the point of the status row is
seeing exactly where a link goes before opening it. A destination too long for
one row now wraps onto the rows it needs, taken from the thread while that link
is selected, and Enter opens it. When the terminal is too short for all of those
rows the enlarge hint comes back and Enter does nothing.
@robzolkos robzolkos changed the title Open a long link once the footer can show its host Show a long link in full and let Enter open it Sep 30, 2026
@robzolkos
robzolkos merged commit 42ae89d into main Sep 30, 2026
25 checks passed
@robzolkos
robzolkos deleted the open-long-links branch September 30, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants