8000 feat(reader): add a per-message Light / Dark Mode switch by fsoft72 · Pull Request #386 · hyprlab/hylki · GitHub
[go: up one dir, main page]

Skip to content

feat(reader): add a per-message Light / Dark Mode switch - #386

Closed
fsoft72 wants to merge 2 commits into
hyprlab:mainfrom
fsoft72:message-theme
Closed

fsoft72 wants to merge 2 commits into
hyprlab:mainfrom
fsoft72:message-theme

Conversation

@fsoft72
@fsoft72 fsoft72 commented Oct 8, 2026
Copy link
Copy Markdown
Contributor

What

A Light / Dark Mode switch in the message header, just before the Reader View switch. It draws the message on screen in the other scheme (light or dark) for that message alone, whatever the message theme in Settings says.

Why

Some mail is designed for one scheme and reads badly in the other: a newsletter whose colors do not survive the dark adaptation, or a dark-designed message on a light ground. Changing the global message theme just for one message is overkill.

How

  • MessageView keeps a session-wide set of flipped messages (theme_flips), keyed by (account_id, id), like sender_style.
  • effective_dark() is the message theme (or the system's) turned over when the message on screen is in that set, so the webview ground, the spinner cover and the render fingerprint all follow it with no other change.
  • The switch shows the scheme the message is drawn in; flipping it sends SetMessageDark, which is a no-op when the scheme already matches (a new message, a system theme change), so there is no feedback loop.
  • Works in the main reader and in a message's own window.
  • In a conversation the document has one scheme, so the choice follows the message the conversation is shown for.
  • Label and tooltip added to po/hylki.pot and translated in every po/*.po (by hand, xtr was not available to regenerate the template).

Testing

  • cargo build, cargo test message_view (62 passed).

fsoft72 added 2 commits October 8, 2026 20:43
A message designed for one scheme can read badly in the other. The
switch before Reader View draws the message on screen in the other
scheme, for that message alone, and keeps the choice for the session.
Adds the switch's label and tooltip to the template and to every
translation, by hand: xtr is not installed here to regenerate them.
@hyprlab
hyprlab commented Oct 10, 2026
Copy link
Copy Markdown
Owner
image

Love this, merged. It will go out in 1.44.0 beta

hyprlab added a commit that referenced this pull request Oct 10, 2026
Settings → Reading → Light / Dark Mode switch shows it, off by default. The choice lasts the session and is kept per message.

Co-Authored-By: Fabio Rotondo <2844375+fsoft72@users.noreply.github.com>
@hyprlab hyprlab closed this Oct 10, 2026
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.

2 participants

0