Skip to content

Show delivery and recipient addresses in mail views and Screener previews - #643

Open
WhiskeyTuesday wants to merge 2 commits into
basecamp:mainfrom
WhiskeyTuesday:show-envelope-in-tui
Open

WhiskeyTuesday wants to merge 2 commits into
basecamp:mainfrom
WhiskeyTuesday:show-envelope-in-tui

Conversation

@WhiskeyTuesday

@WhiskeyTuesday WhiskeyTuesday commented Nov 12, 2026 •

Copy link
Copy Markdown

The TUI now shows Via, To, Cc and Bcc when reading a message and, crucially, in the Screener preview. Empty fields are omitted. Via preserves the exact address the message arrived through, including plus-tags and catch-all aliases.

Knowing who sent a message is only part of deciding what to do with it. With multiple HEY for Domains accounts, or forwarding from several domains, the destination address provides essential context. In the Screener, seeing where a message was intended to go—and who else was included—helps inform the decision to accept or reject a sender.

HEY’s web interface already exposes this information; this brings that context into the TUI.

The change also displays sender addresses alongside names in the mail view, adjusts Screener preview layout for the additional headers, and adds regression tests and documentation.


Summary by cubic

The TUI thread view and Screener preview now show a message's delivery and recipient addresses, not just its sender.

  • Via, To, Cc, and Bcc lines appear under the From line; empty lines are omitted.
  • Via keeps the exact address mail arrived through — plus-tags and catch-all aliases included — and only shows for inbound mail.
  • Notes and share notices show none of these lines, since they were never emailed.
  • A sender with both a name and an address now prints as Name <address>, including mail you sent; an alternative sender name keeps just the name.
  • Long lines are truncated to the screen width in both views, and the sender line trims to fit beside the date.
  • On short terminals the Screener preview header scrolls with the message so every address stays reachable.

Written for commit 832ad33. Summary will update on new commits.

View guided diff

RetriggerView in GreptileConfidence Score: 4/5

The PR appears safe to merge, with a non-blocking layout issue in short Screener windows.

Findings

  1. P2 Preview outgrows short windows ▶
Fix with agent prompt
### Issue 1
internal/tui/screener_preview.go:169-171
With all four address lines present, `previewHeader()` takes seven rows. If the terminal leaves seven or fewer rows for the preview, `layoutPreview()` still reserves at least one body row. The preview exceeds its allotted space and can push the help bar off-screen. Put the extra headers inside the scrolling area, or shorten the fixed header when space runs out.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Shows delivery and recipient addresses in opened threads and Screener previews.

  • Opened threads show who sent each message, where it arrived, and who received it.
  • Screener previews show where each message arrived and who received it.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[SDK message] --> B[Thread loader retains addresses]
  B --> C[mail.Entry]
  A --> D[Screener preview]
  C --> E[Shared address formatting]
  D --> E
  E --> F[Via, To, Cc and Bcc rows]
Loading

Reviews (1) · Last reviewed commit: "Show Via, To, Cc and Bcc when reading ma..." · Reviewed by Greptile

@WhiskeyTuesday
WhiskeyTuesday requested a review from a team as a code owner November 12, 2026 01:32
Copilot AI balanced review requested due to automatic review settings November 12, 2026 01:32
Comment thread internal/tui/screener_preview.go Resolved

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.

🟡 Changes recommended

On short terminals, fixed headers can consume all available rows while the layout still reserves a body row, causing the preview to exceed its allotted height.

1 open issue
What changed in this PR

Adds delivery and recipient context to hey-cli’s TUI thread views and Screener previews, helping users identify which address received a message and who else was included.

Changes:

  • Retains exact delivery addresses, including plus-tags and aliases, alongside recipient metadata.
  • Displays nonempty Via, To, Cc, and Bcc headers and adds sender addresses to thread headings.
  • Adds regression tests and updates user and architecture 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/​screener_test.go Adds recipients and delivery addresses to the preview fixture.
internal/​tui/​screener_preview.go Loads and displays envelope headers in previews.
internal/​tui/​screener_preview_test.go Tests envelope display and loading behavior.
internal/​tui/​mail.go Retains envelope metadata and renders expanded message headings.
internal/​tui/​mail_test.go Tests metadata retention, sender formatting, and envelope rendering.
internal/​tui/​envelope.go Adds shared recipient formatting and header truncation.
internal/​mail/​entry.go Extracts recipients and exact delivery addresses into mail entries.
internal/​mail/​entry_test.go Tests envelope extraction and missing-message behavior.
docs/​tui.md Documents headers in threads and Screener previews.
docs/​architecture/​threads-and-replies.md Updates the TUI’s metadata-retention documentation.

Review effort: Balanced

Comment thread internal/tui/screener_preview.go Resolved

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 10 files

Reply to a comment to ask cubic a question or push back. It learns from your replies.

View guided diff | Re-trigger cubic

Comment thread internal/tui/mail.go Resolved
Comment thread internal/tui/screener_preview.go Resolved
Comment thread internal/mail/entry_test.go Resolved
@WhiskeyTuesday

Copy link
Copy Markdown
Author

Addressed the review feedback in 832ad33. On short terminals, preview headers now scroll with the message so all delivery and recipient addresses remain accessible. Long sender headings are truncated to fit beside the date, and the recipient test now guards against missing entries.

Added layout regression tests; make test and make lint pass.

This branch has not been deployed

No deployments
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