Repository navigation
fix(ui): take every corner radius from the theme's radius tokens - #574
Merged
Merged
Conversation
The theme derived gpui-base's RadiusTokens with its own formula and nothing in Tcode read them; corners came from a hard-coded scale in material.rs, from a flat theme.radius field and from literal pixel values. The tokens are now derived the way gpui-kit derives them from the same two theme-file keys (sm = radius/2, md = radius, lg = radius.lg, xl = 2 x radius), the flat field is gone, the material helpers map a role to a token, and literal radii use the nearest token.
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.
Changed behaviour
Corner radii came from three places none of which was the theme's tokens: a hard-coded scale in
material.rs(radius_overlay() = 10,radius_input() = 8, …), a flattheme.radiusfield, and 42 literalrounded(px(N))values. The theme filled gpui-base'sRadiusTokenswith its own formula, and nothing in Tcode read them.Now:
theme.rsderives the tokens the way gpui-kit derives them from the same two theme-file keys (radius→ md,radius.lg→ lg, sm = radius/2, xl = 2×radius, full = pill).radius.lgwas inthemes/tcode.jsonalready and unread. The flatradiusfield is removed; the scrollbar thumb usesfull.material::radius_*helpers takecxand map a role to a token: overlay/composer → lg, card/input/button → md, chip → sm, bottom sheet → xl.overlay_popoverandsemantic_chiptakecxfor the same reason.With the theme's radius 10 / radius.lg 14 the visible changes are small: inputs and buttons 8 → 10, chips and small rows 6 → 5, the phone sheet 16 → 20.
Per Principle 7 (#564); closes the "radius scale" item left open after the gpui-base audit.
Tests
No new tests: this is theme wiring.
cargo nextest run -p tcode-ui --locked— 349 passed.Checks run
cargo fmt --all --check,cargo clippy --workspace --all-targets --locked -- -D warnings