Repository navigation
Render nested Action Text attachment content - #335
Conversation
There was a problem hiding this comment.
Pull request overview
Renders unnamed nested Action Text attachment HTML through the existing bounded Markdown path while preserving named file attachments.
Changes:
- Added nested attachment-content rendering.
- Added regression and filename-precedence tests.
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.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
internal/htmlutil/markdown.go |
Handles embedded Action Text attachment content. |
internal/htmlutil/markdown_test.go |
Tests nested HTML and filename precedence. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
2b6d4f3 to
f33596e
Compare
f33596e to
6de1d33
Compare
|
Rebased onto main as 6de1d33 so this applies cleanly again — #387 (decorative-image skipping) landed in the same three spots. The merge keeps #387's decorative check first in |
|
Thanks for the rendering fix. This recording compares the parent build with commit 6de1d33 using the same synthetic email on a local development server. Before: the email body is replaced by an attachment placeholder. After: the message text and link are visible in both the CLI and TUI. This demonstrates the nested-body rendering scenario; it is not verification of every attachment type or the authentication flow. pilot.mp4 |
|
🤖 Thank you for this, @nitrnitr! Emails whose body sits in a nested The branch was a long way behind Since this branch was opened, #532 started labelling attachments by kind, so a PDF now renders as The rest looks good to me:
One optional thought: With the test expectation updated, this is ready from my side. Thanks again! |
HEY renders an action-text-attachment's content attribute as HTML only when its content type is HTML (ActionText's ContentAttachment). Any other attachment is shown as itself. Rendering every unnamed attachment's content showed text HEY never displays, offered it as clip source text, and fetched an image out of the content in place of the attachment's own. Require text/html, as findAttachments already does. Update the named-PDF expectation for the document icon basecamp#532 introduced, and cover the depth limit for a chain of nested attachments.
The only named-file test used application/pdf, which the HTML type check rejects before the filename is consulted. Deleting the filename condition left every htmlutil test passing, so nothing held the rule that a named attachment stays a file even when it is text/html. Assert a named text/html attachment, with an image in its content, renders as its file row in Markdown and its filename in text, gives no message source text, and yields no image URL from its content.
4392847 to
c8b403b
Compare
|
Thanks Martín, and sorry this took so long. I brought the branch up to date, fixed the PDF test expectation and added the HTML content-type check Jeremy suggested. Checked the rendering in the CLI and TUI against dev HEY, and CI is now green. The nested email body looks good. |
* origin/main: Render nested Action Text attachment content (#335) Add hey thread comment for private thread notes (#383) Select threads with x as well as space (#359) Bump hey-sdk to v0.34.0 (#602) Update nix flake and plugin version for v1.10.1 (#600) Say why a refused Keychain read can't be fixed by signing in again (#599)
What changed
Handle bare
<action-text-attachment>elements whose HTML is stored in acontentattribute.HEY can nest this element inside a Trix HTML attachment. Previously,
ToMarkdowntreated it as a file attachment and rendered📎 attachment, dropping the embedded text and links.Unnamed elements with non-empty
contentare now rendered through the existing bounded embedded-HTML path. Named elements remain file attachments.Added regression coverage for both the nested HTML case and filename precedence.
Testing
make checkmake build