Skip to content

fix(ui): take every corner radius from the theme's radius tokens - #574

Merged
Tryanks merged 1 commit into
mainfrom
fix/radius-tokens
Oct 1, 2026
Merged

Tryanks merged 1 commit into
mainfrom
fix/radius-tokens

Conversation

@Tryanks

@Tryanks Tryanks commented Oct 1, 2026

Copy link
Copy Markdown
Owner

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 flat theme.radius field, and 42 literal rounded(px(N)) values. The theme filled gpui-base's RadiusTokens with its own formula, and nothing in Tcode read them.

Now:

  • theme.rs derives 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.lg was in themes/tcode.json already and unread. The flat radius field is removed; the scrollbar thumb uses full.
  • The material::radius_* helpers take cx and map a role to a token: overlay/composer → lg, card/input/button → md, chip → sm, bottom sheet → xl. overlay_popover and semantic_chip take cx for the same reason.
  • Literal radii map to the nearest token (12 → lg, 10/8 → md, 6/4 → sm); 1–3px hairline details stay literal.

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
  • Visual: desktop app (throwaway profile) in light and dark — thread view with composer and terminal drawer, model picker popover, settings page. Phone sheet not re-checked (its radius helper changed from 16 to 20 only).

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.
@Tryanks
Tryanks merged commit f26b852 into main Oct 1, 2026
7 checks passed
@Tryanks
Tryanks deleted the fix/radius-tokens branch October 1, 2026 19:07
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.

1 participant