Repository navigation
Conversation
e1ff847 to
aacb64a
Compare
|
Rebased onto current Re-ran the gates against the new base: The two |
aacb64a to
9471347
Compare
|
Both findings were real — thank you. Fixed in Blocking finding (Pierre row height). You were right that So the fix is the remount you suggested, wired through the seam you named:
Monaco needed nothing: |
|
Applied — the fill is now measured from the minimum, not from zero. |
Every type size comes from `styles/typography.json`, so a reader who needs larger text has had no recourse but a rebuild. Add a Font size control to Settings -> Appearance that scales the generated `--tr-font-size-*` and `--tr-code-row-height` custom properties on `documentElement`. `styles/typography.json` stays the source of truth: the module reads the base sizes from it and never edits a value. At the default scale every property is removed, so the generated CSS applies verbatim; the override exists only while the reader wants it. The choice is stored through the stable preference adapter and reapplied at startup.
9471347 to
8cc2b1e
Compare
What
Adds a Font size control to Settings → Appearance that scales the whole interface from 80% to 160% in 5% steps.
Why
Every type size in the interface comes from
apps/web/src/styles/typography.json, which is a build-time source of truth. That is the right design for the design system, but it leaves a reader who needs larger text with exactly one recourse: rebuild the app. This gives them a control instead.How
The slider writes scaled values for the generated
--tr-font-size-*and--tr-code-row-heightcustom properties ontodocumentElement:styles/typography.jsonstays the source of truth.styles/fontScale.tsreads the base sizes out of it (BASE_FONT_SIZES, andBASE_CODE_ROW_HEIGHTcomputed fromcodeRowthe same wayrenderCss()does) and never edits a value — so raising a size in the JSON can never leave the slider scaling a stale number.main.tsx.styles/TYPOGRAPHY.mdrecords this as the one permitted runtime exception, so the "typography.json is the only source of truth" rule keeps its meaning.Code rows follow the reader
CSS-only scaling would have left the two code surfaces disagreeing with their own row height:
fontSize/lineHeightas JS options, andlineHeightthere is the1.3multiplier rather than pixels — so onceMonacoEditorre-renders itsupdateOptionscall carries the new size. It re-renders becauseResourcePreferenceschanged.useFileInstancepasses it to the constructor and never callssetMetricsafterwards, and the React layer does not expose the instance). SoResourcePreferencesnow carriescodeRowHeightin pixels,usePierreVirtualizerbuilds its metrics from it, andPierreFile/PierreDiffkey the Pierre component on that number. Only the Pierre instance remounts — the scroller, the virtualizer and the scroll position survive, andVirtualizedFile.cleanUpdisconnects before the replacement connects.applyFontScalewrites it from an effect, so during the render that changed the choice the property still holds the previous row.Scope
settings.appearance.fontScale.{label,description,value}, inen.jsonandzh-CN.json.Testing
bun test apps/web/src/→ 1960 pass / 0 fail across 180 filesbun test packages/resource-renderers/→ 212 pass / 0 fail across 41 filesbun run check:i18n→ OK (catalog sorted, every key referenced)bun run check:deps,check:boundaries,typography:check→ OKturbo run typecheck→ 22 packages successfulbun run lint→ 1724 files, no findings--tr-font-size-s11from 11px → 15px and--tr-code-row-heightfrom 14px → 20px; back to 100% restores the generated values exactly.