Repository navigation
fix(core): Field labels use the primary text colour - #12458
josephfarina wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
c9be2a6 to
b3a4195
Compare
b3a4195 to
aad9a0e
Compare
There was a problem hiding this comment.
Approval waits on an engineering owner's decision about the label colour, and the changeset needs one wording fix.
- No current record decides that FieldLabel's label text (every Field label, the standalone CheckboxInput and Switch labels, and a label's icon) moves from the secondary to the primary text colour while the description and the Optional/Required marker stay secondary; an engineering owner records that decision, or points to the record that settles it, by commenting
/approve-spec <full head SHA>on this pull request, and the author may do so as an engineering owner. - The changeset says only the weight told the label and its description apart before, but the base also sets them at different sizes (14px and 12px in the default theme), so line 5 should read "Before, the label and its description shared one colour.", and the description's "differ only in weight" needs the same edit.
The new test fails on the base and passes here, the Field, FormLayout, CheckboxInput, Switch and theming-target suites pass, and the label contrast measured in Core light, Neutral light and dark, Matcha light and Gothic dark matches your table, while Core dark measured 8.48:1 to 14.4:1 against the story's page background.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Changeset: labels use the primary text colour while the description and the marker stay secondary: verified (
FieldLabel.tsx:77,:131,:138; new test) - Changeset: before, the label and its description shared one colour: verified (both secondary on the base)
- Changeset: before, only the weight told them apart: false (base sizes 14px and 12px)
- Description: no knowledge record changes: verified
- Description: stacked on the label-weight pull request: verified (this branch's base is that pull request's head)
- Description: label and description differed only in weight: false (sizes differ)
- Description: no published theme styles the label target, and a theme that does keeps its colour: verified (only the private test theme styles it; the target still composes)
- Description: description, marker, status messages, disabled and hidden labels unchanged: verified
- Description: the new test pins the colours and fails on the old style: verified (fails on the base, passes on the head)
- Description: the stated test command passes, 23 files and 920 tests: verified
- Description: contrast table: verified for Core light, Neutral light and dark, Matcha light and Gothic dark; Core dark measured 8.48:1 to 14.4:1; other rows not measured
- Description: template sweep and blind visual judge: not reproducible here, not relied on
.changeset/field-label-primary-color.md: finding (line 5)packages/core/src/Field/FieldLabel.test.tsx: clearpackages/core/src/Field/FieldLabel.tsx: clear apart from the colour decision above
|
Owner decision (engineering owner, covering this pull request): field labels draw in the primary text color, while the description and the Optional or Required marker stay in the secondary color. This covers every Field label, the standalone CheckboxInput and Switch labels, and a label's icon. It raises the label's contrast, and the label color stays a theme setting on the |
|
/approve-spec aad9a0e |
aad9a0e to
8780105
Compare
|
@astracat-bot review |
|
/approve-spec 8780105 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because it runs only once this pull request targets main.
The label colour change has an engineering owner's decision on this pull request, the earlier changeset wording is fixed, and the new colour test fails on the base and passes here.
- Optional: the changeset says "Field labels", but the standalone CheckboxInput and Switch labels also turn primary; naming them tells people using those controls to expect it.
Claims and files checked
Review mode: full; reason: rebase
- Changeset: labels use the primary text colour while the description and the Optional or Required marker stay secondary: verified (
FieldLabel.tsx:77,:131,:138; new test) - Changeset: before, the label and its description shared one colour: verified (both secondary on the base)
- Description: no knowledge record changes: verified (three files, none a record)
- Description: stacked on the label-weight pull request: verified (this branch's base is that branch)
- Description: the label moves to the primary colour while the description and the marker keep the secondary one: verified
- Description: a theme that styles the label target keeps its colour, and the Probe theme renders rgb(52, 38, 9) before and after: verified (pixel-identical frames)
- Description: no first-party theme styles the label target: verified (only the Probe test theme does)
- Description: description, marker, status messages, disabled and hidden labels unchanged: verified (the disabled label keeps the disabled colour in the States story)
- Description: the new test pins the colours and fails on the old style: verified (fails on the base, passes here)
- Description: the stated test command passes, 23 files and 920 tests: verified
- Description: contrast table: verified for 15 of 16 rows; the Core defaults dark row matches a black page, while on the browser's default dark page it measures 8.48:1 to 14.4:1
- Description: before and after images, theme audit, template sweep and blind visual judge: not reproduced here and not relied on
.changeset/field-label-primary-color.md: clear (optional wording note above)packages/core/src/Field/FieldLabel.test.tsx: clearpackages/core/src/Field/FieldLabel.tsx: clear
8780105 to
2f18395
Compare
|
/approve-spec 2f18395 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because its latest commit message carries [skip ci]; the required checks still have to run and pass before merge.
The label colour change has an engineering owner's decision on this pull request, the rebase onto main left the colour commit unchanged, and the new colour test fails on the old style and passes here.
- Optional: the changeset says "Field labels", but the standalone CheckboxInput and Switch labels also turn primary; naming them tells people using those controls to expect it.
Claims and files checked
Review mode: full; reason: rebase
- Changeset: labels use the primary text colour while the description and the Optional or Required marker stay secondary: verified (
FieldLabel.tsx:77,:131,:138; new test) - Changeset: before, the label and its description shared one colour: verified (both secondary on the base)
- Description: no knowledge record changes: verified (three files, none a record)
- Description: stacked on the label-weight pull request, changing only the label colour on top of it: verified (the label weight is already on
mainunder this branch, and only the colour changes here) - Description: the label moves to the primary colour while the description and the marker keep the secondary one: verified
- Description: the FieldLabel and Field records leave component-local visual tuning to shared semantic tokens: verified
- Description: a theme that styles the label target keeps its colour, and the Probe theme renders rgb(52, 38, 9) before and after: verified (pixel-identical frames, light and dark)
- Description: no first-party theme styles the label target: verified (only the Probe test theme does)
- Description: description, marker, status messages, disabled and hidden labels are unchanged: verified (only the label rule changes; the disabled label measures 3.15:1 on both sides)
- Description: the new test pins the colours and fails on the old style: verified (fails on the base, passes here)
- Description: the stated test command passes: verified (24 files and 921 tests at this head; the stated 23 and 920 were counted before the rebase)
- Description: contrast table: verified for 15 of 16 rows; Core defaults dark measures 8.48:1 to 14.4:1 on the browser's default dark page
- Description: no API or behaviour change: verified (built API surface identical)
- Description: phone-width images, theme audit, template sweep and blind visual judge: not reproduced here and not relied on
.changeset/field-label-primary-color.md: clear (optional wording note above)packages/core/src/Field/FieldLabel.test.tsx: clearpackages/core/src/Field/FieldLabel.tsx: clear
- #12635 fix(cli): export loads and gives back a page whose modules import TypeScript files by .js names Author: @josephfarina - #12727 fix(cli): export loads a served package's subpath exported only to imports Author: @josephfarina - #12224 fix(cli): a {@link} in a template description resolves as astryx docs resolves it Author: @josephfarina - #12278 fix(core): a Theme given a value that is not a theme keeps the page running Author: @josephfarina - #12751 feat(Layout): LayoutContent names its container, so a theme styles a dialog's body apart from its header and footer Author: @josephfarina - #12168 fix(templates): header, footer and toolbar rows wrap for longer translated labels Author: @josephfarina - #12399 [experimental] export: the dropped-text warning checks Core's docs, and text not drawn yet inside Core components that take children no longer warns Author: @josephfarina - #12541 [docs] Core: list the props ComplexSelector, Selector, Toast and ContextMenuItem take Author: @josephfarina - #12676 docs(cli): a short form keeps its own 640 column inside a wide template frame Author: @josephfarina - #12458 fix(core): Field labels use the primary text colour Author: @josephfarina - #12373 [experimental] export: a link to a place in the page stays in the file in a srcdoc viewer frame Author: @josephfarina
|
Landed in #12827. |
Record change: none (one shared colour token for another, inside
component:FieldLabel). Look gate: themed form-page audit 0 new findings in all seven themes; template sweep 0 worse; blind visual judge 2 better, 0 worse; contrast table below.User impact
In forms built with
Field(text inputs, selectors, date and time inputs, checkbox and radio lists), the label used--color-text-secondary, the same colour as the description under it. Next to a hand-written form, Astryx labels read faint grey, and the label and its description shared one colour.This PR draws the label in
--color-text-primary. The label names the control, so it reads at full strength; the description and the Optional or Required marker keep--color-text-secondaryand read as supporting text.Visual authority
DDrow reused or amended.Design decisionstable by a team design owner.docs/design/.component:FieldLabelandcomponent:Fieldsay no design record governs component-local visual tuning and that the label uses shared semantic colour tokens. This change stays inside that: one shared text token for another. No record is edited. The FieldLabel record owner's review settles the tuning.Before and after
Chromium on Linux, Storybook
Field"All variations" story. Each image: top row before, bottom row after; columns are phone 390px light and dark, phone 375px light and dark, desktop 1280px (left part) light and dark.Core defaults (no theme)

Neutral

Stone

Butter

Chocolate

Gothic (dark-only theme; the light column shows its dark palette)

Matcha

Y2K

Contrast
Label text against the surface behind it, measured from the rendered page (WCAG ratio). The description column is unchanged by this PR and equals the old label value, because the label and the description used one colour before.
Look gate on every theme
The phone and dark audit (overflow, clipping, text overlap, WCAG contrast, scheme, reachable controls, and up to three opened menus or dialogs per view) ran on the 16 form pages and form blocks among the templates (sign-in, contact, settings, payment, checkout and form wizards, drawer form), rendered with this PR's base (#12428, now merged) and with this PR, each theme's CSS applied, at 390px and 1280px, light and dark. Planted controls (a page that must pass and a low-contrast page that must fail) came out right in every theme.
The existing failures are the same on both sides (Gothic is a dark-only theme, so its light views fail by design).
A theme's own label colour wins
The label colour stays on the
field-labeltheme target, so a theme that styles that target keeps its colour. The Probe test theme sets its ownfield-labelcolour; the label rendersrgb(52, 38, 9)before and after this PR, in light and dark.State matrix
field-labeltarget, so each moves the same way; a theme that styles it keeps its own colour.--color-text-disabledstill applies after the base colour), and hidden labels.Scope
Components: FieldLabel
Testing
FieldLabel.test.tsx: a new test reads the injected CSS and pins the label to--color-text-primaryand the description and marker to--color-text-secondary. It fails on the old style.CI=1 vitest run packages/core/src/Field packages/core/src/FormLayout packages/core/src/CheckboxInput packages/core/src/Switch packages/core/src/theme/themingTargets.test.ts(23 files, 920 passed).preflight: pass 2f18395