Repository navigation
Inbox: a text size setting (12–15, default 14) - #1990
Merged
Merged
Conversation
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
--text-sm…--text-5xl, theib-typelayer, code blocks). It now also follows through--text-xs, with an 11 px floor.origin/main(cmp).How
--ib-soft-typeswitch is replaced by the setting.inbox.cssreads--ib-type: var(--inbox-text-size, 14). The page sets--inbox-text-sizeon the document element, and removes it at 14.font-sizeininbox.cssnow goes throughvar(--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, …).inboxTextSizethroughPOST /api/inbox/settings { text_size }, andGETreturns it astext_size. It is validated (12 to 15; anything else returns422 validation_error) and goes through the same same-origin andserverSessionguards as the other settings. A refused part saves nothing.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 afont-sizeis 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 tolist-thread-14.png)