Repository navigation
Conversation
|
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 40 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. |
✅ SSOT Configuration Compliance: Passing🎉 No new hardcoded values of either class — Known backlog in |
|
Code review on PR #20480 (head 650ab06): approve. Read only, not rendered. Each |
|
Code review on PR #20480 (head 5c138ad): approve. Covers eba61ec..5c138ad, read only. Behaviour is unchanged. Low, cosmetic: in |
Auto-sync: merging
|
| side | commit | subject | issue refs |
|---|---|---|---|
| main | 519950c01 |
fix(frontend): primary-fill labels read --text-on-primary, not a literal white (#20425) | #20425 |
| this branch | 5c138ad54 |
refactor(frontend): the Telegram panel saves with the shared button, removing a duplicated style (#20390) | #20390 |
| this branch | a86dc9134 |
feat(theme): the font-size preference drives the one --text-* scale; --font-size-* removed (#20390) | #20390 |
|
Code review (code-reviewer pass) at 851200c Verdict: APPROVE Checked: no
No blocking findings. |
|
Branch deleted after verification: every commit is in main and the branch shows 0 changed files against main. Restore it from this PR if needed. |
Thinking Path
The maintainer chose option A on #20390:
--text-*stays as the one font-size scale, the font-size preference drives it, and--font-size-*goes away. Before this change the preference set--font-size-*and almost nothing read it, while ember overrides--text-*. The two scales used different names, so nothing fought; moving the preference onto--text-*creates the conflict, because a theme's own--text-xland a[data-font-size]rule would compete on selector order and one would silently lose.So the preference cannot override the steps. It sets a factor, and every
--text-*definition (base and theme) multiplies by it. Theme picks the size, preference scales it, and neither depends on rule order.What Changed
User-visible: the font-size preference (small / medium / large) now resizes text across the app, including the headings and views that read
--text-*, in every theme including ember. Medium looks exactly as before. Small and large change sizes by up to half a pixel from the old per-step tables on the 14 files that already used the old scale, and now also apply to everything else on--text-*.design-tokens.css: new--font-scale: 1; every--text-xsto--text-6xliscalc(<size>rem * var(--font-scale)). The seven--font-size-*definitions are removed.themes/preferences.css:[data-font-size="small"]sets--font-scale: 0.9375,largesets1.0625. Medium has no rule.themes/ember.css: its six--text-*steps keep their sizes and multiply by--font-scale.var(--font-size-*)to the matching--text-*(100 lines).ds-second-font-scale(scripts/canonical/rules/ds_second_font_scale.mjs) fails on any--font-size-xs|sm|base|lg|xl|2xl|3xldefinition or use underautobot-frontend/src. It is not a baseline ratchet; the tree holds zero, with one file waived for an open PR (below).docs/developer/theming.mddocuments the scale and how theme and preference combine.Values (medium unchanged):
Left alone:
--font-size-md(seven uses, never defined, tracked in the undefined-variable baseline),--btn-font-size-md,--aui-*, and the SLM. Nothing inlibs/autobot-uior the SLM maps onto the removed scale.Held file:
views/llc/CompanySelectorView.vueline 399 still readsvar(--font-size-xs)because #20388 holds the file. With the definition removed that one declaration computes to inherited size until the line is moved tovar(--text-xs). It is waived in the guard by file and count with the PR number; remove the waiver in the PR that converts it.Verification
vitest run --maxWorkers=2 src/assets/css/__tests__: 3 files, 29 tests passed, including the newfontScale.test.ts(7 tests: medium identical with and without ember, small and large factors on every step, small and large with ember scale ember's own steps, theme steps carry--font-scale, no--font-size-*definition remains).vitest run --config scripts/canonical/vitest.config.mjs scripts/canonical/__tests__/ds_second_font_scale.test.mjs: 1 file, 6 tests passed. The first test plants a definition, a use, a fallback use and a.tsreference and the guard reports all four lines; the last test asserts the real tree reports none.Model Used
Claude Sonnet 5.5 (claude-sonnet-5-5), via Claude Code.
Single-issue rationale: the token removal, the guard and the theme-and-preference design must land together; the remaining #19907 font-size batches wait on this scale.
Refs #20390