voelin-gpui: the parity test notices a second brush or string in theme.slint

The test compared the brush and string declarations of theme.slint by name
only (one backdrop, one font-family and the mode string), so a second brush or
string token in the Slint file passed unseen while docs/ui.md said a token on
one side only fails the test. It now asserts the brush declarations are
exactly {backdrop} and the strings exactly {mode, font-family}, and a test
adds a brush and a string to a copy of the file (a mutant) and checks both are
named: red with the previous rule ("backdrop-soft goes unnoticed"), green
with this one.

A Rust-only second brush or string is still not seen (tokens.rs has one
gradient and one family that the test cannot enumerate); docs/ui.md says so
instead of promising it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Sonnet 5.5 committed 2026-10-27 12:29:02 +03:00
1 parent 977b942cd0
commit 5c94b15820
2 files changed
+80 -18

No files matched your search

+6 -2
View File
@@ -1094,8 +1094,12 @@ Two layers (docs/design/gpui-spikes.md, "The theme against Theme tokens"):
(the server rail, presence, meters) read it. `theme/slint_parity.rs` reads
`theme.slint` at test time and compares every declaration of its `Theme`
global with `theme/tokens.rs` by name, with the file's own arithmetic, at
four text sizes; a token on one side only, a changed value or a kind of
declaration it does not know fails the test.
four text sizes; a colour, length, weight or duration on one side only, a
changed value or a kind of declaration it does not know fails the test, and
so does a brush other than `backdrop` or a string other than `mode` and
`font-family` in the Slint file (those three it compares by name against
the one gradient and the one family of `tokens.rs`, which it cannot
enumerate: a second brush or string only on the Rust side is not seen).
2. **gpui-component's `ThemeColor`**, which its widgets read, written from the
first on every change (`theme/components.rs`): the registered theme of the
mode first, then the mapped colours over it, the font (Inter, `font-body`),