Skip to content

Fix HTML preview rendering in Tracy panel#49

Closed
zraly wants to merge 2 commits into
nextras:masterfrom
zraly:codex/fix-html-preview-upstream-v2
Closed

Fix HTML preview rendering in Tracy panel#49
zraly wants to merge 2 commits into
nextras:masterfrom
zraly:codex/fix-html-preview-upstream-v2

Conversation

@zraly

@zraly zraly commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #47.

Summary

  • load Preview HTML through a dedicated server-side preview endpoint
  • stop writing preview HTML into the iframe document client-side
  • keep HTML preview rendering on the same server-side path used for rendered message previews
  • avoid injecting a new <base> tag when the email already defines one
  • update tests for the new preview endpoint behavior

Why

The regression does not seem to be in MIME extraction itself. The extracted HTML is correct, but the Tracy panel preview was still reconstructing the iframe document client-side, which is fragile for full HTML emails containing <head> and <style>.

@hrach

hrach commented May 3, 2026

Copy link
Copy Markdown
Member

Oh no, AI slop detected ~> it still doesn't work. I'm reverting what was merged previously.

I definitely welcome every contribution and fixes, but it mas work, right? :) To help you debug it, attaching my testing mail that renders wrongly.

20260215131357-15d6ea.mail.txt (just rename to .mail only and put to relevant temp)

image

@hrach

hrach commented May 3, 2026

Copy link
Copy Markdown
Member

I'm totally lost - after the revert it sill doesn't work - so I'm fixing the rendering.

And for you, I guess, remains relanding the better html extraction.

@zraly

zraly commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for looking into this and sorry for the extra work here.

I’ll close this PR and leave the current fix as-is. If I feel confident enough to improve the HTML extraction later, I’ll do it as a small separate PR focused only on the extraction itself.

Sorry for the trouble caused by the previous change.

@zraly zraly closed this May 4, 2026
@hrach

hrach commented May 4, 2026

Copy link
Copy Markdown
Member

No worries :) Just the next time, ideally attach also the testing mail to allow us create a unit test to cover the hmtl extraction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preview HTML does not work

2 participants