Skip to content

test(web): hold the palette against new raw colours - #90

Open
42-v wants to merge 1 commit into
mainfrom
fix/ui-palette-gate
Open

test(web): hold the palette against new raw colours#90
42-v wants to merge 1 commit into
mainfrom
fix/ui-palette-gate

Conversation

@42-v

@42-v 42-v commented Aug 26, 2026

Copy link
Copy Markdown
Owner

UI plan item D1. The plan's premise was wrong, and following it would have shipped a gate that flags correct markup.

It asked for a lint forbidding "colour outside the palette" and put the count at thirteen raw escapes across five files. Measured: six, in two non-test files — and every one has to stay literal.

Where Literals Why they stay
LoginView.vue:69-72 #4285F4 #34A853 #FBBC05 #EA4335 the Google "G" mark — re-hueing a trademark is not a theming decision
TwoFactorView.vue:49 #0a0a0f #ffffff QR modules and quiet zone; an encoder consumes these directly and the code must decode off any background, which is the defect that put them there (#74)

So this holds the useful half instead: no new raw colour. The six are listed with the reason each is exempt.

Checked in both directions. An entry that stops matching fails the gate — an exemption that outlives the literal it excused is how a list like this quietly becomes permission to add anything. Both mutation-verified:

src/views/ProfileView.vue:#ff00ff is a raw colour. Use a design token, or add it to ALLOWED...
src/views/LoginView.vue:#DEAD00 is listed as allowed (...) but no longer appears. Remove the entry.

Test files are out of scope: a test asserting an exact rendered colour is supposed to name that colour, and palette.test.ts / TwoFactorView.test.ts do exactly that. Pinning them here would fight the assertions.

test(web): hold the palette against new raw colours

The UI plan asked for a lint forbidding colour outside the palette and put the
count at thirteen raw escapes across five files. Measured, it is six in two
non-test files, and every one of them has to stay literal: four are the Google
mark on the sign-in button, where re-hueing a trademark is not a theming
decision, and two are the TOTP QR colours, which an encoder consumes directly
and which have to decode off any background -- that being the defect that put
them there in the first place.

So a gate written to the plan's wording would have flagged six pieces of correct
markup. This holds the useful half instead: no new raw colour. The six are
listed with the reason each is exempt.

The listing is checked in both directions. An entry that stops matching fails
the gate, because an exemption that outlives the literal it excused is how a
list like this quietly becomes permission to add anything. Both directions are
mutation-verified.

Test files are out of scope: a test asserting an exact rendered colour is
supposed to name that colour, and palette.test.ts and TwoFactorView.test.ts do
exactly that.
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