Repository navigation
Description
Context
Every kit and app font size is a fixed pixel value, so the app ignores Android's system text size:
- Kit components: 255 inline
font:shorthands with a px size across 66 files underpackages/ui-kit/src(245 literal, 10 computed, such as${Number(p.titleSize) || 18}px). There are 16 distinct sizes from 8px to 24px. The most common are 10, 11, 9.5, 10.5 and 9px. There is no type-scale token:fontinpackages/ui-kit/src/tokens.ts:1275holds families only. - Kit stylesheet: 31 px font declarations and no
reminpackages/ui-kit/src/tokens.css. One example is.bk-askform .bk-field textarea's13pxat:2255. - App: 174
text-[Npx]classes in 55 files underpackages/ui-react/src(88 ×11px, 61 ×10px). Plus 10 pxfont:shorthands and 8 numericfontSizevalues. - App prose: only the markdown prose in
packages/ui-react/src/theme.css(:166-383) usesrem/em. - Pixel geometry derived from font size:
- The composer's cap is
CEILING = 96px fromFONT_SIZE = 13.5(FONT_SIZE,packages/ui-kit/src/chrome/Composer.tsx:163-166). - The voice strip's rows are fixed at 44/52px (
packages/ui-react/src/components/voice/conversation-strip.tsx:40,:60). - The breakpoints are px (
--breakpoint-tablet,packages/ui-react/src/theme.css:25-28).
- The composer's cap is
Chrome for Android 146 scales 1rem with the OS text size when the page opts in with <meta name="text-scale" content="scale">. Samsung Internet (Chromium 143) and Firefox do not support the meta (MDN browser-compat-data). There, the page renders at the default size and pinch zoom still works. The host owns index.html, so the meta itself is schlessera/brain-hosting-template#34. It lands last, after the migration follow-ups this issue files have shipped and been verified, not merely after this issue closes.
Guide accessibility/respect-os-text-scale:
- "Define font sizes using relative units (
remorem) rather than fixed pixels (px)." - "Do not set a custom font size on
:rootorhtml." - "Responsive breakpoints MUST NOT assume that text will remain at its default size."
- "Test that text can be resized to at least 200% of its default size without loss of content or functionality."
Before this issue, no decision record covered type units. Neither design-kit.md nor its subjects state a unit rule; the px sizes come from the design drop as implemented.
Accepted type policy (maintainer, 2026-10-22)
The maintainer ruling accepts root-relative named type tokens without setting html/:root font-size. Exemptions are SVG/canvas-coordinate text (diagrams, maps, Graph labels), print pt and icons. Mono meta and badge digits scale; badge geometry uses em. The supplied decision note and mocks stand except that phone tab labels hide above 125% rather than being capped: use the ruled CSS em/container-query approach, no JS measurement, retain accessible names/active amber state and at least 44px targets.
Land exact-value aliases first with unchanged 100% baselines, then consolidate the 16 sizes to the approved nine steps as one reviewed stage-2 baseline update. Text-coupled fixed heights become min-height/lh; the composer ceiling becomes line-count-based and conversation rows grow. Breakpoints become 30/56.25/80/90em only after the Chrome146 text-scaling/media-query check; if that check fails, use app-root container queries at the same thresholds. Host text-scale opt-in lands last through brain-hosting-template#34.
The remaining deliverable here is the durable decision and scoped follow-up briefs, not migration code. Include the ruling’s eight-step landing order: record; exact-value tokens/lint; kit styles/geometry; app sizes/tab labels; verified responsive-query approach; 200%/320px real-browser checks; nine-step consolidation; host opt-in last. Each implementation follow-up assesses supported numeric props under the existing contract rules before changing them. No prior policy or design acceptance remains outstanding.
Scope
The policy is accepted; this issue records it and prepares the implementation. It produces:
- The design-kit decision entry: type units, exemptions, breakpoint units and the eight-step landing order above.
- The type scale as tokens, with each existing px size mapped to a scale step, as a table in the decision.
- Follow-up implementation issues, one per landing step that carries code (exact-value tokens and lint; kit styles and geometry; app sizes and tab labels; the verified responsive-query approach; the 200%/320px real-browser checks; the nine-step consolidation), each with its own acceptance criteria, attached to Epic: layout and type adapt to the phone's viewport, keyboard and text size #2596. The host opt-in stays shell: declare theme colour per scheme and OS text scale in the app HTML brain-hosting-template#34, blocked by the follow-ups that complete the migration and its verification.
Delivery of the policy is gated on those implementation issues, not on closing this one.
Out of scope
- Writing the migration code.
- Host markup, which is shell: declare theme colour per scheme and OS text scale in the app HTML brain-hosting-template#34.
- Spacing that is not coupled to text.
- Touch-target sizes, which stay 44px minimum.
- Firefox or Samsung text scaling, which is not available to a page.
Acceptance criteria
- The maintainer accepted the type policy, exemptions, icon-only tab threshold, stage-2 consolidation and verified breakpoint/fallback approach.
- A design-kit decision entry is merged with the unit rule, the exemption list, the size-to-step table and the landing order.
- The follow-up implementation issues are filed and attached to Epic: layout and type adapt to the phone's viewport, keyboard and text size #2596. Each names a real-browser check at 200% root size and at 320px width, and assesses supported numeric props under the contract rules before changing them.
- The follow-up briefs retain the Chrome 146 query check and its explicit container-query fallback.
- shell: declare theme colour per scheme and OS text scale in the app HTML brain-hosting-template#34's text-scale blocker names the follow-up(s) that complete the migration and the 200%/320px verification, replacing its blocker on this issue.
Verification
# Evidence for the design, run against the current tree:
grep -rhoE 'font: `[0-9]{3} [0-9.]+px' --include='*.tsx' packages/ui-kit/src | wc -l
grep -rhoE 'text-\[[0-9.]+px\]' packages/ui-react/src | wc -l
grep -oE 'font(-size)?: [^;]*[0-9.]+px' packages/ui-kit/src/tokens.css | wc -l
bun scripts/check-leakage.tsContract impact
- This touches the integration contract, so it needs the
contractlabel, aCONTRACT:commit prefix, and the doc updated in the same commit. - This changes a published package's behaviour, so it needs a changeset.
None: this issue produces a decision and follow-up issues. The follow-ups carry the changesets.
2026-10-24: retitled and retyped as documentation (type: docs): the policy is accepted, so this issue records it and files implementation briefs rather than deciding whether to adopt it. Made the implementation issues, not this issue's closure, the delivery gate (including for the host opt-in), and removed the superseded 2026-10-22 readiness notes (they are in the comments).
Activity
schlessera commentedon Oct 22, 2026
Design needed: the kit's type scale under a user's text-size setting.
What is settled: every font size today is a fixed pixel literal, and Chrome for Android can scale
remwith the OS setting once the host opts in. What is left is a judgement about type and layout. Which text scales and which does not? What scale do the 16 ad-hoc sizes collapse into? How do fixed-height components behave at twice the size? The code cannot settle this, because a mechanicalpx→remswap scales text that should stay fixed, and it breaks rows sized to one line. The maintainer's ruling on the "Decision needed" section comes first. This prompt is for the design work after a "yes", or for the evidence behind a "no".schlessera commentedon Oct 22, 2026
2026-10-22 triage at main
aa8c8966b59f031f054f4876dbca84048b40ae4f: classify the deliverable as type: spike: it produces a type-unit decision/design and follow-up briefs, explicitly excluding migration code. Remove needs: design as an input prerequisite because the spike produces that design; retain needs: decision for the explicitly required prior maintainer policy choice and keep agent-ready absent. The existing prompt remains an investigation input, not an approved design; no text-scaling policy is selected.schlessera commentedon Oct 22, 2026
Design brief: type under the phone's text-size setting (1/2: the decision note)
Recommendation: yes.
remequals today's px, so the migration lands with byte-identical baselines.A "no" is defensible: pinch zoom works everywhere and the migration touches about 470 call sites. It loses because pinch zoom on a chat app means panning sideways on every line, and that is the "loss of content or functionality" the 200 % rule is about.
Draft decision entry
1. What scales and what stays fixed
em)min(step, 1.25 × px)2. The type scale
There are 16 sizes today and 9 steps in the target. Stage 1 maps every size to a token with exactly its current value, so there is no visual change. Stage 2 repoints the aliases at their step (the "merges" column), as one deliberate baseline update.
meta(alias 0.5rem)metameta(alias 0.59375rem)captioncaption(alias 0.65625rem)labellabel(alias 0.71875rem)smallsmall(alias 0.78125rem)body(alias 0.8125rem)bodybody(alias 0.875rem)leadtitleheadingdisplayTokens live beside
fontintokens.tsastype.*and as--bk-type-*intokens.css. The 10 computed sizes, such as${p.titleSize || 18}px, take a step name instead of a number.3. Fixed-height components at 200 %
heightmin-height: 44px/52px. The label wraps to at most 2 lines, then ellipsis. The full name stays in the accessible name and the transcript.CEILING = 96fromFONT_SIZE = 13.5)N lh), capped atmin(N lh, 35dvh), so at 200 % with the keyboard up the transcript keeps most of the screen.max-heightinlh. While composing: one row,min-height: 44px. The title truncates with ellipsis; the full title is in Sessions.min-height. Labels capped at 125 % (above).heightmin-height). Subtitles wrap.Nothing meaning-bearing clips. Truncation only happens where the full text is one tap away.
4. Breakpoints: move to
em--breakpoint-*(480)--breakpoint-*(900)--breakpoint-*(1280)--breakpoint-*(1440)At 100 % these are identical. At 200 % a 900 px-wide tablet is 28em, so it gets the phone layout: the bottom bar and stacked panels, which is what large text needs.
Check first (follow-up 4): confirm that Chrome 146 evaluates
emmedia queries against the scaled initial size undertext-scale. If it does not, the shell switches layout on a container query of the app root instead. The rule stays the same.5. Order of work: kit and app can migrate independently
At 100 %,
remequals px, so a half-migrated tree renders identically. Mixed sizes can only appear once text is scaled, and that only happens after the host meta. So the gate is the meta, not the packages: brain-hosting-template#34 lands last, after the 200 % checks pass on both packages.Follow-up issues, in landing order
font:shorthands and the 31tokens.cssrules to tokens. Fixed heights move tomin-height/lh. ComposerCEILINGbecomesN lh. Baselines identical.text-[Npx], the 10 shorthands and the 8fontSizevalues. Conversation strip rows tomin-height. Tab label cap. Baselines identical.em, with the Chrome 146 media-query check above. Baselines identical.remthe way the OS setting does:<meta name="text-scale" content="scale">.Mocks follow in the next comment.
For the maintainer
schlessera commentedon Oct 22, 2026
Design brief: type under the phone's text-size setting (2/2: mocks)
How to read these:
w o r d.Chat: 320 px
At 200 % the transcript scrolls under the card. The page never scrolls sideways.
Chat: 390 px
Settings: 320 px
Settings: 390 px
What the 200 % mocks show
schlessera commentedon Oct 22, 2026
2026-10-22 concurrent-state reconciliation: the design note and mocks arrived after the earlier spike classification. Linked the supplied proposals and exact remaining choices into the current specification; preserve the concurrently restored type: feat and needs: decision. The earlier classification note is historical. No proposal is adopted and no migration or follow-up filing is authorized by this triage.
schlessera commentedon Oct 22, 2026
Maintainer ruling
remthrough a named type token, and nothing setsfont-sizeon:root/html. The exemptions are text placed in SVG or canvas coordinates (diagrams, maps, Graph labels), the print theme (pt), and icons. Everything else scales, including mono meta and badge digits (whose discs are sized inem).1rem > 20px(125 % of 16 px). Use a container or media query inem; JS measurement is not allowed. Tab targets stay ≥ 44 px.em(30 / 56.25 / 80 / 90em). First, check that Chrome 146 evaluatesemmedia queries against the text-scaled size. If it does not, the fallback is container queries on the app root, with the same thresholds.The rest of the brief stands: the fixed-height rules, the order of work (the host meta lands last), and the 200 % / 320 px checks. Brief: #2603 (comment) · Mocks: #2603 (comment)
Updated tab-bar row (replaces the one in the brief)
min-heightstays at the 44 px floor. The badge disc scales inem.Follow-ups to file (landing order)
embreakpoints, and the tab-label rule above.font:shorthands and thetokens.cssrules. Fixed heights move tomin-height/lh. The composerCEILINGbecomes a line count. Baselines identical.text-[Npx], shorthand andfontSizesizes. Conversation strip rows grow. Tab labels hide above 125 %. Baselines identical.em, after the Chrome 146 media-query check (fallback: container queries).text-scalemeta, last.schlessera commentedon Oct 22, 2026
2026-10-22 readiness reconciliation: folded the maintainer ruling into the body, replacing the unresolved-choice specification and aligning scope/criteria with the accepted branch. The remaining work is explicitly scoped; add agent-ready. Preserve priority, native parent, assignment and release attribution. This is issue preparation, not implementation, runtime proof or delivery.
[-]ui-kit: decide whether type scales with the phone's text-size setting[/-][+]ui-kit: record the accepted OS text-scale type policy and file its implementation briefs[/+]