Omniscio

Supermail email rendering — instant open + dark mode

How Supermail (the Superhuman-style email client built into Omniscio) turns a message into pixels: opening an email is near-instant, and in dark mode the emails themselves render dark instead of blasting a white rectangle at you.

On this page

What it is

How Supermail (the Superhuman-style email client built into Omniscio) turns a message into pixels: opening an email is near-instant, and in dark mode the emails themselves render dark instead of blasting a white rectangle at you.

What you see

  • Opening an email is instant. Clicking a message in the list paints the email immediately — no spinner, no "loading" flash — because the app does the heavy work (cleaning + parsing the email's HTML) ahead of time, in the background, for the messages you're likely to open next.
  • New mail arrives with its text. When a new email comes in, Supermail downloads its text in the same sync that sees it arrive, so fresh mail is already on your computer before you click it. Saved drafts are skipped.
  • A preview, never a blank screen. If an email's text hasn't reached your computer yet (very old mail, or a label outside the inbox), the reader opens at once with the sender, subject and Gmail's preview line plus a quiet loading shimmer, then fills in the full email. If the full email can't be fetched, you get the normal "couldn't load, try again" view, and replying or forwarding waits for the full email.
  • Newsletters never wait for their pictures. A designed email's text is on screen the moment it opens; its images fill in as they arrive. One slow or broken image can no longer hold the whole email blank.
  • Dark mode for emails (Carbon theme). When Supermail is in its dark theme ("Carbon"), emails render dark:
    • Simple emails (plain notes, basic replies) already inherit the dark theme — dark background, light text.
    • Designed emails (newsletters, marketing, branded HTML) are shown dark with a smart color-invert that keeps photos, logos, and signatures true-color (they're not turned into negatives). This holds however the sender wraps them — including classic MailerLite newsletters, which before 2026-10-06 stayed white with negative photos.
    • Logos and icons stay readable. A logo or icon drawn on a see-through background — a dark wordmark like Meta's, black clock or location icons, or a white logo on a dark header strip — turns light (or dark) along with the text around it, so it never disappears into the dark background. Before 2026-11-19 these vanished.
    • Emails that would look wrong inverted — ones the sender already designed on a dark background — are auto-detected and left on their original canvas, so they don't get flipped to a glaring light block.
    • Every inverted email has a small "Show original (light)" link at the bottom of the message; click it to see that email exactly as the sender built it (and "Show in dark" to flip back). It resets when you collapse the message.
    • A newer dark mode, "Recolour emails in dark mode (new)" — a separate setting, off by default (Settings → Supermail). Instead of flipping the whole email, it darkens only white and grey backgrounds, lightens dark text, and leaves photos, background images and coloured buttons exactly as the sender made them. When the sender built their own dark version, it uses that. Dark logos and icons on a darkened background turn light; white logos on dark headers stay as they are. Very large emails (over about 4,000 elements) still use the first dark mode. "Show original (light)" works the same way. The Omniscio Gmail viewer has the same option in its own settings (Settings → Gmail).
  • Light mode ("Snow") is unchanged — emails render exactly as before. The dark treatment only applies when the app is in dark mode.
  • A broken image shows its caption, not a blank. If a remote image in an email can't be loaded — the sender's image URL was deleted, moved, rate-limited, or blocked — the reading pane shows a small "caption · View original" chip where the image would be, instead of a mysterious empty gap, so you know something was there and can open the original in your browser. Invisible tracking pixels and embedded (attachment) images are unaffected — they keep their clean, hidden-on-failure behavior.

Where to find it

Nothing to open: this is how Supermail's reading pane paints a message. Supermail itself is the Supermail sidebar entry.

How it behaves

Why it's fast (the mechanism)

An email body has to be security-cleaned (DOMPurify strips scripts / dangerous markup), parsed, and have its quoted-reply section detected before it can render. Doing all that on the click was the lag. Two changes remove it:

  1. Precompute off the click path. Each message's cleaned/parsed result — the sanitized HTML for the frame, the sanitized inline HTML, the quote detection, and the dark-invert decision — is computed once and cached, keyed to that exact message (by id, validated by the body text so it can never serve the wrong email's content). The compute is warmed while the app is idle for the messages you hover, the previous/next message in a thread, and the first handful of visible inbox rows — so by the time you click, it's usually already done and the open is just a paint. Pointing at a row in any list (inbox, labels, snoozed, search) and the threads either side of the one you're reading are warmed too, and a thread that isn't stored locally is fetched once from Gmail at that moment. The quiet background warm of the inbox's top rows only ever reads what is already on your computer.
  2. No double-cleaning. The email frame used to re-clean the HTML a second time on its own; now it receives the already-cleaned HTML and only frames + optionally dark-inverts it. That removes a whole redundant sanitize per open.

Warming is bounded (a capped number of rows, only each thread's newest message), deduplicated (already-cached emails are skipped), and idle-scheduled, so it speeds you up without ever competing with what you're doing — Omniscio's rule is to slow the background work, never the user.

How dark mode works (the technique)

Email HTML assumes a light background, so you can't just drop it on a dark canvas — black text would vanish. Instead the designed email is rendered as the sender built it (light) and the final pixels are inverted: invert(1) swaps light↔dark and hue-rotate(180deg) brings colors back to roughly their original tone. Images, video, SVG, and background-image elements are then re-inverted so photos and logos stay true-color. It's pure CSS, so it works inside the email's locked-down (script-less) sandbox. This is the same "smart invert" the Omniscio Gmail viewer already uses.

Flipping every image back is wrong for one kind of image: a logo or icon on a see-through background. Its dark ink comes back dark, on what is now a dark page. So once each image in a dark email has loaded, Supermail looks at its pixels and picks one of three treatments:

  • A photo or other solid image is flipped back, so it stays true colour.
  • A one-colour logo or icon on a see-through background (mostly dark, or mostly light, and no taller than a logo) is left to invert with the page, exactly like text — so it keeps the same contrast it had in light mode.
  • Anything else see-through, or an image whose sender does not allow its pixels to be read, is flipped back and given a backing in the colour that was behind it in light mode, so it shows as it did in light mode and can never vanish.

This runs only in dark mode, never re-requests a tracking pixel, and adds no permission to the email's sandbox.

The auto-skip heuristic is deliberately conservative: it only leaves an email light when that email clearly declares a dark canvas (a dark background on the body or its full-width wrapper). For everything else it inverts, and the per-email "Show original" toggle is the escape hatch for the subjective cases a rule can't judge.

Supermail is its own isolated app bundle, so it reads dark from its own theme (the theme-carbon class), not Omniscio's main .dark class, and the invert CSS is copied into the plugin rather than imported across the bundle boundary.

The sender's formatting wins

An email's own presentation is content, not theme. Three places used to lose it, and all three now keep it:

  • List numbering. A lettered or roman sub-list — <ol type="a">, <ol type="I">, <ul type="circle"> — shows exactly that instead of collapsing to another "1." at every level.
  • Stylesheet formatting. Alignment, weight, italics, underline and list markers declared in the message's own <style> block reach the rendered body even though the inline path removes the stylesheet itself. Colour, backgrounds and positioning are still discarded — those are the theme's and the security boundary's.
  • A designed email's own typography. In the isolated frame the app's defaults are written on zero-specificity (:where(body), :where(a)) selectors, so a sender's body { font-family … } or a { color … } wins, while an email that declares nothing still gets the app's 15px system default and blue links. Containment (max width, wrapping, no margins) stays at full strength: it is a promise about the card, not a guess about the sender.

The inline mechanism is one pass in conversation/email-inline-styles.ts, run by the inline sanitizer before it removes the stylesheet: whatever the sender declared is written into the element's own style attribute, which outranks the app's base rules. An email that declares nothing renders exactly as before. The composer is a separate surface and is not affected — its paste handler accepts plain text only, so nothing typed or pasted there carries a marker to lose.

Scope & limits

  • Applies to the Supermail reading pane only.
  • Designed emails render inside a sandboxed iframe whose document is written in directly and measured before the first paint, so the text and its height are there on the first frame; images stream in afterwards. Simple emails are synchronous too.
  • The dark-invert is best-effort: an email with an unusual background (a CSS gradient, or a mixed dark/light design) can look slightly off — that's what the auto-skip + the manual toggle are for.
  • A message body always wraps inside the card, whatever the sender's own styling asks for: a preformatted block wraps at the card's width and a long unbroken string breaks rather than running off the edge. An email that deliberately uses fixed-width preformatted text (ASCII art, for instance) therefore reflows — containment wins over the sender's layout.

Supermail itself covers the client this rendering serves, and the reading-view page covers the focus mode and toolbar around the message.

Last verified 2026-11-19