perf: defer HTML-to-plain conversion off the UI thread (P3) #49

Merged
guettlibot merged 1 commits from task/p3-html-parse-isolate into main 2026-05-14 09:14:24 +00:00
guettlibot commented 2026-05-14 09:05:38 +00:00 (Migrated from codeberg.org)

Summary

  • Wraps the htmlToPlain call in _quotedBody with compute() so the regex-heavy HTML stripping runs in a background isolate rather than on the UI thread
  • _reply, _forward, and _quotedBody are now async; onPressed callbacks use unawaited() to fire-and-forget
  • If a plain-text body is already available, compute is skipped entirely — no overhead for text-only emails

Test plan

  • Existing widget tests for EmailDetailScreen still pass (no behavior change)
  • task check-fast green

🤖 Generated with Claude Code

## Summary - Wraps the `htmlToPlain` call in `_quotedBody` with `compute()` so the regex-heavy HTML stripping runs in a background isolate rather than on the UI thread - `_reply`, `_forward`, and `_quotedBody` are now async; onPressed callbacks use `unawaited()` to fire-and-forget - If a plain-text body is already available, `compute` is skipped entirely — no overhead for text-only emails ## Test plan - [x] Existing widget tests for `EmailDetailScreen` still pass (no behavior change) - [x] `task check-fast` green 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.