镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Inbox: a text size setting (12–15, default 14) - #1990

Merged
backnotprop merged 2 commits into
mainfrom
inbox-text-size-setting
Oct 19, 2026
Merged

backnotprop merged 2 commits into
mainfrom
inbox-text-size-setting

Conversation

@backnotprop

Copy link
Copy Markdown
Owner

The owner asked for "a setting where I can just set it, it's default 14, but I could also go to 13 or 15 or even 12 ... then we'll figure out what the right default is, but I have to be able to test it."

What it does

  • Settings → General → Appearance → Text size: a 12 / 13 / 14 / 15 segmented control, in the Theme control's style. A change applies at once, with no reload.
  • The whole Inbox type ramp scales from the body size: list rows, subjects, the sidebar, message bodies, question cards, Settings, and the small labels (timestamps, chips, badges). The relative steps stay the same. No size goes under 11 px. A size that is already under 11 px never goes under its own size.
  • Phone controls stay at 16 px or more, so iOS does not zoom. ui's drawing inside the Inbox follows the setting where it already followed the Inbox base size (Tailwind --text-sm … --text-5xl, the ib-type layer, code blocks). It now also follows through --text-xs, with an 11 px floor.
  • 14 draws exactly today's Inbox. At 14, a headless screenshot of the list and an open thread (1440×900, light) is byte-identical to the same screenshot from origin/main (cmp).

How

  • The --ib-soft-type switch is replaced by the setting. inbox.css reads --ib-type: var(--inbox-text-size, 14). The page sets --inbox-text-size on the document element, and removes it at 14.
  • Every font-size in inbox.css now goes through var(--ib-fs-N, Npx), with --ib-fs-N = max(min(N, 11) px, N px × --ib-type / 14). This includes the 9 to 12 px sizes that were bare before. Phone 16 px controls use --ib-fs-16-in = max(16px, …).
  • The size is kept in config.json as inboxTextSize through POST /api/inbox/settings { text_size }, and GET returns it as text_size. It is validated (12 to 15; anything else returns 422 validation_error) and goes through the same same-origin and serverSession guards as the other settings. A refused part saves nothing.
  • On load the page takes the saved size from its first settings read, the same way it takes the theme, unless the size was already picked on this page. A cookie keeps the last size this browser showed, so a reload paints at that size before the read returns.
  • The phone's door is unchanged, because settings are not on it.

Tests

  • packages/server/inbox.test.ts: the default, refused values (11, 16, 13.5, "13", null, …), refusal of another site, the stale-tab guard, and saving and reading back each size.
  • packages/inbox/textSize.test.tsx (DOM, in the test.yml list): runs the whole window over a real Inbox. Picking 12, then 15, then 14 in Settings changes a list row subject and a message body by the expected ratio. 14 returns exactly the default sizes. The size in config.json is the size the window opens at.
  • packages/inbox/softType.test.ts: fails if a font-size is bare, if a token's fallback differs from its own size, or if a token lacks its floor. It also checks the sizes each token gives at 12, 13, 14 and 15.
  • tests/e2e/inbox-soft-polish.spec.ts: the type check now runs at 13 (no text under 11 px, nothing grows) and at 15 (nothing shrinks).

Screenshots

These are local files on the machine that built this, not attached to the PR. All are light, 1440×900, headless Chromium:

  • /tmp/text-size-shots/list-thread-{12,13,14,15}.png
  • /tmp/text-size-shots/settings-{12..15}.png
  • /tmp/text-size-shots/settings-row-{12..15}.png
  • /tmp/text-size-shots/main-14-today.png (byte-identical to list-thread-14.png)

@backnotprop
backnotprop merged commit 4507cdc into main Oct 19, 2026
32 checks passed
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.

1 participant