Repository navigation
fix(files): keep a chosen file text size's source through a later interface size - #2987
Merged
Merged
Conversation
…erface size Fixes #2984
|
Warning Review limit reachedYou'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. View limit details
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. |
Owner
Author
|
Review round (omo + Codex), resolution:
|
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2984
What
Follow-up to #2982 (File text size keeps a chosen size through a later chat size), both findings of #2984:
--fs-xstimes--file-source-scale, and--fs-xsfollows 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 issize / chatThen * uiThen / uiNow, so the source stays put through a later chat or interface size.{ size, chat, ui }in its own keyovis:file-font-base(replacingovis: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-scalex--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.tsat 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).