Repository navigation
test(studio): bound the chat font size and accept a normal tracking - #7828
Merged
Merged
Conversation
Two follow-ups to #7826, which is otherwise the right fix. Asserting the em means the font size itself is no longer checked. The px literal it replaced caught that implicitly, since 0.3565px only matched at 15.5px, so the check quietly lost the ability to notice chat text rendering at the wrong size. Bounding the size to 12-18px restores a coarse version of that: a deliberate scale change or a user font-size preference passes, chat text at a caption or heading size does not. float("normal") also raises, and "normal" is how a browser reports a zero tracking, so that path would surface as a test error rather than as this check failing with its own message. Exercised against the values that occur: the three current theme branches, the pre-#7359 15.5px body, a raised user preference, a zero tracking spelled "normal", a wrong tracking, and chat text at caption and heading sizes. Only the last three fail, each with the message that names the cause.
Both review points, and they are the same finding from two sides: a range is wrong at the edges and useless in the middle. UI_FONT_SIZE_RANGE is 12 to 20 and the store sets --ui-font-scale to preference / 16, so text-ui-15p5 spans 11.625px to 19.375px. The 12-18px bound rejected both endpoints, failing a UI that is rendering its configured size correctly. At the default scale it also admitted text-ui-13 at 12.1875px and text-ui-18 at 16.875px, so the token swap it was meant to catch passed, and the tracking assertion passed with it because the expectation derives from the same measured size. So read --ui-font-scale off the root and assert the size is text-ui-15p5 at that scale. That holds at every supported preference and pins the token, which is what the check was for. Exercised at preferences 12, 15 and 20, at the pre-#7359 base, with a zero tracking spelled "normal", against swaps to text-ui-13 and text-ui-18, and against a wrong tracking. The three intended failures fail, each naming its cause.
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Post-convergence comment pass. The embedded JavaScript comment is left alone: it sits inside a Python string literal, so editing it is a code change and the comment-only gate correctly rejects it.
The font-scale test drove the size input to 16 and then asserted that data-ui-font-size had been dropped, but the store only removes the attribute at UI_FONT_SIZE_RANGE.default, which is 15. The static --ui-font-scale of 0.9375 in index.css is the same 15/16.
|
Codex Review: Didn't find any major issues. Keep it up! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Three small follow-ups to #7826, which is otherwise the right fix. The first two were split out of #7821, which I closed as superseded; the third is a separate stale constant in the same family that the first two came from.
The font size is no longer checked
Asserting the em means the size it resolves against is read rather than verified. The px literal it replaced caught that implicitly:
0.3565pxonly matched at a 15.5px body, so a size regression showed up as a tracking failure. After the change, chat text rendering at a caption or heading size passes silently, because the expectation moves with it.The check now asserts the token rather than a range: chat text is
text-ui-15p5, so the size has to be15.5px * --ui-font-scale, read from the same root the product computes it on. That holds at every font-size preference and fails on any other token.text-ui-13ortext-ui-18does notfloat("normal")raises"normal"is how a browser reports a zero tracking, andfloat("normal".removesuffix("px"))raisesValueError. That path would surface as a test error rather than as this check failing with its own message. Only reachable if a tracking ever becomes 0, so this is defensive rather than a live bug.The font-scale test uses a default the store does not have
playwright_ui_font_scale.pydrives the size input toDEFAULT = 16and then assertsdata-ui-font-sizehas been dropped. The store only removes that attribute when the preference equalsUI_FONT_SIZE_RANGE.default, which is 15, so the attribute is still there and the test fails:16 is the root font size, not the UI font size default. The static
--ui-font-scale: 0.9375inindex.cssis the same15 / 16. This is the same shape of staleness as #7826 fixed, left behind by #7359. The ratio math in the test is relative toDEFAULT, so it stays correct at 15.Verification
Exercised against the values that actually occur:
Only the last three fail, each with the message that names the cause.