Skip to content

Consolidate dashboard font sizes onto a three-step type scale - #156

Merged
0101 merged 2 commits into
mainfrom
ui-design-typography
Jul 29, 2026
Merged

Consolidate dashboard font sizes onto a three-step type scale#156
0101 merged 2 commits into
mainfrom
ui-design-typography

Conversation

@0101

@0101 0101 commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Problem

The dashboard CSS in src/Client/index.html had accumulated roughly 25 distinct font sizes with no shared vocabulary:

  • Relative em values (0.7em, 0.75em, 0.78em, 0.8em, 0.82em, 0.85em, 0.88em, 0.9em, 0.95em, 1.05em) that compound through nesting — a 0.82em badge inside a 0.9em row renders at neither size.
  • Hard-coded pixels (10px, 10.5px, 11px, 11.5px, 12.5px, 15px) that were immune to any global adjustment.
  • No base font-size on body, so everything was relative to the UA default (16px), and form controls silently fell back to 13.333px Arial.

The result: sizes that drifted apart for no design reason, and no answer to "what size should this new component be?"

Changes

Introduce a three-step type scale as CSS custom properties on :root and map every rule onto it:

Token Size Use
--fs-sm 11px Metadata, labels, badges, chart legends, tooltips
--fs-base 13px Default body text, rows, buttons, event log
--fs-lg 15px Branch names, repo names, prominent controls
  • body now sets font-size: var(--fs-base), so the scale has a real anchor instead of the UA default.
  • Added an explicit button, input, select, textarea { font-size: var(--fs-base); } rule — form controls do not inherit font-size, so without it they revert to the browser default font.
  • All em-based sizes replaced with tokens, removing the compounding problem entirely.
  • All hard-coded pixel sizes replaced with tokens, except .history-charts .axis-label, which is SVG text inside a fixed 760x170 viewBox. Its size is in user units that scale with the chart, not screen pixels, so it is deliberately not a scale token. A comment documents this.
  • Font weights normalised alongside the sizes to a small consistent set (400 / 600), replacing scattered 500 / 700 values.
  • Small fixes surfaced by the audit: compact cards now get --fs-sm for .main-behind, and .nav-hint kbd drops its redundant nested 0.9em.

Pure CSS change — no F# or behaviour changes.

Tests

No test changes. The diff touches only <style> content in src/Client/index.html; existing E2E tests assert on CSS classes and DOM structure, which are unchanged.

Dashboard CSS used ~25 distinct font sizes, mixing relative `em` values
that compounded through nesting with hard-coded pixel values. Sizes drifted
apart with no shared vocabulary, so every new component picked an arbitrary
value.

Introduce `--fs-sm` (11px), `--fs-base` (13px) and `--fs-lg` (15px) on
`:root`, set `font-size: var(--fs-base)` on `body`, and map every rule in
`src/Client/index.html` onto one of the three tokens. Form controls get an
explicit rule because they do not inherit `font-size` from `body`. SVG axis
labels keep their user-unit size, since they scale with the chart viewBox
rather than the screen. Font weights are normalised alongside to the same
small set.
Copilot AI review requested due to automatic review settings July 29, 2026 10:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Consolidates dashboard typography into shared CSS tokens.

Changes:

  • Adds small, base, and large font-size tokens.
  • Applies tokens across dashboard components and form controls.
  • Documents the SVG axis-label exception.
Show a summary per file
File Description
src/Client/index.html Defines and applies the typography scale.

Review details

Comments suppressed due to low confidence (4)

src/Client/index.html:368

  • This introduces 200, although the PR defines the normalized weight set as only 400/600. Keep this label at normal weight so the CSS and documented scale agree.
        .overview-bd-repo-name { font-size: var(--fs-sm); font-weight: 200; text-transform: uppercase; letter-spacing: 0.6px; color: #6c7086; margin: 0 0 7px; }

src/Client/index.html:907

  • This changes the empty-state text from inherited 400 to 200, contrary to the PR's stated 400/600 normalization. Keep it at 400 unless the documented weight scale is intentionally expanded.
            font-weight: 200;

src/Client/index.html:950

  • This adds a 200 weight outside the PR's documented 400/600 set and changes the title from its previous inherited normal weight. Use 400 to preserve the stated normalization.
            font-weight: 200;

src/Client/index.html:676

  • The new 200 weight falls outside the PR's stated normalized 400/600 set and makes this label lighter than its previous inherited normal weight. Use 400 here.
        .modal-field-label { font-size: var(--fs-base); font-weight: 200; color: #a6adc8; text-transform: uppercase; letter-spacing: 0.04em; }
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Medium

Comment thread src/Client/index.html
@0101
0101 enabled auto-merge (squash) July 29, 2026 11:30
@0101
0101 merged commit bba2b28 into main Jul 29, 2026
1 check passed
0101 added a commit that referenced this pull request Jul 29, 2026
Treemon's mechanical sync conflicted and aborted; resolved by hand.

main added repository-declared diff categories (#155) and consolidated the
dashboard font sizes (#156) while this branch moved the scheduler state slice
into SchedulerState and reshaped worktreeApi's dependencies, so the two collided
on five files:

- WorktreeApi: kept both sides - main's diffCategoryReport helper and this
  branch's WorktreeApiDependencies record. The record already carries
  AutoSyncStore, which main's positional signature did not have.
- CanvasDocServer: took main's resolveDiffTarget (it replaces the older
  getDiffComparisonContext) and retyped it to SchedulerState.StateMsg, dropping
  the stale duplicate resolver body this branch still had.
- DiffEndpointTests: took main's deletion - those helpers now live in the new
  DiffEndpointTestHelpers.fs. This branch's only edits there were the module
  rename, which is reapplied below.
- CanvasDocServerTests: kept main's new repoId binding with this branch's
  SchedulerState.createAgent.
- worktree-monitor.md: kept this branch's GitWorktree/GitBranchSync rows and
  took main's TreemonConfig row, which now names the diffCategories read.

main's new files still referenced RefreshScheduler for the state members this
branch moved, so DiffEndpointTestHelpers.fs, DiffCategoryEndToEndTests.fs and
one WorktreeApi call site were repointed at SchedulerState.

Server, client and tests build clean; fast suite 1878 passed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 80f775f5-e421-45b9-acac-d4f981b3f691
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.

2 participants