|
| 1 | +--- |
| 2 | +title: "Chat-as-base type scale: re-anchoring the timeline type ramp" |
| 3 | +tags: [desktop, typography, design-tokens, tailwind, zoom] |
| 4 | +status: active |
| 5 | +created: 2026-06-15 |
| 6 | +--- |
| 7 | + |
| 8 | +# Chat-as-base type scale |
| 9 | + |
| 10 | +## Why this exists |
| 11 | +tho's reframe (2026-06-15): **chat text *is* the base size** — the fundamental |
| 12 | +building block of the app. It should not be a special between-the-cracks token |
| 13 | +(`text-chat` = 15px, wedged between Tailwind's `text-sm` 14px and `text-base` |
| 14 | +16px). Direction: **bump chat to 16px and make it the base**, then re-anchor the |
| 15 | +*other* timeline/thread elements that currently sit relative to the old ~15px |
| 16 | +chat assumption. This is a **deliberate, wider pass** — a design decision, not a |
| 17 | +surgical bugfix. |
| 18 | + |
| 19 | +Builds on the zoom-regression work (PR #1051, branch `tho/rem-font-zoom-fix`) |
| 20 | +which introduced the `text-chat`/`text-code` rem tokens. That fix preserved |
| 21 | +Kenny's 15px intent; this pass *changes* that intent to 16px-as-base. |
| 22 | + |
| 23 | +## Non-negotiables (carry forward from the zoom fix) |
| 24 | +- **Everything stays rem.** Cmd +/- zoom scales the root `<html>` font-size |
| 25 | + (rem-only by design, from #573). px would freeze against zoom — that was the |
| 26 | + original bug. The `check:px-text` guard already enforces this; keep it happy. |
| 27 | +- No `html { font-size }` override exists, so root is browser-default 16px and |
| 28 | + rem math is standard (1rem = 16px). The `--font-size: 14px` var in globals.css |
| 29 | + is scoped to the emoji-picker component, NOT the app root. |
| 30 | + |
| 31 | +## Current type landscape (timeline/thread render path) |
| 32 | +`text-chat` (15px) is used in: |
| 33 | +- `MessageRow.tsx` — markdown body wrapper, author name (`<span>` and `<h3>`) |
| 34 | +- `markdown.tsx` — chat body wrapper |
| 35 | +- `mentionChip.ts` — mention chip text |
| 36 | +- (`text-code` 13px — inline/block code in `markdown.tsx`) |
| 37 | +- `globals.css` `.mention-highlight` — 0.9375rem |
| 38 | + |
| 39 | +Satellite elements currently on the **stock** scale (these are the "other |
| 40 | +elements that sit relative to chat" tho means — review each for whether it still |
| 41 | +reads right once chat = 16px base): |
| 42 | +- `MessageTimestamp.tsx` — text-xs |
| 43 | +- `SystemMessageRow.tsx` — text-xs / text-sm |
| 44 | +- `MessageThreadSummaryRow.tsx` — text-xs |
| 45 | +- `MessageThreadPanel.tsx` — text-sm / text-xs |
| 46 | +- `MessageReactions.tsx` — text-xs / text-sm |
| 47 | +- `MessageActionBar.tsx` — text-xs |
| 48 | +- `TypingIndicatorRow.tsx` — text-xs / text-sm |
| 49 | +- `MessageTimeline.tsx` — text-base / text-sm / text-xl (empty states / headers) |
| 50 | +- `MessageRow.tsx` (secondary bits) — text-sm / text-xs |
| 51 | + |
| 52 | +## The design question for the build |
| 53 | +If chat === base (16px), the type ramp around it should be *intentional*, not |
| 54 | +incidental. The relationships that matter: |
| 55 | +- chat body / author = base (16px) |
| 56 | +- timestamps, metadata, system rows, reactions = one or two steps down, |
| 57 | + consistently (don't leave them as ad-hoc text-xs/text-sm if the ratio now |
| 58 | + looks off against a 16px anchor) |
| 59 | +- code = its own deliberate step down from chat |
| 60 | + |
| 61 | +Open for Bart to decide the cleanest expression: lean on stock Tailwind tokens |
| 62 | +where they land right now that base is the anchor, retire/rename `text-chat` if |
| 63 | +it's redundant with `text-base`, and only define custom rem tokens where the |
| 64 | +stock scale genuinely can't express the intended step. |
| 65 | + |
| 66 | +## Out of scope |
| 67 | +- App-wide px sweep (the ~130 px classes elsewhere). Stay in the |
| 68 | + timeline/thread render path + the type tokens that serve it. |
| 69 | +- Don't widen the `check:px-text` guard roots in this pass (Marge's noted |
| 70 | + follow-up) unless a new render-path file demands it. |
| 71 | + |
| 72 | +## Decision (built) |
| 73 | +Chat === `text-base` (16px, stock). Both custom tokens **retired** — `text-chat` |
| 74 | +and `text-code` were artifacts of the 15px-wedge era; with chat at the stock |
| 75 | +base they're redundant. Code (inline + block) re-anchored to stock `text-sm` |
| 76 | +(14px) — a deliberate, documented one-notch step down from the 16px base. |
| 77 | + |
| 78 | +Satellites left on their stock tokens **deliberately**: against a 16px base the |
| 79 | +ratios actually tighten into the standard ramp (e.g. timestamps `text-xs` 12px = |
| 80 | +clean base→sm→xs drop, was the awkward 12/15 before). Bumping them would inflate |
| 81 | +the UI for no design gain — the right call is to keep them and document why. |
| 82 | + |
| 83 | +Net: zero custom font tokens. `.mention-highlight` (composer) follows chat to |
| 84 | +`1rem` (16px). Everything rem, guard stays green. |
0 commit comments