Skip to content

fix(reader): fit mail a little wider than the reader instead of cutting it off - #712

Closed
adriadam10 wants to merge 1 commit into
hyprlab:mainfrom
adriadam10:fix/reader-fit
Closed

adriadam10 wants to merge 1 commit into
hyprlab:mainfrom
adriadam10:fix/reader-fit

Conversation

@adriadam10

Copy link
Copy Markdown
Contributor

What

The reader widens each message's frame to the message's widest part (so wide newsletters scroll sideways instead of being clipped). A side effect: one wide fixed-width element, typically a corporate signature table with width:600px, lays every line of the mail out at 600 px. In a narrow reader (window on half a screen) the end of every line is then out of sight, reachable only by scrolling sideways.

This changes the size script so that, after measuring:

  • Mail up to 1.4× the pane's width is zoomed down to fit it (text no smaller than ~70%), so it is all visible at once.
  • Wider mail keeps its body's max-width at the pane's width: the text wraps at the pane, and only what is genuinely wider (the signature table, a wide screenshot) still scrolls sideways.

Both adjustments are undone before every measure, so resizing the window back up returns the mail to its natural layout. The reader zoom (vfZoom) also resets the fit.

Testing

  • cargo test: all pass; the four characterization goldens are re-blessed, the only diff is the embedded size script.
  • Demo mail with a 600 px signature table: at a 960 px window the message is scaled to fit entirely; at 820 px the text wraps at the pane width and only the signature scrolls.

Written with Claude Code; the commit carries a Co-Authored-By: Claude trailer required by my organization's settings, even though tools/git-hooks/commit-msg asks for none. Happy to drop it when squashing.

…ng it off

The reader widens a message's frame to its widest part, so a single
600-pixel signature table laid every line of the mail out at 600 pixels,
and in a narrow reader (a window on half a screen) the end of each line
was out of sight. Mail up to 1.4 times the pane's width is now zoomed down
to fit it, its text no smaller than 70%. Wider mail has its body held to
the pane's width, so its text wraps there and only what is wider still
scrolls sideways. Both are undone before each measure.

Co-Authored-By: Claude <noreply@anthropic.com>
hyprlab added a commit that referenced this pull request Nov 25, 2026
The frame widens to a message's widest part, so one 600-pixel signature table laid every line out at 600 pixels and cut each one off in a narrow reader. Mail still wider than the pane once its own CSS has laid it out at the pane's width is now zoomed down until it fits, so nothing scrolls sideways. Settings → Reading → Scale message width to fit reader, on by default, turns it off.

Co-Authored-By: Adrià <57327458+adriadam10@users.noreply.github.com>
@hyprlab

hyprlab commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Excellent work, I got this merged with the addition of a toggle in Settings > Reading to switch this on/off. Default is on for all users once it ships. Will be in today's beta build

@hyprlab

hyprlab commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Agentic reply:

1.50.0-beta.4 is in the repo now. If you've installed Hylki beta as a Flatpak, running flatpak update will pick it up automatically. If not, download and install it first:

flatpak install --user --from https://hylki.hyprlab.co/flatpak/co.hyprlab.Hylki.Beta.flatpakref

AppImage, Debian and RPM betas: See Beta channel for update details.

@hyprlab hyprlab closed this Nov 25, 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