Repository navigation
doctor: a failure reported across several variants keeps a kept place failing - #13365
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.
|
|
/approve-spec cdea8c8 |
There was a problem hiding this comment.
Not ready yet: the behaviour this pull request reports is unchanged at this head, so the fix and its release note need another pass. An engineering owner has already recorded the spec decision for this head, so nothing waits on a maintainer.
- Running the scenario in the description (on butter, keep the blue card's heading, then give the green and purple cards the same
#1e293bfill),astryx doctorprints1 kept contrast problem is no longer needed: its colors changed and it now passeson this head exactly as it does on the base, while the editor liststext ("This week") in heading on 3 card variants (blue, green, purple) is 1.17:1 in light. - The new rule cannot match that problem, because it requires the text to begin
text in <part>(packages/cli/api/theme-edit/_settings.mjs:12742) while the grouped wording beginstext ("<sample>") in <part> on N <ground> variants(_settings.mjs:12052) and its key isvariants|…, whichcontrastPlacedoes not read; matching on that key, which carries the part, ground and mode, is the smaller fix. .changeset/doctor-kept-contrast-grouped.md:5tells consumers the row no longer calls such a record no longer needed, which the run above disproves, so the note should land with the fix rather than before it.- The loose arm compares only part and mode (
_settings.mjs:12768), so a kept record whose own place passes is reported as a problem again from a failure on another ground: over the same fixture, a record fortoaston thecardground in dark comes back at 4.16:1, taken fromthe base theme's text in toast ("Changes saved") is 4.16:1 in dark … the base theme draws it so. - The new test case builds its grouped problem as
key: 'text-variants|heading|card'with texttext in heading (variants blue, green, purple) …(theme-contrast-accepted-as-designed.test.mjs:495-498), a shape no code path emits, so it passes while the real path stays uncovered; building the case fromcontrastProblems, astheme-variant-problems-one-cause.test.mjsdoes, would have caught this.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim (release note): doctor's kept-contrast row no longer calls a record no longer needed while its part fails in a grouped variant problem — false; the end-to-end run on this head prints the old sentence.
- Claim (description): a failure reported across several variants at once carries no place doctor can read — verified; the grouped key is
variants|…andcontrastPlacereads onlytext|…andtrack|…keys. - Claim (description): the record's standing is now read by one helper that also counts a failure naming the same part and mode in its text — verified as written, but that text rule does not match the grouped wording.
- Claim (testing): the new test covers a grouped failure keeping the place failing — false in substance; its fixture is a problem shape the editor never emits, and the file's 17 tests pass either way.
- File
.changeset/doctor-kept-contrast-grouped.md: finding, the claim above. - File
packages/cli/api/theme-edit/_settings.mjs: findings, the text rule misses the grouped wording and matches on part and mode alone. - File
packages/cli/api/theme-edit/_adapter.mjs: clear; the call site matches the helper's contract, the droppedcontrastPlaceimport has no other use, and the function's own documentation stays accurate. - File
packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: finding, the fixture shape above. - Also run: the touched test file (17 passed), ESLint over the three changed source files (clean), and the CLI strict typecheck (the same two pre-existing template errors on this head and the base).
|
/approve-spec cc6f0bc |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet.
The grouped case now reads as a problem again at 1.17:1 rather than "no longer needed", and the earlier findings on this pull request are fixed. Two optional follow-ups: the test's kept record carries when: 'variant:blue', which the editor never writes for a card variant, so the !a.when path a real record takes has no test; and doctor now says "because a color changed … at 1.17:1, kept at 1.17:1" although the kept pair is unchanged.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules (0): none.
- Release note: doctor's kept-contrast row no longer calls a kept problem no longer needed while its part still fails in a problem reported across several variants at once. Verified: the described scenario prints "no longer needed" on the base and "a problem again … at 1.17:1" on this head.
- Description: a failure reported across several variants carries no place doctor can read. Verified: its key starts
variants|, and the place reader handles onlytext|andtrack|keys. - Description: on butter, keeping the blue card's heading and then giving the green and purple cards the same fill made doctor call the record no longer needed while it drew at 1.17:1. Verified on the base.
- Description: one helper now reads such a failure by its own key (text part, ground and mode) and counts it at each variant it names. Verified in
keptNowandacrossVariants; the adapter calls the helper once. - Testing: a grouped failure in the editor's shape keeps the place failing, a failure on another ground does not, and nothing failing reads as no longer needed. Verified: 18 tests pass, and the grouped fixture matches the editor's output.
- Commit message: the loose text match is gone, so a failure on another ground never stands for a kept place. Verified.
.changeset/doctor-kept-contrast-grouped.md: clear.packages/cli/api/theme-edit/_settings.mjs: clear, with a non-blocking note on the four-name limit of grouped variants.packages/cli/api/theme-edit/_adapter.mjs: clear; one call and no leftover import.packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: clear, with a non-blocking note on the kept record'swhen.
| const kept = /** @type {any} */ ({ | ||
| part: 'heading', | ||
| ground: 'card', | ||
| when: 'variant:blue', |
There was a problem hiding this comment.
Non-blocking: the editor writes no when for a card variant's heading (its accept line is --on heading --ground card --mode light), so a real record reaches the grouped failure through !a.when (_settings.mjs:12753), which no case covers. Dropping when here, or adding a case without it, tests the path doctor takes.
| part: k[3], | ||
| ground: k[4], | ||
| mode: k[6], | ||
| variants: named.split(/,\s*/).map(v => v.replace(/ and \d+ more$/, '')), |
There was a problem hiding this comment.
Non-blocking: the grouped text names at most four variants and then says and N more (:12052), so a record whose when is a fifth or later variant still reads as no longer needed. Records on a ground's variants carry no when and are unaffected, and no shipped part was found with five same-colored variants of its own. Carrying the variant names in the key would close it.
… 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]
The fix matched a wording no code emits: a failure across three or more of a ground's variants reads 'text ("…") in <part> on N <ground> variants', with a variants key that names the text part, the ground and the mode. That key is now read, and the failure counts at each variant it names. The loose text match is gone, so a failure on another ground never stands for a kept place. The test builds the failure in the shape the editor reports.
[skip ci]
cc6f0bc to
a420a91
Compare
d2b3d6c to
409ac97
Compare
|
/approve-spec a420a91 |
There was a problem hiding this comment.
Approved pending CI: CI has not finished on this head yet.
After the rebase the grouped case still reads correctly: with the blue card's heading kept and the green and purple cards given the same fill, astryx doctor now reports the kept problem as a problem again at 1.17:1 instead of "no longer needed".
- Optional: the new unit test's kept record carries
when: 'variant:blue', which the editor never writes for a card variant's heading, so the!a.whenpath doctor actually takes is not covered.
Claims and files checked
Review mode: full; reason: rebase
- Changeset: the doctor row no longer calls a kept problem "no longer needed" while its place still fails in a failure grouped across variants — verified with the editor on butter (3 and 9 card variants) and at
_settings.mjs:13546-13550. - Description: a grouped failure carried no place doctor could read, so the kept record was called no longer needed at 1.17:1 — verified on the base branch.
- Description: one helper,
keptNow, reads the grouped failure by its key and counts it at each variant it names — verified at_settings.mjs:13531-13582. - Description: the tests cover a grouped failure in the editor's shape, a failure on another ground, and nothing failing — verified; the fixture matches the key and text the editor writes, and the test file passes.
- Description: the preflight and replay lines are stated for an earlier commit — not evidence for this head.
.changeset/doctor-kept-contrast-grouped.md— non-blocking: it is a separate entry for a fix to a doctor row that has not shipped yet.packages/cli/api/theme-edit/_adapter.mjs— clear.packages/cli/api/theme-edit/_settings.mjs— clear.packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs— non-blocking: the untested!a.whenpath above.
|
Folded into the change it fixes, in place. |
Summary
Fixes the review finding on #13326: a failure the editor reports across several variants at once carries no place doctor can read, so a kept record there was still called "no longer needed" while its place drew at 1.17:1 (on butter: keep the blue card's heading, then give the green and purple cards the same fill). The record's standing is now read by one helper,
keptNow, which reads such a failure by its own key (text part, ground and mode) and counts it at each variant it names.Testing
theme-contrast-accepted-as-designed.test.mjs(a failure across variants, in the shape the editor reports, keeps the place failing; a failure on another ground does not; nothing failing reads as no longer needed).Gate
preflight: pass a420a91 (rebased onto main 4f7035e, own diff unchanged by patch-id from cc6f0bc)
replay: worse 0 at a420a91 (rebased onto main 4f7035e, own diff unchanged by patch-id from cc6f0bc)