Public: anyone can read this; the crew can change it.

An .eml file in a repository opens as a message: From, To, Subject, Date and the plain-text body, drawn on the server #11022

shipped production is serving it opened this has it
opened this

Mail is a common file in a client's repository and today it shows as raw MIME.

Done when:

  • [x] src/web/render/eml.ts (new, no dependency) parses RFC 5322 headers with folding and RFC 2047 encoded words, and multipart bodies; it shows From, To, Cc, Subject and Date as rows, then the first text/plain part (quoted-printable and base64 decoded, UTF-8 and latin-1), then attachments listed by name, type and size.
  • [x] A text/html-only message shows its text with tags stripped and a line saying so; HTML is never rendered.
  • [x] kinds.ts maps eml to the new kind (5 MB cap), renderers.ts names it; malformed input falls back to Source with the reason; every value is escaped.
  • [x] The terminal workspace (src/tui/screens/workspace.ts) shows the same rows, s for source.
  • [x] test/render-eml.test.ts covers a plain message, folded and encoded headers, multipart with an attachment, html-only, a <script> in Subject and a malformed file; docs/features/file-eml.md says what it shows.
  • [x] bun scripts/design-lint.ts passes; any new class goes in docs/design/areas/render.md.

Files: src/web/render/eml.ts, src/web/render/kinds.ts, src/web/render/renderers.ts, src/tui/screens/workspace.ts, test/render-eml.test.ts, docs/features/file-eml.md. Risk: workspace.ts is also touched by #10995; keep the change to one entry in its kind table.

commented

Left open after pull #11038 landed: 6 unticked items remain (src/web/render/eml.ts (new, no dependency) parses RFC 5322 headers with folding and RFC 2047 encoded words, and multipart bodies; it shows From, To, Cc, Subject and Date as rows, then the first text/plain part (quoted-printable and base64 decoded, UTF-8 and latin-1), then attachments listed by name, type and size.; A text/html-only message shows its text with tags stripped and a line saying so; HTML is never rendered.; kinds.ts maps eml to the new kind (5 MB cap), renderers.ts names it; malformed input falls back to Source with the reason; every value is escaped.; …). The planner files each as its own issue and closes this one; a person may close it, tick what is done, or say what is left. Until then the crew does not pick it again.

commented

Reviewed pull #11038 at its head: ticked src/web/render/eml.ts (new, no dependency) parses RFC 5322 headers with folding and RFC 2047 encoded words, and multipart bodies; it shows From, To, Cc, Subject and Date as rows, then the first text/plain part (quoted-printable and base64 decoded, UTF-8 and latin-1), then attachments listed by name, type and size.; A text/html-only message shows its text with tags stripped and a line saying so; HTML is never rendered.; kinds.ts maps eml to the new kind (5 MB cap), renderers.ts names it; malformed input falls back to Source with the reason; every value is escaped.; The terminal workspace (src/tui/screens/workspace.ts) shows the same rows, s for source.; test/render-eml.test.ts covers a plain message, folded and encoded headers, multipart with an attachment, html-only, a <script> in Subject and a malformed file; docs/features/file-eml.md says what it shows.; bun scripts/design-lint.ts passes; any new class goes in docs/design/areas/render.md..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs