Skip to content

Conversation

@rafaeltonholo
Copy link
Member

Fixes #3172.

This PR will address the majority of emails with complex HTML and CSS being rendered incorrectly. Large images and tables will still zoom out the WebView.

  • Introduce the :feature:mail:message:reader:api and :feature:mail:message:reader:impl modules
  • Adds a new feature flag "use_new_message_viewer_css_styles"
  • Moved CSS styles from DisplayHtml to CssStyleProvider interface implementations, enabling old CSS fallback when the feature flag is off
  • Add new CSS rules, supporting more complex email rendering for mobile

For future improvements:

We need to figure out a way to verify if we can resize large images and tables without using JavaScript. Otherwise, we will need to decide on either enabling JS, but limiting its usage via HTML preprocessor, or leaving it zooming out the WebView.

@rafaeltonholo rafaeltonholo requested a review from a team as a code owner November 7, 2025 20:17
@rafaeltonholo rafaeltonholo requested a review from wmontwe November 7, 2025 20:17
@rafaeltonholo rafaeltonholo added the merge block: soft freeze PR to main is blocked: risky code or feature flag enablement must wait until soft freeze lifts. label Nov 10, 2025
@rafaeltonholo rafaeltonholo force-pushed the fix/3172/email-html-css-bad-rendering branch from c86d6a8 to b34acc8 Compare November 10, 2025 13:08
@wmontwe wmontwe removed the merge block: soft freeze PR to main is blocked: risky code or feature flag enablement must wait until soft freeze lifts. label Nov 14, 2025
@wmontwe wmontwe changed the title fix(message-reader): complex html email rendeing incorrectly fix(message-reader): complex html email rendering incorrectly Nov 14, 2025
wmontwe
wmontwe previously approved these changes Nov 19, 2025
Copy link
Member

@wmontwe wmontwe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job! Couldn't spot new issues while browsing my emails and issues seem to be resolved.

wmontwe
wmontwe previously approved these changes Nov 19, 2025
Copy link
Member

@wmontwe wmontwe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@rafaeltonholo rafaeltonholo force-pushed the fix/3172/email-html-css-bad-rendering branch from ad98cb3 to 223801c Compare November 19, 2025 13:15
…irectly on DisplayHtml

The key changes include:
- Moving `HtmlSettings.kt` and `HtmlSettingsProvider.kt` to :core:common.
- Introducing `CssClassNameProvider`, `GlobalCssStyleProvider`, `PlainTextMessagePreElementCssStyleProvider`, and `SignatureCssStyleProvider` to dynamically generate CSS for message display.
- Updating `DisplayHtml`, `HtmlProcessor`, and their factories to use these new providers.
- Refactoring dependency injection to provide the new CSS services.
- Using CSS variables for blockquote border colors in `EmailTextToHtml`.
Copy link
Member

@wmontwe wmontwe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@rafaeltonholo rafaeltonholo merged commit 77a4522 into thunderbird:main Nov 19, 2025
17 of 34 checks passed
@rafaeltonholo rafaeltonholo deleted the fix/3172/email-html-css-bad-rendering branch November 19, 2025 15:45
@thunderbird-botmobile thunderbird-botmobile bot added this to the Thunderbird 16 milestone Nov 19, 2025
@Djfe
Copy link
Contributor

Djfe commented Nov 19, 2025

very interesting, I will report back once this hits a release and give feedback here
Thanks for working on this!! 🙏

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.

Wrap long lines when displaying message (text size gets too small)

3 participants