Skip to content

feat(log-viewer): one type scale and a header that folds when narrow - #928

Merged
lcottercertinia merged 5 commits into
certinia:mainfrom
lukecotter:style-log-viewer-type-scale
Aug 19, 2026
Merged

feat(log-viewer): one type scale and a header that folds when narrow#928
lcottercertinia merged 5 commits into
certinia:mainfrom
lukecotter:style-log-viewer-type-scale

Conversation

@lukecotter

@lukecotter lukecotter commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

What

One type scale and one mono family for the whole webview, replacing hand-written pixel sizes and bare monospace literals — plus a header that folds its items into the ••• menu instead of pushing them off the edge.

Why

Text sizes were set per component, so the same kind of text read at a different size depending on where it sat, and none of it followed the reader's VS Code font size. Code-shaped text picked its family per file.

A narrow panel then made it worse: the header's identity items held their width, so the right-hand controls were pushed off the edge and became unreachable.

How

  • Type scale on VS Code's own ramp, in styles/tokens.css:
    • --lana-text-lg--vscode-bodyFontSize (13px)
    • --lana-text-base--vscode-bodyFontSize-small (12px)
    • --lana-text-sm--vscode-bodyFontSize-xSmall (11px)
    • --lana-text-xs → 0.84 × base (10px)
    • --lana-text-caps + --lana-text-caps-tracking for section headers
  • One mono token--lana-font-monovar(--vscode-editor-font-family, monospace) — carries the only non-VS-Code-host fallback. Applied to the table name columns, group rows, tooltips and code blocks.
  • All-caps runs step one size down: caps reach cap height on every glyph, so at the same nominal size they read larger than the mixed-case text beside them.
  • Canvas text is untouched — a PIXI font string cannot read a CSS variable.
  • Ramp applied app-wide, and .claude/rules/log-viewer.md now states it, so the literals do not come back. FindWidget trades its fixed 33px/25px heights for align-items: center, so it grows with the font. Two literals stay with a note each: the 9px badge count is under the ramp floor, and DataGrid.scss's 14px chevron sizes a glyph box.
  • Header collapse ladder — the header sheds one chunk at a time, right to left, and every shed item reappears in the ••• menu, so no value or control is lost. The title truncates to a 10ch floor first, and the budget counts every active chunk whether inline or folded, so a shed never hands width back and the title cannot grow as the window shrinks. LogTitle owns its floor and exposes floorWidth; NavBar budgets on it.

Notes

  • The grid still sets its cell size from --vscode-editor-font-size, so a large editor font puts grid cells a step above the app base. Left as is — a separate decision.

Testing

  • tsc -b, tsc6 -b, eslint, jest (1775 tests / 131 suites) and the production build all pass.
  • The ladder has 13 tests covering each stage boundary, an absent identity item, a re-measure after a log loads, and the ••• marker.
  • Checked in a dark and a light theme, at several panel widths, and with the editor font size changed.

Merged with main

main tokenised colour and space on many of the same declarations this branch tokenised size on, so
both sides are kept. --lana-text-md, added by that sweep, is gone: its one user (the timeline key)
now reads --lana-text-base, the registered 12px it approximated.

Both branches touched the same declarations: main tokenised colour and space,
this branch tokenised size. Resolutions keep both.
Literal font sizes were still spread across the webview, so a user who
changed their VS Code font size saw only part of the app follow.

Every shadow-DOM and light-DOM style now takes a step from the ramp in
styles/tokens.css, and the rule file states the ramp so the literals do
not come back.

- FindWidget trades fixed 33px/25px heights for align-items: center, so
  the widget grows with the font instead of clipping it.
- Two literals stay, each with a note: the 9px badge count is under the
  ramp floor, and DataGrid.scss's 14px chevron sizes a glyph box.
- Canvas text keeps its numbers: a PIXI font size cannot read a var.
…arrows

A narrow panel pushed the header's right-hand controls off the edge: the
identity chunks held their width and nothing shed.

The header now sheds one chunk at a time, right to left, and each shed
item reappears in the ••• menu, so no value or control is ever lost. The
title truncates to a 10ch floor first, and the budget counts every active
chunk whether inline or folded, so a shed never hands width back and the
title cannot grow as the window shrinks.

- LogTitle owns its floor and exposes floorWidth; NavBar budgets on it.
- A folded row drops its hover when the full value reads the same.
@lukecotter lukecotter changed the title style(log-viewer): one type scale and one mono family feat(log-viewer): one type scale and a header that folds when narrow Aug 19, 2026
…pe-scale

# Conflicts:
#	.claude/rules/log-viewer.md
@lcottercertinia
lcottercertinia merged commit ec0d070 into certinia:main Aug 19, 2026
7 checks passed
@lukecotter
lukecotter deleted the style-log-viewer-type-scale branch August 28, 2026 09:39
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