Repository navigation
doctor: list the contrast problems an editor theme keeps as designed - #13272
josephfarina wants to merge 7 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 owner decision about this check, and four fixes are needed whatever that decision is.
- Approval waits on an engineering owner deciding whether the stable
doctormay report the experimental theme editor's contrast acceptances, because no current record covers thetheme-accepted-contrastcheck and the theme-editor exception inspec:AST-017FR27 does not listdoctor. editorKeptContrastAtlists every stored acceptance (packages/cli/api/theme-edit/_adapter.mjs:1016), so after an accepted color changes, doctor still says the problem is kept as designed while the editor'sshowlists it as an open problem again.editorKeptContrastreads the disk in doctor's entry (packages/cli/api/doctor/doctor.mjs:3698-3703), whicharchitecture:cli-surfaceINV21 keeps in the subject's adapter, so it belongs inapi/doctor/_adapter.mjs.- The gate looks for
themesbeside the nearestpackage.json(doctor.mjs:3699) while the reader resolves the app with the editor'sprojectRoot, so from a subfolder whosepackage.jsononly sets"type": "module"doctor lists nothing although the editor finds the theme. - The description's After example says
3.9:1where the same fixture prints2.09:1, and its Scope list ticks "One defect is restored" for a change that adds a new check.
An engineering owner records the decision by naming or adding the record that governs this check, or by commenting /approve-spec <full head SHA>; the author may do so as an engineering owner. Adding a doctor assertion to the "lapses when the variant fill changes" test would cover the first fix.
Claims and files checked
- Review mode: full; reason: no-earlier-review
- Claim: doctor lists each contrast problem an editor theme keeps, with part, variant, mode, ratio and reason: false in part, it also lists acceptances the editor no longer applies (
_adapter.mjs:1016). - Claim: read through the editor's own settings reader: verified (
_adapter.mjs:1016). - Claim: works before the theme is added to the app: verified (
editedThemesreads onlythemes/). - Claim: the editor is loaded only for an app with a
themesfolder: verified (doctor.mjs:3699-3701), with the root caveat above. - Claim: doctor listed no acceptance before: verified (no such check at the base).
- Claim: the After example prints 3.9:1: false, the same fixture prints 2.09:1.
- Claim: the regression test shows doctor listing a variant acceptance: partly, the test calls the two helpers rather than doctor.
- Claim: one defect is restored: false, this adds a new check.
- Claim: no new public API is hidden under a bug-fix label: verified.
- Claim: no internal context in public text: verified.
- Claim: touched tests and eslint pass: verified on the head.
- File
.changeset/doctor-kept-contrast.md: overstates what is listed (see the acceptance finding). - File
packages/cli/api/doctor/doctor.mjs: adapter and root findings. - File
packages/cli/api/doctor/theme-checks.mjs: clear. - File
packages/cli/api/theme-edit/_adapter.mjs: lapsed-acceptance finding. - File
packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: no assertion for doctor itself or for a lapsed pair.
0735f64 to
8147d18
Compare
5d139fe to
5cff489
Compare
There was a problem hiding this comment.
Not ready yet: approval waits on an owner decision about this check, and two fixes are needed whatever that decision is. The four fixes from the earlier review are in.
- Approval waits on an engineering owner deciding whether the stable
doctormay report the experimental theme editor's contrast acceptances, and how a lapsed one reads, because no current record covers thetheme-accepted-contrastcheck and the theme-editor exception inspec:AST-017FR27 does not listdoctor. - After a person changes an accepted color so the place passes,
doctorstill warns that the kept problem "is a problem again" while the editor'sshowlists no problem there, and a lapsed line prints the accepted ratio instead of the one drawn now (packages/cli/api/theme-edit/_adapter.mjs:1038,packages/cli/api/doctor/theme-checks.mjs:2468). - The new
warncarries nofix, although the publishedDoctorChecktype says one is always present onwarnandfail(packages/cli/api/doctor/doctor.type.mjs:23,packages/cli/api/doctor/theme-checks.mjs:2471-2476).
An engineering owner records the decision by naming or adding the record that governs this check, or by commenting /approve-spec <full head SHA>; the author may do so as an engineering owner. A case in the "lapses when the variant fill changes" test where the new color passes would cover the first fix.
Claims and files checked
Review mode: full; reason: rebase
- Claim: doctor lists each kept contrast problem with its part, variant, mode, ratio and reason, before the theme is added: verified (
theme-checks.mjs:2458-2459, and a doctor run on the test fixture). - Claim: a record whose colors changed is named apart, as a problem again, with a warning: verified for a pair that still fails; also applied to a place that passes again (second bullet above).
- Claim: the records are read by the editor itself, whether or not the theme has been added: verified (
theme-edit/_adapter.mjs:1015-1055). - Claim: the disk is read in doctor's adapter, which loads the editor only when a folder at or above the working one holds a
themesfolder: verified (doctor/_adapter.mjs:1948-1956). - Claim: doctor listed no acceptance before: verified (no such check at the base).
- Claim: the regression test shows doctor listing a variant acceptance: partly, the test calls the check builder and the editor reader rather than a doctor run; a doctor run lists it.
- Claim: a new doctor check with no new command or option, no tagalong and no public API: verified.
- Claim: no internal context in public text: verified.
- Claim: the touched tests, contrast tests, strict typecheck and eslint pass: verified for the touched, doctor and contrast suites, eslint and the strict typecheck; the full theme-editor suite was not rerun.
- File
.changeset/doctor-kept-contrast.md: clear. - File
packages/cli/api/doctor/_adapter.mjs: clear. - File
packages/cli/api/doctor/doctor.mjs: clear. - File
packages/cli/api/doctor/theme-checks.mjs: lapsed wording, ratio and missingfix. - File
packages/cli/api/theme-edit/_adapter.mjs: a passing place marked as a problem; the secondwithAcceptedpass is a no-op. - File
packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: no case for a place that passes again, and no doctor run.
|
Covers the theme-editor reading this pull request records (the owner's ruling on the contrast readings): the doctor row names lapsed acceptances apart, as a warning, and its stable text names no experimental surface. |
|
/approve-spec 5cff489 |
There was a problem hiding this comment.
Changes requested: the engineering owner's ruling at this head settles that astryx doctor may list the contrast problems an editor theme keeps as designed, and two fixes remain.
- After a person changes an accepted color so the pair passes,
doctorstill warns that the kept problem "is a problem again" and prints the accepted ratio rather than the one drawn now (packages/cli/api/theme-edit/_adapter.mjs:1038,packages/cli/api/doctor/theme-checks.mjs:2468). - The new
warncarries nofix, thoughDoctorCheckdocumentsfixas always present onwarn(packages/cli/api/doctor/doctor.type.mjs:23); since the ruling keeps the experimental editor out of doctor's text, give it a fix that names no experimental surface, or keep the checkinfo.
#13326 says it makes both fixes; once it lands in this branch, the new head gets its own review.
Claims and files checked
Review mode: same-head; reason: none
- Changeset: doctor lists each kept contrast problem with its part, variant, mode, ratio and reason, before the theme is added to the app: verified (theme-checks.mjs:2458-2466; editedThemes reads the editor's themes folder, no theme add needed).
- Changeset: one whose colors changed is named apart, as a problem again, with a warning: true for a pair that still fails; false where the new colors pass (theme-edit/_adapter.mjs:1038, theme-checks.mjs:2468), the first finding above.
- Description: read by the editor itself, whether or not the theme has been added: verified (theme-edit/_adapter.mjs:1015-1055).
- Description: one whose colors changed covers nothing and is named apart: verified for a failing pair; also applied to a place that passes, the first finding above.
- Description: the disk is read in doctor's adapter, which loads the editor only when a themes folder sits at or above the working folder: verified (doctor/_adapter.mjs:1948-1956; doctor.mjs:3632 only calls it).
- Description, before: doctor never listed an acceptance: verified (no such check at the base).
- Description, after: the line format, and a changed-color record listed apart with a warning as a problem again: format verified; false for a place that passes (the first finding above).
- Description, regression test: doctor lists a variant acceptance from a theme made with new: partly: the test calls the two helpers, not doctor's run (theme-contrast-accepted-as-designed.test.mjs:241-249).
- Description, scope: a new doctor check, no new command or option: verified.
- Description, scope: separable tagalongs removed; no public API, default or interaction model hidden; no internal context in public text: verified (no tagalong; no export changes; no internal context found in the added lines, title, body, branch or commit message).
- Description, testing: touched tests, the theme-editor tests, the strict typecheck and eslint: partly checked: touched and nearby suites pass, eslint clean, strict typecheck passes once the neutral theme is built; the full theme-editor suite was not run.
- Description, gate: local preflight and replay results: not reproducible here; at this head the review-pass and review-signal workflows pass and no full CI run exists (the commit skips CI).
- Description, gate: review findings are fixed by the paired pull request: #13326 states both fixes and targets this branch; this head still has both defects.
- Owner comment: the row names lapsed acceptances apart, as a warning, and its stable text names no experimental surface: verified for the label and message (theme-checks.mjs:2456-2475); the warning still has no fix.
.changeset/doctor-kept-contrast.md: its changed-color sentence is covered by the first finding above; otherwise clear.packages/cli/api/doctor/_adapter.mjs: clear.packages/cli/api/doctor/doctor.mjs: clear.packages/cli/api/doctor/theme-checks.mjs: the first finding above (wording, ratio, status) and the second finding above (no fix on warn).packages/cli/api/theme-edit/_adapter.mjs: the first finding above (in-effect mark for a passing place); non-blocking: redundant second withAccepted pass.packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: non-blocking: calls the helpers only; no passing-place case.
5cff489 to
eb3534f
Compare
8147d18 to
c77b318
Compare
|
/approve-spec eb3534f |
There was a problem hiding this comment.
Changes requested: an engineering owner's ruling settles that astryx doctor may list the contrast problems an editor theme keeps as designed, and two fixes remain.
- After a person changes an accepted color so the pair passes,
doctorstill warns that the kept problem "is a problem again" and prints the accepted ratio rather than the one drawn now (packages/cli/api/theme-edit/_adapter.mjs:1040,packages/cli/api/doctor/theme-checks.mjs:2468). - The new
warncarries nofix, thoughDoctorCheckdocumentsfixas always present onwarn(packages/cli/api/doctor/doctor.type.mjs:23); since the ruling keeps the experimental editor out of doctor's text, give it a fix that names no experimental surface, or keep the checkinfo.
#13326, still open on top of this branch, is titled for the first fix; once the fixes land here, the new head gets its own review.
Claims and files checked
Review mode: same-head; reason: none
- Changeset: doctor lists each kept contrast problem with its part, variant, mode, ratio and reason, before the theme is added to the app: verified (
theme-checks.mjs:2458-2466). - Changeset: one whose colors changed is named apart, as a problem again, with a warning: true for a pair that still fails; false where the new colors pass (
theme-edit/_adapter.mjs:1040,theme-checks.mjs:2468), the first finding above. - Description: read by the editor itself, whether or not the theme has been added: verified (
theme-edit/_adapter.mjs:1017-1057). - Description: one whose colors changed covers nothing and is named apart: verified for a failing pair; also applied to a place that passes, the first finding above.
- Description: the disk is read in doctor's adapter, which loads the editor only when a themes folder sits at or above the working folder: verified (
doctor/_adapter.mjs:1948-1956;doctor.mjs:3632only calls it). - Description, before: doctor never listed an acceptance: verified (no such check at the base).
- Description, after: the line format, and a changed-color record listed apart with a warning as a problem again: format verified; false for a place that passes, the first finding above.
- Description, regression test: doctor lists a variant acceptance from a theme made with
new: partly: the test calls the two helpers, not doctor's run (theme-contrast-accepted-as-designed.test.mjs:241-249). - Description, scope: a new doctor check, no new command or option: verified.
- Description, scope: no tagalongs; no public API, default or interaction model hidden; no internal context in public text: verified.
- Description, testing: the touched tests, the theme-editor tests, the strict typecheck and eslint: verified for the touched test, the theme editor's contrast suites, doctor's suites, the strict typecheck and eslint; the rest of the theme-editor suite was not run.
- Description, gate: local preflight and replay results at this head: not reproducible here; no CI test run exists for this code.
- Description, gate: rebased onto main with the pull request's own diff unchanged: verified (the patch is identical).
- Owner comment: lapsed acceptances are named apart, as a warning, and the stable text names no experimental surface: verified for the label and message (
theme-checks.mjs:2456-2477); the warning still has no fix. .changeset/doctor-kept-contrast.md: its changed-color sentence is covered by the first finding above; otherwise clear.packages/cli/api/doctor/_adapter.mjs: clear.packages/cli/api/doctor/doctor.mjs: clear.packages/cli/api/doctor/theme-checks.mjs: the first finding above (wording, ratio, status) and the second (no fix on warn).packages/cli/api/theme-edit/_adapter.mjs: the first finding above (in-effect mark for a passing place); non-blocking: a redundant secondwithAcceptedpass.packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: non-blocking: calls the helpers only; no passing-place case.
|
/approve-spec a420a91 |
There was a problem hiding this comment.
Not ready yet: approval waits on an engineering owner decision about how doctor shows a kept contrast problem that no longer applies, and three fixes are needed whatever that decision is.
- Approval needs an engineering owner to decide whether the earlier ruling on this pull request, which names lapsed acceptances apart "as a warning", covers this head's info-only row (
packages/cli/api/doctor/theme-checks.mjs:2479); an engineering owner records it here, for example with/approve-spec <full head SHA>, and the author may do so as an engineering owner. - After a person keeps a heading on a
#333333card and then gives five more card variants the same fill,doctorsays the kept problem "no longer holds, because a color changed" at "1.66:1, kept at 1.66:1" though the kept pair is drawn unchanged (packages/cli/api/doctor/theme-checks.mjs:2486-2489, viapackages/cli/api/theme-edit/_settings.mjs:13546-13556), so name a cause only after checking the record's colors, or keep that pair out of the across-variants grouping. .changeset/doctor-kept-contrast-grouped.mdannounces that the row "no longer" misreads grouped failures, but the row first ships in this pull request, so the note describes a fix no release needs and should be deleted.- The description's Evidence line says a changed-color record is listed "with a warning", but every row is now
infoand a place that passes reads "no longer needed", so update it once the decision above is made.
Both findings from the last review are fixed.
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0): none
- Release note: doctor lists each kept contrast problem with its part, variant, mode, ratio and reason, before the theme is added: verified (
theme-checks.mjs:2460-2464; test lines 240-249). - Release note: a record whose colors changed is named apart as a problem again at the ratio drawn now: verified (
theme-checks.mjs:2465-2467; test lines 264-269); in the grouped-variant case doctor also names a record whose colors did not change, finding above. - Release note: or as no longer needed where its place now passes: verified (
theme-checks.mjs:2468-2470; test lines 273-285). - Release note: the row is information: verified (
theme-checks.mjs:2479). - Second release note: the row no longer calls a kept problem no longer needed while a grouped failure still covers it: true for a record kept without a variant (
_settings.mjs:13546-13550), but the row is new in this pull request, finding above. - Description: doctor lists the kept problems before the theme is added: verified.
- Description: read by the editor itself, whether or not the theme has been added: verified (
theme-edit/_adapter.mjs:1018-1044). - Description: a record whose colors changed covers nothing and is named apart: verified; also applied to an unchanged pair in the grouped case, finding above.
- Description: the disk is read in doctor's adapter, which loads the editor only when a themes folder sits at or above the working folder: verified (
doctor/_adapter.mjs:1948-1956,doctor.mjs:3632). - Description, before: doctor never listed an acceptance: verified.
- Description, after: the line format: verified; listed apart "with a warning": false, finding above.
- Description, regression test: doctor lists a variant acceptance from a theme made with
new: partly; the test calls the two helpers, not doctor's run. - Description, scope: a new doctor check, no new command or option, no hidden public API, no internal context: verified.
- Description, testing: the touched tests, the theme-editor tests, the strict typecheck and eslint: verified for the touched tests, doctor's and the editor's contrast suites and eslint; the strict typecheck reports errors only in two templates that need an unbuilt theme.
- Description, gate: the preflight and replay results describe an earlier revision; not reproduced for this one.
- Earlier ruling: lapsed acceptances are named apart and the stable text names no experimental surface: verified (
theme-checks.mjs:2477-2495); "as a warning": the row is info, decision pending. .changeset/doctor-kept-contrast-grouped.md: finding above (delete)..changeset/doctor-kept-contrast.md: clear.packages/cli/api/doctor/_adapter.mjs: clear.packages/cli/api/doctor/doctor.mjs: clear.packages/cli/api/doctor/theme-checks.mjs: the cause finding above; the info status waits on the decision.packages/cli/api/theme-edit/_adapter.mjs: non-blocking: a secondwithAcceptedpass that changes nothing.packages/cli/api/theme-edit/_settings.mjs: the grouped branch feeds the cause finding; non-blocking: grouped variants and ratio are read from the problem's sentence.packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: non-blocking: the new cases keep a card heading with a variant, a shape the editor does not record, and the doctor cases call the helpers only.
| 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: this reads the variants from the problem's sentence, which names at most four (… and N more, built at line 12813), and the ratio is the group's lowest; a group whose text has no part of its own also gets an empty part from the key. Carrying the names, the part and each variant's ratio as fields on the grouped problem would remove the parsing.
|
/approve-spec a420a91 |
|
/approve-spec b3f8879 |
There was a problem hiding this comment.
Changes requested: one fix is needed. The engineering owner's approvals settle the info-only theme-accepted-contrast row, and the three findings from the last review are fixed.
- The new
keptRecordsandkeptAsDesignedconstants sit betweenoneNotePerCauseand its JSDoc inpackages/cli/api/theme-edit/_settings.mjs, so the CLI strict typecheck that CI runs fails withTS7006: Parameter 'list' implicitly has an 'any' typeat line 12779; move the two constants above the comment block at line 12747.
Non-blocking: keptAsDesigned repeats withAccepted's record match without its ratio check, so one shared predicate would keep the two in step.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules (0)
- Release note: doctor lists each kept contrast problem with its part, variant, mode, ratio and reason, before the theme is added: verified (
doctor/theme-checks.mjs:2462-2464, test lines 197-252). - Release note: one whose colors changed is named apart, as a problem again at the ratio drawn now, or as no longer needed where its place passes: verified (
theme-checks.mjs:2465-2470, test lines 296-336). - Release note: the row is information: verified (
theme-checks.mjs:2479). - Description: the editor itself reads the records, whether or not the theme has been added: verified (
theme-edit/_adapter.mjs:1018-1044). - Description: doctor's adapter reads the disk and loads the editor only when a folder at or above the working one holds a themes folder: verified (
doctor/_adapter.mjs:1948-1956). - Description: before this change, doctor listed no acceptance: verified (no such check on the base).
- Description: a kept pair stays kept while other variants of its ground fail beside it: verified (
theme-edit/_settings.mjs:12795, test lines 254-294). - Description: the regression test lists a variant acceptance from a theme made with
new: verified (test lines 197-252). - Description: a new doctor check with no new command, option or hidden public API: verified.
- Description: tested with the CLI strict typecheck: false (TS7006 at
_settings.mjs:12779). .changeset/doctor-kept-contrast.md: clear.packages/cli/api/doctor/_adapter.mjs: clear.packages/cli/api/doctor/doctor.mjs: clear.packages/cli/api/doctor/theme-checks.mjs: clear.packages/cli/api/theme-edit/_adapter.mjs: non-blocking (secondwithAcceptedpass).packages/cli/api/theme-edit/_settings.mjs: blocking (TS7006 at 12779); non-blocking (duplicated record match, sentence parsing).packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: clear.
| (a.when ?? '') === at.when && | ||
| a.mode === at.mode && | ||
| a.color === pair.color && | ||
| a.groundColor === pair.groundColor, |
There was a problem hiding this comment.
Non-blocking: this repeats withAccepted's record match (lines 13696-13705) but leaves out its ratio check (at.ratio + 0.005 >= a.ratio), so a see-through kept pair drawn lower stays out of the grouping without being accepted. One shared predicate for "the record at this place and pair" would keep the two in step.
b3f8879 to
e0c3a28
Compare
|
/approve-spec e0c3a28 |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. The engineering owner's approvals settle the information-only theme-accepted-contrast row, and the typecheck failure from the last review is fixed.
Non-blocking: keptAsDesigned repeats withAccepted's record match without its ratio check, and no test drives doctor() itself, so the themes gate and the row's place in the report are covered only by direct calls to the reader.
Claims and files checked
Review mode: full; reason: history
- Release note: doctor lists each kept contrast problem with its part, variant, mode, ratio and reason, before the theme is added: verified (
doctor/theme-checks.mjs:2460-2464; adoctor()run on a theme made withnewand never added) - Release note: a record whose colors changed is named apart, as a problem again at the ratio drawn now, or as no longer needed where its place passes: verified (
theme-checks.mjs:2465-2470;doctor()runs after a failing and a passing fill change) - Release note: the row is information: verified (
theme-checks.mjs:2479) - Description: the editor itself reads the records, whether or not the theme has been added, because an app copy carries no settings: verified (
theme-edit/_adapter.mjs:1018-1044; the app copy writes only the doc, module, stylesheet and fonts files) - Description: doctor's adapter reads the disk and loads the editor only when a folder at or above the working one holds a themes folder: verified (
doctor/_adapter.mjs:1948-1956) - Description: before this change doctor listed no acceptance: verified (no such check in the base's doctor)
- Description: the listed format, and changed records listed apart while the row stays information: verified (
doctor()runs in every state) - Description: a kept pair stays kept while other variants of its ground fail beside it: verified (three other card variants failing in another fill leave the record kept;
_settings.mjs:12795) - Description: the regression test lists a variant acceptance from a theme made with
new: verified (test lines 240-250) - Description: a new doctor check, with no new command, option, public API or hidden default: verified
- Description: no tagalongs, and no internal context in public text: verified
- Description: tested with the touched tests, the editor's tests, the CLI strict typecheck and eslint: verified at this head (touched test, editor acceptance and grouping suites, doctor suites, strict typecheck, eslint)
- Description: this revision differs from the last reviewed one only by moving one helper above a doc comment: verified (only the
oneNotePerCausedoc comment moved) .changeset/doctor-kept-contrast.md: clearpackages/cli/api/doctor/_adapter.mjs: clearpackages/cli/api/doctor/doctor.mjs: clearpackages/cli/api/doctor/theme-checks.mjs: clearpackages/cli/api/theme-edit/_adapter.mjs: non-blocking (secondwithAcceptedpass, editor context opened per theme)packages/cli/api/theme-edit/_settings.mjs: non-blocking (record match repeated without the ratio check; variants read from the problem's sentence)packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: non-blocking (no test drivesdoctor()itself)
| if (!kept.length) continue; | ||
| const ctx = await context(root); | ||
| const res = await resolvedTokens(ctx, slug); | ||
| const now = withAccepted( |
There was a problem hiding this comment.
Non-blocking: contrastProblems already returns withAccepted(data, said, res) (_settings.mjs:13318), so this second pass changes nothing; keptNow(a, await contrastProblems(ctx, data, res)) reads the same. context(root) two lines up can also move above the loop, so a project with several editor themes opens it once.
| undo: 'astryx experimental theme editor set bv contrast-accepted none --on badge --when variant:info --ground badge --mode light', | ||
| }), | ||
| ]); | ||
| // doctor lists it too, read from the editor settings, with its variant. |
There was a problem hiding this comment.
Non-blocking: these assertions call the reader and acceptedContrastCheck directly, so the themes gate in doctor/_adapter.mjs and the push at doctor.mjs:3632 are untested. One (await doctor({cwd})).data.checks.find(c => c.id === 'theme-accepted-contrast') assertion here would cover both; it returns the same row today.
An editor theme can keep a contrast problem as designed, with a reason. doctor now lists each one, with its part, variant, mode, ratio and reason, read by the editor itself, whether or not the theme has been added to the app. One whose colors changed since covers nothing and is named apart, with a warning, as the editor's show lists it as open again. The disk is read in doctor's adapter, which loads the editor only when a folder at or above the working one holds a themes folder. [skip ci]
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]
… 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]
…e same fill A pair the theme keeps as designed is left out of the across-variants grouping, so the record still covers it while other variants fail beside it, and doctor never calls it lapsed while its colors are unchanged. The grouped changeset goes: that row first ships here. [skip ci]
e0c3a28 to
c5f922e
Compare
c77b318 to
4bcfd12
Compare
|
/approve-spec c5f922e |
There was a problem hiding this comment.
Changes requested: one fix is needed. The engineering owner's approvals still settle the information-only theme-accepted-contrast row, and the rebased revision passes the strict typecheck, lint and the doctor and editor tests.
- Miss: when the editor cannot render the components (react-dom not found, or another render failure once its census cache is rebuilt),
editorKeptContrastAt(packages/cli/api/theme-edit/_adapter.mjs:1028-1035) still sorts every record withkeptNow, soastryx doctorsays each kept contrast problem "is no longer needed: its colors changed and it now passes" though nothing was measured; skipkeptNowwhenctx.uncheckedis set (list the records as kept or not checked) and add a test that clears the census cache and react-dom.
Non-blocking: keptAsDesigned repeats withAccepted's record match without its ratio check, and no test drives doctor() itself.
Claims and files checked
Review mode: full; reason: rebase
- Release note: doctor lists each kept contrast problem with its part, variant, mode, ratio and reason, before the theme is added: verified (
doctor/theme-checks.mjs:2460-2464; adoctor()run on a theme made withnewand never added) - Release note: a record whose colors changed is named apart as a problem again at the ratio drawn now: verified (
theme-checks.mjs:2465-2467;doctor()after a failing fill change) - Release note: or as no longer needed where its place now passes: verified where the theme is measured; false when the editor cannot render the components (
theme-edit/_adapter.mjs:1028-1035) - Release note: the row is information: verified (
theme-checks.mjs:2479) - Description: the editor itself reads the records, whether or not the theme has been added, because an app copy carries no settings: verified (
theme-edit/_adapter.mjs:1018-1044) - Description: doctor's adapter reads the disk and loads the editor only when a folder at or above the working one holds a themes folder: verified (
doctor/_adapter.mjs:1948-1956) - Description: before this change doctor listed no acceptance: verified (no such check in the base's doctor)
- Description: the listed format, and changed records listed apart while the row stays information: verified (
doctor()runs in each state), apart from the unrendered case above - Description: a kept pair stays kept while other variants of its ground fail beside it: verified (the five-variant test passes;
_settings.mjs:13194) - Description: the regression test lists a variant acceptance from a theme made with
new: verified (test lines 241-249) - Description: a new doctor check, with no new command, option, public API, visual representation or default: verified
- Description: no tagalongs, and no internal context in public text: verified
- Description: tested with the touched tests, the editor's tests, the CLI strict typecheck and eslint: verified at this revision (424 tests, strict typecheck and eslint clean)
- Description: the gate lines record a run at the revision before the rebase: not evidence for this revision
.changeset/doctor-kept-contrast.md: its "no longer needed" sentence is false only in the unrendered state, closed by the fix belowpackages/cli/api/doctor/_adapter.mjs: clearpackages/cli/api/doctor/doctor.mjs: clearpackages/cli/api/doctor/theme-checks.mjs: clearpackages/cli/api/theme-edit/_adapter.mjs: blocking (unrendered census); non-blocking (secondwithAcceptedpass, editor context opened per theme)packages/cli/api/theme-edit/_settings.mjs: non-blocking (record match repeated without the ratio check; variants read from the problem's sentence)packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: non-blocking (no test drivesdoctor()or an unrendered census)
…s kept Where the editor cannot draw the components (react-dom missing, a render that fails), nothing is measured, so each kept record is listed as kept, never as "no longer needed". [skip ci]
|
/approve-spec 091bd9c |
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet. With react-dom missing and the editor's census cache cleared, astryx doctor now lists each kept contrast problem as kept instead of "no longer needed", and the engineering owner's approvals still settle the information-only theme-accepted-contrast row.
Non-blocking:
theme-contrast-kept-unchecked.test.mjspasses without the fix, because its mockedcontext()keeps the real, measured census; making the mockedpartDatathrow a render failure, or removing the census cache and react-dom, would make it guard the fix.- In that unrendered state a record whose colors changed also reads "kept as designed" at its recorded ratio; a word that it was not measured would help.
- Earlier notes stand:
keptAsDesignedrepeatswithAccepted's record match without its ratio check, and no test drivesdoctor()itself.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules (0): none
- Release note: doctor lists each kept contrast problem with its part, variant, mode, ratio and reason before the theme is added: verified (
doctor/theme-checks.mjs:2460-2464;theme-contrast-accepted-as-designed.test.mjs:240-249) - Release note: a record whose colors changed is named apart as a problem again at the ratio drawn now: verified where the theme is measured (
doctor()after a failing fill change: 2.3:1, kept at 2.09:1) - Release note: or as no longer needed where its place now passes: verified where the theme is measured (test lines 321-327); no longer said when the components cannot render (
theme-edit/_adapter.mjs:1032-1036) - Release note: the row is information: verified (
theme-checks.mjs:2479) - Description: the editor itself reads the records, whether or not the theme has been added: verified (
theme-edit/_adapter.mjs:1019-1052) - Description: doctor's adapter reads the disk and loads the editor only when a folder at or above the working one holds a themes folder: verified (
doctor/_adapter.mjs:1948-1956) - Description: before this change doctor listed no acceptance: verified (no such check at the base)
- Description: the listed format, and changed records listed apart while the row stays information: verified (
doctor()runs in each state) - Description: a kept pair stays kept while other variants of its ground fail beside it: verified (the five-variant test passes;
_settings.mjs:13194) - Description: the regression test lists a variant acceptance from a theme made with
new: verified (test lines 240-249) - Description: a new doctor check, with no new command, option, public API, visual representation or default: verified
- Description: no tagalongs, and no internal context in public text: verified
- Description: tested with the touched tests, the editor's tests, the CLI strict typecheck and eslint: verified at this revision (20 tests, typecheck and eslint clean)
- Description: the gate lines say pending: not evidence for this revision
.changeset/doctor-kept-contrast.md: clearpackages/cli/api/doctor/_adapter.mjs: clearpackages/cli/api/doctor/doctor.mjs: clearpackages/cli/api/doctor/theme-checks.mjs: clearpackages/cli/api/theme-edit/_adapter.mjs: non-blocking (unrendered state not named in the row; secondwithAcceptedpass; editor context opened per theme)packages/cli/api/theme-edit/_settings.mjs: non-blocking (record match repeated without the ratio check; variants read from the problem's sentence)packages/cli/api/theme-edit/theme-contrast-accepted-as-designed.test.mjs: non-blocking (no test drivesdoctor())packages/cli/api/theme-edit/theme-contrast-kept-unchecked.test.mjs: non-blocking (passes without the fix)
| return { | ||
| ...real, | ||
| context: async (/** @type {string} */ root) => ({ | ||
| ...(await real.context(root)), |
There was a problem hiding this comment.
Non-blocking: this keeps the real context's measured census and only adds unchecked, so editorKeptContrastAt from the previous revision measures it too and finds the record in effect: run against that revision's adapter, this test passes. To guard the fix, make the mocked partData (_parts.mjs) throw an AstryxError with ERR_RENDER_MISSING_DEPENDENCY, so the real context() returns its empty census, or remove the census cache and the react-dom link as a person meets it.
| // record is listed as kept, never as lapsed.) | ||
| if (ctx.unchecked) { | ||
| for (const a of kept) | ||
| out.push({slug, ...a, inEffect: true, ratioNow: null}); |
There was a problem hiding this comment.
Non-blocking: here a record whose colors changed also reads "kept as designed" at its recorded ratio (two badge records, one with its fill changed to #46b8da, both read at 2.09:1 with react-dom unlinked), and the row does not say nothing was measured. A clause such as "not checked: the components could not be rendered" would tell the person why the listing may be out of date.
User impact
astryx doctorlists each contrast problem an editor theme keeps as designed, with its part, variant, mode, ratio and reason, before the theme is added to the app.Problem and solution fit
An editor theme can keep a contrast problem as designed with a reason. doctor now lists each one (
theme-accepted-contrast), read by the editor itself, whether or not the theme has been added (an app copy carries no settings). One whose colors changed since covers nothing and is named apart. The disk is read in doctor's adapter, which loads the editor only when a folder at or above the working one holds a themes folder.Evidence
<theme>: <part> (<variant>) on <ground> in <mode> at <ratio>:1 (<reason>); one whose colors changed since is listed apart, still as info: a problem again at the ratio drawn now, or no longer needed where its place now passes. A kept pair stays kept while other variants of its ground fail beside it.theme-contrast-accepted-as-designed.test.mjs(doctor lists a variant acceptance from a theme made withnew).Scope
Components: theme editor (doctor)
Testing
The touched tests, the stack's theme-editor tests, the CLI strict typecheck and eslint, on this layer's tree.
Gate
preflight: pass 091bd9c
replay: worse 0 at 091bd9c