Type, icons and panes follow the reader's text size (#351), on train k #443

Closed
kayg wants to merge 0 commits from issue/351-rem-3 into dev
Owner

Closes #351. Replaces #432 (and #413), rebuilt on train/2026-10-15k so it merges cleanly after train k.

Merge onto train k: the conflicts were with #401 (contrast tokens and empty states) in apps/web NoteList, Palette and TrashList, and in the mockup's NoteList, TrashList and search/Search. #401's versions are kept: its shared ListFilter and EmptyState and its contrast colours. On top of them:

  • their px font sizes now count in --type-px;
  • the filter's height grows with the text (max(44px, …) on phones);
  • the empty state's icon circle grows with --icon-grow, and its button uses min-height.

Type now follows the reader's text size: the browser's font size, Android's font scale, and iOS Text Size / Larger Text. At the usual size it looks exactly as before. The research, screenshots and before/after pixel diff are on #351.

How

  • Every font size counts in --type-px (tokens.css), which is 0.0625rem: 1 px at the usual size, 2 px at 200%. The type tokens keep their names, and the ~285 stray px sizes in apps/web/src, packages/ui/src and apps/mockup became a token or calc(N * var(--type-px)).
  • html { font-size: 100% }, text-size-adjust: 100%, and <meta name="text-scale" content="scale"> (Android font scale in Chrome).
  • iOS only (@supports (-webkit-touch-callout: none) and (font: -apple-system-body)): html { font: -apple-system-body } and --type-px: max(1px, 1rem / 17). Exactly 1 px at the usual setting, so nothing changes there. It grows with Larger Text, including in the installed app, which has no Safari aA menu. It never shrinks, so text fields stay at 16 px or more and iOS doesn't zoom when one takes focus. Macs are left alone.
  • Pills, bar rows, the Insert search and Settings rows use min-height. The note list's rows and date headers grow in type-px, and the virtual list's row height follows them through textSize.px.
  • packages/ui/src/lib/text-size.svelte.ts: one hidden probe with a ResizeObserver, so it only fires when the text size changes, never per frame. It sets data-text="large" from about 120%. With large text the phone bar keeps two lines at every width, swatches become rows, Insert shows fewer tiles a row, theme segments break between words, and keyboard keys go under their names. The usual size keeps #373's rules: one row at 375 px and up, two lines at 320/360.
  • Titles grow up to 13vw on phones, so "Wednesday," no longer breaks in the middle of the word.

