Skip to content

feat: open HTML emails in browser#1609

Open
Shabhareash wants to merge 3 commits into
floatpane:masterfrom
Shabhareash:feature-open-html-email
Open

feat: open HTML emails in browser#1609
Shabhareash wants to merge 3 commits into
floatpane:masterfrom
Shabhareash:feature-open-html-email

Conversation

@Shabhareash

Copy link
Copy Markdown

What?

Added a new action to open HTML emails in the default browser. When viewing an HTML email, users can now press o to write the HTML body to a temporary file and open it in their system's default browser (using open on macOS, xdg-open on Linux, and cmd /c start on Windows).

Changes:

  • Added OpenHTMLBrowser keybinding (default: o) to config/keybinds.go and config/default_keybinds.json
  • Added OpenHTMLEmailMsg message type to tui/messages.go
  • Updated tui/email_view.go to emit the message when pressing o on HTML emails, with updated help text
  • Implemented openHTMLInBrowser() function in main.go that creates a temp HTML file and opens it with the system browser
  • Schedules automatic cleanup of temp files after 30 seconds

Why?

Complex HTML emails are hard to read in the terminal's degraded text rendering. Opening them in a real browser makes them much easier to view with proper formatting, images, and styling intact. This is a beginner-friendly feature that solves the original issue of poor HTML email readability in TUI mode.

Fixes: #1150

@Shabhareash Shabhareash requested a review from a team as a code owner June 22, 2026 14:53
@floatpanebot floatpanebot added area/tui Terminal UI / view layer area/config Configuration / settings bug Something isn't working chore Maintenance, refactor, cleanup enhancement New feature or request os/linux Linux-specific os/macos macOS-specific os/windows Windows-specific question Further information requested size/M Diff: 51–200 lines labels Jun 22, 2026
@floatpanebot

floatpanebot commented Jun 22, 2026

Copy link
Copy Markdown
Member

Benchmark report — no significant change

Metrics worse: 0 · better: 0 (threshold: ±3%).

benchstat output
goos: linux
goarch: amd64
pkg: github.com/floatpane/matcha/backend
cpu: AMD EPYC 9V74 80-Core Processor                
                           │    old.txt    │               new.txt                │
                           │    sec/op     │    sec/op      vs base               │
ParseSearchQuery_Simple-4    2.956µ ± 379%   1.981µ ± 537%        ~ (p=0.093 n=6)
ParseSearchQuery_Complex-4   8.439µ ±  63%   6.839µ ± 102%        ~ (p=0.180 n=6)
TokenizeSearchQuery-4        4.363µ ± 109%   4.143µ ± 126%        ~ (p=0.589 n=6)
geomean                      4.774µ          3.829µ         -19.81%

                           │  old.txt   │              new.txt               │
                           │    B/op    │    B/op     vs base                │
ParseSearchQuery_Simple-4    26.00 ± 0%   26.00 ± 0%       ~ (p=1.000 n=6) ¹
ParseSearchQuery_Complex-4   762.0 ± 0%   762.0 ± 0%       ~ (p=1.000 n=6) ¹
TokenizeSearchQuery-4        176.0 ± 0%   176.0 ± 0%       ~ (p=1.000 n=6) ¹
geomean                      151.6        151.6       +0.00%
¹ all samples are equal

                           │  old.txt   │              new.txt               │
                           │ allocs/op  │ allocs/op   vs base                │
ParseSearchQuery_Simple-4    2.000 ± 0%   2.000 ± 0%       ~ (p=1.000 n=6) ¹
ParseSearchQuery_Complex-4   23.00 ± 0%   23.00 ± 0%       ~ (p=1.000 n=6) ¹
TokenizeSearchQuery-4        9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                      7.453        7.453       +0.00%
¹ all samples are equal

pkg: github.com/floatpane/matcha/tui
                    │    old.txt    │              new.txt               │
                    │    sec/op     │    sec/op     vs base              │
LogPanelView-4         171.5µ ± 11%   161.7µ ± 18%       ~ (p=0.310 n=6)
SearchOverlayView-4    179.1µ ± 15%   177.4µ ± 10%       ~ (p=0.937 n=6)
InboxConstruction-4   1034.6µ ± 13%   953.8µ ±  8%       ~ (p=0.132 n=6)
geomean                316.7µ         301.3µ        -4.86%

                    │    old.txt    │               new.txt               │
                    │     B/op      │     B/op       vs base              │
LogPanelView-4        44.67Ki ± 51%   44.67Ki ± 51%       ~ (p=1.000 n=6)
SearchOverlayView-4   56.14Ki ± 41%   56.14Ki ± 41%       ~ (p=1.000 n=6)
InboxConstruction-4   874.2Ki ±  0%   874.2Ki ±  0%       ~ (p=0.240 n=6)
geomean               129.9Ki         129.9Ki        +0.00%

                    │   old.txt   │              new.txt              │
                    │  allocs/op  │  allocs/op   vs base              │
LogPanelView-4         714.0 ± 0%    714.0 ± 0%       ~ (p=1.000 n=6)
SearchOverlayView-4    926.0 ± 0%    926.0 ± 0%       ~ (p=1.000 n=6)
InboxConstruction-4   3.477k ± 0%   3.478k ± 0%       ~ (p=0.340 n=6)
geomean               1.320k        1.320k       +0.00%

auto-generated by benchmarks.yml

@Shabhareash Shabhareash force-pushed the feature-open-html-email branch from 19faec5 to bb26d4e Compare June 22, 2026 15:11
@andrinoff

Copy link
Copy Markdown
Member

@Shabhareash sorry, this issue is a duplicate. This feature already is in v1 #1501

@Shabhareash

Copy link
Copy Markdown
Author

Sorry for the multiple CI runs. This is my first issue on such a repo and i had some trouble with the linting tools.

@andrinoff

Copy link
Copy Markdown
Member

I'd love to see you contribute into matcha. Please note, that we currently only implement features to v1 (release/v1) branch

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

Labels

area/config Configuration / settings area/tui Terminal UI / view layer bug Something isn't working chore Maintenance, refactor, cleanup enhancement New feature or request os/linux Linux-specific os/macos macOS-specific os/windows Windows-specific question Further information requested size/M Diff: 51–200 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FEAT: Auto-fetch PGP keys via HKP keyserver

3 participants