Skip to content

Make the daily mail readable on mobile devices - #144

Draft
tricknotes wants to merge 1 commit into
mainfrom
make-daily-mail-readable-on-mobile
Draft

tricknotes wants to merge 1 commit into
mainfrom
make-daily-mail-readable-on-mobile

Conversation

@tricknotes

Copy link
Copy Markdown
Owner

Closes #17

Problem

The HTML part of MyHotRepository#notify reused the web app's application.css and normalize.css, and Roadie inlined rules that are meant for browsers:

Change

  • Add a mail-only stylesheet app/assets/stylesheets/mailer.css: a fluid max-width: 650px container, no min-width, no floats, plain px/hex values, no custom properties, calc() or @font-face. Long repository names wrap with word-break: break-all.
  • Rewrite notify.html.haml as a full document with a viewport meta and a .mail wrapper. The stargazer avatars now sit on their own line under the repository name.
  • The web app's application.css is untouched apart from its header comment; web styling and mail styling no longer affect each other.
  • Add a spec on the delivered (Roadie-inlined) HTML part: it must contain the viewport meta and max-width:650px, and must not contain min-width, float:, var(, calc( or @font-face. Both new examples fail on main and pass here.

Verification

  • Full suite: 85 examples, 0 failures.
  • Rendered the delivered mail in Chromium with mobile emulation (375px, iPhone-class): layout width goes from 981px (zoomed out) to 375px. Avatars are placeholders in the screenshots because github.com images were not reachable from the sandbox.
before, 375px after, 375px
layout width 981px, zoomed out layout width 375px

Notes

🤖 Generated with Claude Code

https://claude.ai/code/session_0167LtQxWaHUwAyFb1seN2de


Generated by Claude Code

The HTML mail reused the web app's stylesheet, so Roadie inlined rules
meant for browsers: `min-width: 550px` and `overflow-x: hidden` on <html>,
floats for the stargazer avatars, and font sizes expressed through CSS
custom properties and calc(). On a phone the mail was laid out at the
desktop width and either zoomed out or cut off on the right, and Gmail
drops every declaration that uses var() or calc().

Give the mail its own stylesheet with a fluid `max-width: 650px` container,
no floats, and plain px/hex values, and declare a viewport so mobile
clients lay it out at the device width. The stargazer avatars now sit on
their own line below the repository name, and long repository names wrap.

Closes #17

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0167LtQxWaHUwAyFb1seN2de
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