Round 2 (review on #413)

  • Icons are sized from --icon-px (tokens.css), which follows the text up to 1.5× so a phone's row of 44 px targets still fits 320 px. Icon.svelte sizes itself from it. Icon buttons, bar tabs and the Insert glyph boxes add --icon-grow, which is 0 at the usual size.
  • To-do checkboxes, the list marker box and the tree-line geometry for tasks grow with the icons.
  • The sidebar and list (Shell) and Settings' sections column widen with the text, up to 1.4× and at most 360, 520 and 336 px. Remembered widths are still stored at the usual size, and dragging divides by the factor.
  • Sign-in: the card widens (up to 560 px) and keeps its fields inside it.
  • Style: the slider value columns fit their words, and fonts show two to a row at large text.
  • Info: section hints wrap under their label, and version rows put who and when on a second line.
  • The search palette needed nothing.

Tests (on this branch, train k + #351)

  • chromium-390:
    • text-size and bar-*: 31 passed.
    • phone-*: 399 passed.
  • webkit-390:
    • text-size and bar-rest/stays/stable/taps: 29 passed.
    • phone-targets, phone-edges and bar-focus: 161 passed.
    • phone-bars: 240 passed.
  • Typecheck: 0 errors.
  • Earlier rounds (on #413 and #432): chromium-1440, prefs, ui primitives and mockup checks; at the usual size, 34 screens pixel-identical to dev. The 200% shots are on #351.

🤖 Generated with Claude Code

https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T

Closes #351. Replaces #432 (and #413), rebuilt on `train/2026-10-15k` so it merges cleanly after train k. **Merge onto train k:** the conflicts were with #401 (contrast tokens and empty states) in apps/web NoteList, Palette and TrashList, and in the mockup's NoteList, TrashList and search/Search. #401's versions are kept: its shared `ListFilter` and `EmptyState` and its contrast colours. On top of them: - their px font sizes now count in `--type-px`; - the filter's height grows with the text (`max(44px, …)` on phones); - the empty state's icon circle grows with `--icon-grow`, and its button uses min-height. Type now follows the reader's text size: the browser's font size, Android's font scale, and iOS Text Size / Larger Text. At the usual size it looks exactly as before. The research, screenshots and before/after pixel diff are on #351. **How** - Every font size counts in `--type-px` (tokens.css), which is `0.0625rem`: 1 px at the usual size, 2 px at 200%. The type tokens keep their names, and the ~285 stray px sizes in `apps/web/src`, `packages/ui/src` and `apps/mockup` became a token or `calc(N * var(--type-px))`. - `html { font-size: 100% }`, `text-size-adjust: 100%`, and `<meta name="text-scale" content="scale">` (Android font scale in Chrome). - iOS only (`@supports (-webkit-touch-callout: none) and (font: -apple-system-body)`): `html { font: -apple-system-body }` and `--type-px: max(1px, 1rem / 17)`. Exactly 1 px at the usual setting, so nothing changes there. It grows with Larger Text, including in the installed app, which has no Safari aA menu. It never shrinks, so text fields stay at 16 px or more and iOS doesn't zoom when one takes focus. Macs are left alone. - Pills, bar rows, the Insert search and Settings rows use min-height. The note list's rows and date headers grow in type-px, and the virtual list's row height follows them through `textSize.px`. - `packages/ui/src/lib/text-size.svelte.ts`: one hidden probe with a ResizeObserver, so it only fires when the text size changes, never per frame. It sets `data-text="large"` from about 120%. With large text the phone bar keeps two lines at every width, swatches become rows, Insert shows fewer tiles a row, theme segments break between words, and keyboard keys go under their names. The usual size keeps #373's rules: one row at 375 px and up, two lines at 320/360. - Titles grow up to 13vw on phones, so "Wednesday," no longer breaks in the middle of the word. **Round 2 (review on #413)** - Icons are sized from `--icon-px` (tokens.css), which follows the text up to 1.5× so a phone's row of 44 px targets still fits 320 px. `Icon.svelte` sizes itself from it. Icon buttons, bar tabs and the Insert glyph boxes add `--icon-grow`, which is 0 at the usual size. - To-do checkboxes, the list marker box and the tree-line geometry for tasks grow with the icons. - The sidebar and list (Shell) and Settings' sections column widen with the text, up to 1.4× and at most 360, 520 and 336 px. Remembered widths are still stored at the usual size, and dragging divides by the factor. - Sign-in: the card widens (up to 560 px) and keeps its fields inside it. - Style: the slider value columns fit their words, and fonts show two to a row at large text. - Info: section hints wrap under their label, and version rows put who and when on a second line. - The search palette needed nothing. **Tests (on this branch, train k + #351)** - chromium-390: - text-size and bar-*: 31 passed. - phone-*: 399 passed. - webkit-390: - text-size and bar-rest/stays/stable/taps: 29 passed. - phone-targets, phone-edges and bar-focus: 161 passed. - phone-bars: 240 passed. - Typecheck: 0 errors. - Earlier rounds (on #413 and #432): chromium-1440, prefs, ui primitives and mockup checks; at the usual size, 34 screens pixel-identical to `dev`. The 200% shots are on #351. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Type follows the reader's text size (#351)
Some checks failed
CI / server (pull_request) Successful in 30s
CI / rust (pull_request) Successful in 2m5s
CI / web (pull_request) Failing after 43m56s
84224f6e90
Every font size is counted in --type-px (1/16 of the root size) instead of px: the type tokens and
the ~285 stray sizes in apps/web, packages/ui and apps/mockup. The root is the browser's own size
(html { font-size: 100% }), Android's font scale (meta text-scale), and on iPhone/iPad the system
text size via `font: -apple-system-body`, scaled so the usual setting is pixel-identical.

Pills, bars, list rows and fields grow with their words (min-height, or heights in type-px). From
about 120% (data-text="large", lib/text-size: one ResizeObserver on a probe, never per frame) the
phone bar keeps two lines, swatches become rows, Insert takes fewer tiles a row, theme segments
wrap, keyboard keys go under their names. Titles stop growing at 13vw so long words fit.

New e2e/text-size.spec.ts checks the usual size is unchanged and that nothing is cut off or
sideways at 200% on 320/390/1440.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Icons, checkboxes and panes grow with the text too (#351)
Some checks failed
CI / server (pull_request) Successful in 25s
CI / rust (pull_request) Successful in 1m53s
CI / web (pull_request) Failing after 43m0s
acbb5e899c
Icons size from --icon-px (the type pixel, up to 1.5x, so a phone's row of icon buttons still
fits 320 px); icon buttons, bar tabs and Insert glyph boxes add --icon-grow (0 at the usual
size). To-do checkboxes and the list marker box grow with them, tree lines included.

The sidebar and list (and Settings' sections column) widen with larger text, up to 1.4x and
360/520 px. Sign-in's card widens and keeps its fields inside it; Style's sliders and fonts,
Info's section hints and version rows rearrange at large text instead of squeezing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Merge #351 (text size) onto train 2026-10-15k
Some checks failed
CI / server (pull_request) Successful in 22s
CI / rust (pull_request) Successful in 1m56s
CI / web (pull_request) Failing after 40m59s
2411503898
Conflicts with #401: kept its shared ListFilter and EmptyState and its contrast colours. The
type-px sizes now apply to them, and the filter and empty-state heights grow with the text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Author
Owner

Landed in dev via train o.

Landed in dev via train o.
kayg closed this pull request 2026-10-15 22:39:19 +00:00
Some checks failed
CI / server (pull_request) Successful in 22s
CI / rust (pull_request) Successful in 1m56s
CI / web (pull_request) Failing after 40m59s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!443
No description provided.