Skip to content

fix(files): keep a chosen file text size's source through a later interface size - #2987

Merged
devswha merged 5 commits into
mainfrom
fix/file-font-interface-scale
Nov 5, 2026
Merged

devswha merged 5 commits into
mainfrom
fix/file-font-interface-scale

Conversation

@devswha

@devswha devswha commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Fixes #2984

What

Follow-up to #2982 (File text size keeps a chosen size through a later chat size), both findings of #2984:

  1. Interface size moved a chosen file size's source (MEDIUM). The source is drawn at --fs-xs times --file-source-scale, and --fs-xs follows the interface size. With the base fixed at the chat size of the moment, a later Interface font size change was no longer cancelled (file 15 / base 14, interface 14 -> 21: source 12.86px -> 18.37px while the Markdown preview stayed at 16.07px). The interface size at the moment of choice is now kept too, and the source scale is size / chatThen * uiThen / uiNow, so the source stays put through a later chat or interface size.
  2. Size and base could be paired wrongly (LOW). The base is now one record { size, chat, ui } in its own key ovis:file-font-base (replacing ovis:file-font-from, never released), naming the size it was recorded for. It is read only beside that size; a size written without it (an older tab, another order of tabs) scales from the current chat size as if just chosen instead of from a base recorded for another size. Every step writes size and base together.

Device-scoped and out of telemetry as before; nothing changes until a size is chosen.

Tests

  • src/lib/settings.test.ts: the source keeps its drawn size (--ui-scale x --file-source-scale) through interface sizes 14 -> 21 -> 11; a base recorded for another size is ignored; storage keeps the base out of the whole-record save and drops it when the size key was written alone. Both tests failed on main before the fix.
  • scripts/file-text-size-demo-regression.ts: the interface step now expects the long file's source line height unchanged (it expected it to grow), and the stepper stores { size, chat, ui }.

Validation

  • bun test src/lib/settings.test.ts src/lib/typography.test.ts: 117 pass.
  • bun scripts/file-text-size-demo-regression.ts at 390 and 1280, light and dark: all PASS (source line height 30.8571px before and after the interface change).
  • bun run typecheck: pass.
  • bun run check fast: pass (12098 unit pass, typecheck, build, generated files)

No visual change: the settings row and viewer look as before (screenshots from the demo regression, 390/1280 light/dark, checked).

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 8 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c6f7701 and a06846f.

Files selected for processing: 6

  • changelog.d/file-text-size.md
  • scripts/file-text-size-demo-regression.ts
  • src/components/FileTextSizeRow.tsx
  • src/lib/settings.legacy-fixture.ts
  • src/lib/settings.test.ts
  • src/lib/settings.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@devswha

devswha commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

Review round (omo + Codex), resolution:

  • omo: CLEAR at 91a20b1.
  • Codex MEDIUM, Reset over another tab's base leaves that base behind: fixed. saveSettings now writes ovis:file-font-base only beside the size it was recorded for (null otherwise), with a unit test that failed before the fix.
  • Codex MEDIUM, the previous build's ovis:file-font-from is not migrated: not changed. File text size (feat(files): a text size of its own for an open file #2968) and its base (fix(files): keep a chosen file text size through a later chat size #2982) shipped in no release yet, so only main-preview devices that chose a size since earlier today are affected; on load such a size scales from the current chat size as if just chosen, and a step or Reset sets it right.
  • Codex MEDIUM, a pre-fix tab that steps 20 -> 21 -> 20 makes the stored base valid again: not changed. Same pre-release window as above; this build always writes size and base together, so only a tab from a build before this PR can do it.
  • Codex LOW, a Density change still nudges a chosen size's source slightly (--fs-xs is 12px comfortable, 11px compact; e.g. 12.86px -> 12.69px): left as is, out of File viewer: a chosen File text size's source still moves with the interface size #2984's scope; noted here.

@devswha

devswha commented Nov 5, 2026

Copy link
Copy Markdown
Owner Author

Local merge gate (owner-approved): bun run check fast passed at this head, omo CLEAR, Codex MEDIUM fixed, threads resolved; main moved one commit since (#2989, no overlap). Fixes #2984. Merged without waiting for GitHub CI.

@devswha
devswha merged commit 1d404b8 into main Nov 5, 2026
11 of 12 checks passed
@devswha
devswha deleted the fix/file-font-interface-scale branch November 5, 2026 13:35
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.

File viewer: a chosen File text size's source still moves with the interface size

1 participant