Repository navigation
doctor: a lapsed kept contrast problem reads as drawn now - #13326
josephfarina merged 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Not ready yet: approval waits on an engineering owner deciding how stable doctor reports the theme editor's kept contrast records, and two fixes are needed whatever that decision is.
- Approval waits on an engineering owner deciding whether
doctor'stheme-accepted-contrastrow may read a lapsed record this way (alwaysinfo, a problem again at the ratio drawn now, or no longer needed), because no current record covers the row:spec:AST-050FR11 lists doctor's theme checks without it, and the theme-editor exception inspec:AST-017FR27 does not listdoctor. - When the editor reports a kept place's failure as one problem across three or more variants,
editorKeptContrastAtfinds no problem at the place, so doctor says the record is "no longer needed: its colors changed and it now passes" while the place still draws at 1.17:1 (packages/cli/api/theme-edit/_adapter.mjs:1034-1049; on butter, keep the blue card's heading, then give the green and purple cards the same#1e293bfill). .changeset/doctor-kept-contrast.md:5still says a lapsed record is named "as a problem again, with a warning", which contradicts the new changeset and the row, now alwaysinfo(packages/cli/api/doctor/theme-checks.mjs:2479), so fold this change into that note and drop the second one.
An engineering owner records the decision by naming or adding the record that governs this row, or by commenting /approve-spec <full head SHA>; the author may do so as an engineering owner. A test case for the grouped-variant case would cover the second fix.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: before this change, doctor said a changed record is a problem again even where the new colors pass: verified (light badge info fill
#0b4f5con the base). - Claim: before this change, doctor printed the kept ratio rather than the one drawn now: verified (the base prints 2.09:1 where the editor draws 2.3:1).
- Claim: before this change, the warning carried no fix: verified.
- Claim: a lapsed record is now a problem again at the ratio drawn now: verified (
theme-checks.mjs:2465-2467; it prints 2.3:1, kept at 2.09:1). - Claim: a lapsed record reads as no longer needed where its place passes: verified for a measured place that passes; it is also said where the place still fails (second bullet above).
- Claim: the row stays information: verified (
theme-checks.mjs:2479). - Claim: the test covers the drawn ratio and a fill that now passes: verified; the new ratio assertion fails on the base and the file passes here.
- Changeset
.changeset/doctor-kept-contrast-lapsed.md: true except in the grouped-variant case, and it contradicts the earlier note for the same row. - File
.changeset/doctor-kept-contrast-lapsed.md: contradicts.changeset/doctor-kept-contrast.md:5. - File
packages/cli/api/doctor/theme-checks.mjs: the "no longer needed" line is reached for a place that still fails. - File
packages/cli/api/theme-edit/_adapter.mjs: grouped problems read as no problem; the outerwithAcceptedcall changes nothing. - File
packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: no grouped-variant case; the ratio assertion accepts any number.
| at.mode === a.mode, | ||
| ), | ||
| inEffect: here.some(x => x.accepted), | ||
| ratioNow: open.length |
There was a problem hiding this comment.
ratioNow is null whenever no problem with a readable place sits here, and acceptedContrastCheck then says the place passes. The editor's grouped problems carry no place (contrastPlace reads only text| and track| keys; variants| at _settings.mjs:12015, base| at :12027). On butter, keep the blue card's heading at 1.17:1, then give the green and purple cards the same #1e293b fill: show lists "text ("This week") in heading on 3 card variants (blue, green, purple) is 1.17:1 in light", and doctor says the record is no longer needed and the place passes. Count a record as no longer needed only when its place is measured and passes, for example by keeping each member's place on a grouped problem and matching against those.
| const ctx = await context(root); | ||
| const res = await resolvedTokens(ctx, slug); | ||
| const covered = withAccepted( | ||
| const now = withAccepted( |
There was a problem hiding this comment.
Non-blocking: contrastProblems already ends with withAccepted(data, said, res) (_settings.mjs:12495), and a second pass returns its notes unchanged, so this outer call can go.
| acceptedContrastCheck(await editorKeptContrastAt(cwd))?.message, | ||
| ).toMatch( | ||
| /no longer holds?, because a color changed[^]*bv: badge \(variant info\)/, | ||
| /no longer holds?, because a color changed[^]*bv: badge \(variant info\) on badge in light at [\d.]+:1, kept at/, |
There was a problem hiding this comment.
Non-blocking: [\d.]+:1, kept at accepts any number. Matching at 2.3:1, kept at 2.09:1 proves the line prints the ratio drawn now, which is the change under test.
There was a problem hiding this comment.
Not ready yet: approval waits on an engineering owner deciding how stable doctor reports the theme editor's kept contrast records, and one fix is needed whatever that decision is.
- Approval waits on an engineering owner deciding whether
doctor'stheme-accepted-contrastrow may read a lapsed record this way (alwaysinfo, a problem again at the ratio drawn now, or no longer needed), because no current record covers the row (spec:AST-050FR11 lists doctor's theme checks without it, and the theme-editor exception inspec:AST-017FR27 does not listdoctor), and the ruling recorded on #13272 calls a lapsed record a warning. - When the editor reports a kept place's failure as one problem across three or more variants, doctor still says the record is "no longer needed: its colors changed and it now passes" while the place draws at 1.17:1, because the new
nearfallback inpackages/cli/api/theme-edit/_adapter.mjs:1042-1053keepsat != nulland a grouped problem has no place (on butter, keep the blue card's heading, then give the green and purple cards the same#1e293bfill).
An engineering owner records the decision by naming or adding the record that governs this row, or by commenting /approve-spec <full head SHA>; the author may do so as an engineering owner. The second release note is gone and the first now matches the row.
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0): none
- Claim: before this change, doctor called a changed record a problem again even where the new colors pass: verified (light badge info fill
#0b4f5con the base). - Claim: before this change, doctor printed the kept ratio rather than the one drawn now: verified (2.09:1 printed where the editor draws 2.3:1).
- Claim: before this change, the warning carried no fix: verified (the base row has no fix).
- Claim: a lapsed record is now a problem again at the ratio drawn now: verified (
theme-checks.mjs:2465-2467; it prints 2.3:1, kept at 2.09:1). - Claim: a lapsed record reads as no longer needed where its place passes: verified for a measured place that passes; it is also said where a grouped failure still fails (second bullet above).
- Claim: the row stays information: verified (
theme-checks.mjs:2479). - Claim: the test covers the drawn ratio and a fill that now passes: verified; the file passes, 15 of 15.
- Release note
.changeset/doctor-kept-contrast.md: true except in the grouped-variant case. - File
.changeset/doctor-kept-contrast.md: clear; it matches the row and the second note is gone. - File
packages/cli/api/doctor/theme-checks.mjs: the "no longer needed" line is reached for a place that still fails. - File
packages/cli/api/theme-edit/_adapter.mjs: thenearfallback never holds a grouped problem; the outerwithAcceptedcall changes nothing. - File
packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: no grouped-variant case; the ratio assertion accepts any number.
| // (A failure the editor reports across several variants at once | ||
| // names no one variant: one at the same part, ground and mode | ||
| // still says the place is not passing.) | ||
| const near = now.filter( | ||
| ({at}) => | ||
| at != null && | ||
| at.part === a.part && | ||
| at.ground === a.ground && | ||
| at.when === '' && | ||
| at.mode === a.mode, | ||
| ); | ||
| const open = (here.length ? here : near).filter(x => !x.accepted); |
There was a problem hiding this comment.
near keeps at != null, so it never holds the problem it is meant for: a failure the editor groups across three or more variants is keyed variants|… (_settings.mjs:12015), and contrastPlace returns null for every key but text| and track| (_settings.mjs:12702-12723). In the butter case the record has no variant, so near is the same list as here. At this head, keeping the blue card's heading at 1.17:1 and then giving the green and purple cards the same #1e293b fill still makes doctor say "no longer needed: its colors changed and it now passes: g: heading on card in light" while show lists the heading at 1.17:1 on 3 card variants. Report "no longer needed" only for a place that is measured and passes, for example by giving the grouped problem its members' places and matching against those, and add that case to the test.
|
/approve-spec d2b3d6c |
There was a problem hiding this comment.
Changes requested: an engineering owner's approval at this head settles how doctor reads the theme editor's kept contrast records, and one fix remains.
- When the editor reports a kept place's failure as one problem across three or more variants, doctor says the record is "no longer needed: its colors changed and it now passes" while the place draws at 1.17:1, because the
nearfallback inpackages/cli/api/theme-edit/_adapter.mjs:1045-1053keeps only problems with a place and a grouped problem has none (on butter, keep the blue card's heading, then give the green and purple cards the same#1e293bfill).
The grouped-variant fix proposed in #13365 targets this branch and resolves this once it is on this pull request's head. Two non-blocking notes stay open on the existing inline threads: the ratio assertion at line 268 of the test accepts any number, and the outer withAccepted call changes nothing.
Claims and files checked
Review mode: same-head; reason: none
- changed rules (0): none
- Claim: before this change, doctor called a changed record a problem again even where the new colors pass: verified (light badge info fill
#0b4f5con the base). - Claim: before this change, doctor printed the kept ratio rather than the one drawn now: verified (2.09:1 printed where the editor draws 2.3:1).
- Claim: before this change, the warning carried no fix: verified (the base row has no fix).
- Claim: a lapsed record is now listed as a problem again at the ratio drawn now: verified (
theme-checks.mjs:2465-2467; it prints 2.3:1, kept at 2.09:1). - Claim: a lapsed record reads as no longer needed where its place passes: verified for a measured place that passes; it is also said where a grouped failure still fails (the bullet above).
- Claim: the row stays information: verified (
theme-checks.mjs:2479). - Claim: the test covers the drawn ratio and a fill that now passes: verified (test lines 268 and 279-285); the file passes, 15 of 15.
- Claim: the author's preflight and replay passed at this head: not verified; they are local runs, and no CI workflow ran at this head.
- Claim: the review findings are fixed in the paired #13365: that pull request proposes the fix, but it is not part of this head.
- Release note
.changeset/doctor-kept-contrast.md: true except in the grouped-variant case. - Owner decision: an engineering owner approved this head as written.
- File
.changeset/doctor-kept-contrast.md: clear. - File
packages/cli/api/doctor/theme-checks.mjs: the "no longer needed" line is reached for a place that still fails. - File
packages/cli/api/theme-edit/_adapter.mjs: thenearfallback never holds a grouped problem; the outerwithAcceptedcall changes nothing. - File
packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: no grouped-variant case; the ratio assertion accepts any number.
doctor warned that a kept contrast problem whose colors changed is a problem again even where the new colors pass, printed the kept ratio rather than the one drawn now, and its warning carried no fix. A lapsed acceptance is now a problem again at the ratio drawn now, or no longer needed where its place passes, and the row stays information. [skip ci]
…ssing When the editor reports a kept place's failure as one problem across several variants, it names no one variant, so doctor found no problem at the record's place and said it was no longer needed. A problem at the same part, ground and mode that names no variant now counts. The doctor release note says how a lapsed record reads, and the second note is gone. [skip ci]
5cff489 to
eb3534f
Compare
… failing A failure the editor reports across several variants at once carries no place doctor could read, so a kept record there was still called no longer needed while its place drew at 1.17:1. The record's standing is now read by one helper, which also counts a failure that names the same part and mode in its text. Fixes the review finding on #13326. [skip ci]
d2b3d6c to
409ac97
Compare
|
/approve-spec 409ac97 |
There was a problem hiding this comment.
Changes requested: an engineering owner's approval at this head settles how astryx doctor reads the theme editor's kept contrast records, and one fix remains.
- A kept place that still fails is reported as passing when the editor groups its failure across variants:
editorKeptContrastAt(packages/cli/api/theme-edit/_adapter.mjs, lines 1047–1062) leaves the drawn ratio empty for the editor's single problem across three or more variants, so on butter, keeping the blue card's heading at 1.17:1 and then giving the green and purple cards the same fill makes doctor say the record "is no longer needed: its colors changed and it now passes" while the editor still lists the heading at 1.17:1; count such a place as open and add that case to the test.
The fix proposed in #13365 targets this branch, so this finding can be rechecked once that change is part of this pull request. As a smaller note, the drawn-ratio assertion at line 268 of the test accepts any number.
Claims and files checked
Review mode: full; reason: rebase
- Claim: doctor lists each kept record with its part, variant, ground, mode, ratio and reason — verified (
theme-checks.mjs2460–2464; test 241–249). - Claim: a lapsed record that still fails is listed as a problem again at the ratio drawn now — verified (
theme-checks.mjs2465–2467; test 265–269). - Claim: a lapsed record is listed as no longer needed where its place now passes — verified for a single-variant place (test 271–285); false for a place the editor reports across three or more variants (finding above).
- Claim: the row is information — verified (
theme-checks.mjs2479). - Claim (description): the parent's review findings are fixed — verified for the passing place, the drawn ratio and the warning; the grouped-variant case stays open.
- Claim (description): the tests cover the drawn ratio and a fill that now passes — verified; the test file passes at this head.
- Claim (description): the gate results — not checkable at this head; they name an earlier commit.
- File
.changeset/doctor-kept-contrast.md— its "no longer needed where its place now passes" is false for grouped places until the code is fixed. - File
packages/cli/api/doctor/theme-checks.mjs— clear on its own; it reads an empty drawn ratio as passing. - File
packages/cli/api/theme-edit/_adapter.mjs— finding above. - File
packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs— no grouped-variant case; the drawn-ratio pattern accepts any number.
409ac97
into
josephfarina/theme-a/04b-doctor-kept-contrast
Summary
Fixes the review findings on #13272: doctor said a kept contrast problem whose colors changed is a problem again even where the new colors pass, printed the kept ratio rather than the one drawn now, and its warning carried no fix. A lapsed acceptance is now listed as a problem again at the ratio drawn now, or as no longer needed where its place passes, and the row stays information.
Testing
theme-contrast-accepted-as-designed.test.mjs(lapsed at the ratio drawn now; a fill that now passes reads as no longer needed).Gate
preflight: pass 409ac97 (rebased onto main 4f7035e, own diff unchanged by patch-id from d2b3d6c)
replay: worse 0 at 409ac97 (rebased onto main 4f7035e, own diff unchanged by patch-id from d2b3d6c)