Show attachments by name and kind instead of by URL - #532
Merged
Merged
Conversation
An image in a thread read "Image: name → url", and HEY's own attachment URLs are long enough to fill a couple of lines each with nothing a reader can use. An image now reads "📷 name". Its name is still the link, so an image on the web can be selected with Tab and the status row shows where it goes; HEY's own attachments open from the Attachments box as before. Other files are marked by kind: 🎬 video, 🎵 audio, 📄 a PDF or document, 📎 anything else. These emoji are all drawn as emoji without a variation selector, so every terminal gives them the same two cells. 🖼️ and 🎞️ need U+FE0F, and terminals disagree on how wide that makes them. The Markdown in --json keeps each image's URL.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
URL-shaped image labels can conceal a different hyperlink destination.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Replaces verbose attachment URLs with concise, type-specific markers while retaining image links in machine-readable output.
Changes:
- Renders images as
📷 nameand adds icons for other attachment types. - Preserves selectable image destinations and updates tests/documentation.
- One deceptive-link security regression remains.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
| File | Description |
|---|---|
internal/tui/mail_test.go |
Updates attachment rendering expectations. |
internal/markdown/style.go |
Hides image URLs and adds camera styling. |
internal/markdown/render_test.go |
Tests named, selectable images. |
internal/htmlutil/markdown.go |
Assigns attachment icons by media type. |
internal/htmlutil/markdown_test.go |
Tests attachment classification. |
internal/htmlutil/markdown_safety_test.go |
Updates safe serialization expectations. |
docs/tui.md |
Documents attachment markers and image links. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
With the URL hidden, an image labelled https://bank.example/login could link to somewhere else entirely and nothing on screen would say so. A web image whose label could pass for a URL, and is not just the name of the file it points at, now has its destination written out beside it, the way a link's label does.
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.

Images in a thread showed as
Image: name → url. HEY's own attachment URLs (/rails/active_storage/blobs/redirect/…) run to a couple of lines each and give the reader nothing useful, so a message with a few photos turned into a wall of links.📷 name. The name is still the link: an image on the web can be selected with Tab, the status row shows its full URL, and Enter opens it. HEY's own attachments open from the Attachments box witho, as before.--jsonand--markdownkeep each image's URL, so scripts and agents still get it.Why these emoji: 🖼️ and 🎞️ were suggested, but both need an invisible U+FE0F to show as emoji, and terminals disagree on whether that makes them one cell wide or two, which shifts everything after them on the line. It's the same problem the peace cover art hit. 📷 🎬 🎵 📄 📎 are emoji on their own and take two cells everywhere.
Pairs with #531, which shows a long link in full in the status row. Once both are in, hiding an image's URL in the body loses nothing.
Basecamp card: https://app.basecamp.com/2914079/buckets/48521764/card_tables/cards/10357135568
Recorded against the local dev server: a message with a web image, a photo, a PDF, a video and an audio file. Each take opens the thread and presses Tab once to select the web image.
Summary by cubic
Shows thread attachments by kind and name instead of image URLs, so a message full of photos no longer becomes a wall of long links.
📷 name; the name still links to the web image, and the status row shows its full destination when selected.--jsonand--markdownoutput keep each image's URL, so scripts and agents still get it.Written for commit bc21fca. Summary will update on new commits.