Repository navigation
docs(core): Text's as and PowerSearch's statusVariant list every value their types allow - #12403
josephfarina wants to merge 3 commits into
Conversation
A new Core test reads each prop type with the TypeScript checker and fails when a documented closed string union differs from it. Docs follow the types: Text `as` now lists h1, h2 and h3; PowerSearch `statusVariant` lists tooltip (en and zh).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Changes requested: the Text as and PowerSearch statusVariant doc unions now match their types, but four things need fixing first.
packages/cli/test/core-prop-docs.test.mjsfails on this head becausepackages/cli/test/core-prop-docs.known-drift.jsonstill lists the two drifts this pull request fixes (lines 28 and 52), so delete those two lines.- The new PowerSearch
statusVarianttext (PowerSearch.doc.mjslines 106, 415 and 566, and the JSDoc atPowerSearch.tsx:382) saystooltipshows the message on a status icon, but PowerSearch renders no status icon, so withtooltipthe message is not shown at all; describe what PowerSearch actually does instead. docPropUnions.test.tsre-implements the doc-versus-type comparison thatcomparePropDocsinpackages/cli/foundation/discovery/prop-drift.mjsalready runs over Core's docs, and the two already disagree (for example onFieldStatus.variant), so extend the shared check (Chinese tables, a deprecated-member allowance) and drop the new guard, or explain in the description why the shared check cannot serve.- The description says the guard checks 464 closed-union doc props, but at this head it reads 465 (317 English, 148 Chinese) across 129 components.
The red-first evidence for the two union fixes holds: run against the old docs, the new test fails on exactly Text as and PowerSearch statusVariant in both languages.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim:
astryx componentprints each doc prop's type — verified (CLI output at base and head). - Claim: Text's
asdocs omittedh1–h3, which Text renders — verified (Text.tsx:164). - Claim: PowerSearch's
statusVariantdocs omittedtooltip, which its type accepts and every other field control documents — verified (fieldStatusPlacement.ts:18; the other field-control docs list it). - Claim: the prop types are the source of truth and docs follow them — verified against the public component API record.
- Claim: Text lists seven values; PowerSearch's English, Chinese and compact docs and its JSDoc list
tooltip— verified in the diff; thetooltipwording itself is false (finding above). - Claim: the guard compares every closed string-union doc prop with the checker's type, resolving inline unions, aliases and
keyofmaps, and lets deprecated values go undocumented — verified (test code and its self-tests). - Claim: 464 doc props across 129 components — false: 465 across 129.
- Claim: with the doc fixes reverted it fails on exactly those two props, both languages — verified (red-first run).
- Claim: its own tests cover a dropped value, an extra value, an open type and a deprecated value — verified.
- Claim: it runs in 2.7 s — consistent (about 2.4 s of import and tests here).
- Claim: scope is Text and PowerSearch — verified.
- Claim: documentation only, or every necessary generated artifact named — false: the CLI known-drift list must change too.
- Claim: no runtime, API, visual or policy change — verified (built API surface unchanged).
- Claim: no internal context in public text — verified.
- Claim: tests, typecheck, knowledge check, Prettier and ESLint pass — typecheck, knowledge check, Prettier and ESLint verified; the Core test subset passes, but the CLI's Core prop-docs test fails.
- Changeset: Text and PowerSearch docs list the values their types allow — verified.
- Changeset: a new test fails when a documented string union differs from its prop type — verified for closed string unions, with deprecated values exempt.
- File
.changeset/doc-prop-unions-match-types.md— clear. - File
packages/core/src/PowerSearch/PowerSearch.doc.mjs— finding (tooltip wording). - File
packages/core/src/PowerSearch/PowerSearch.tsx— finding (tooltip JSDoc line). - File
packages/core/src/Text/Text.doc.mjs— clear on its own; with the PowerSearch fix it needs the known-drift list updated (finding). - File
packages/core/src/docPropUnions.test.ts— findings (duplicates the shared check; description count).
Drop the separate Core union guard. The shared prop-drift check now lets a doc leave out a string value the code deprecates everywhere the type takes it from, the Core docs test also compares the Chinese tables' types, and the known-drift list loses the three entries this change fixes. PowerSearch says what tooltip shows.
There was a problem hiding this comment.
Changes requested: the Text as and PowerSearch statusVariant doc fixes, the Chinese-table check and the move to one shared checker look right, and the four points from the earlier review are fixed, but two things need fixing first.
deprecatedLiteralsinpackages/cli/foundation/discovery/prop-drift.mjs(lines 931-971) reads only unions, literals,keyofand alias references without type arguments, so a literal that a current source gives through a generic type such asExclude<All, 'xs'>or an indexed access such asBase['size']is still treated as deprecated-only andastryx doctor integration componentsaccepts a doc that leaves that current value out; please add the string-literal parts of any type node the walk does not read to the current set, and test both shapes.- The description ticks "Runtime, API, visual, and policy changes were removed or split", but the pull request still changes the comparison
astryx doctor integration componentsruns, so please untick that box or move the allowance into its own pull request.
The allowance can also move to a separate CLI pull request: the Text and PowerSearch fixes pass without it, with FieldStatus variant left in the known-drift list.
Claims and files checked
Review mode: full; reason: over-500-lines
- Claim:
astryx component <Name>prints the doc'stype— verified (CLI output in both trees). - Claim: Text's
asdocs left outh1–h3, which Text renders — verified (Text.tsx:164). - Claim: PowerSearch's
statusVariantdocs left outtooltip, which its type takes — verified (fieldStatusPlacement.ts:18). - Claim: the prop types are the source of truth, and docs follow them — verified against the Text record's element list and the public component API record.
- Claim: Text
asnow listsh1–h3— verified (Text.doc.mjs:99). - Claim: PowerSearch
statusVariantliststooltipin English, Chinese and the dense line, and says the message is not shown, is still announced, and the border keeps the status — verified (PowerSearch.doc.mjs:104-106,:413-415,:565-566;Field.tsx:276-291;PowerSearch.tsx:1546;Tokenizer.tsx:1990). - Claim: Core keeps one doc-versus-type checker, the shared one the doctor also runs — verified (the second checker is deleted; the integration adapter calls
comparePropDocs). - Claim: a doc may leave out a value deprecated in every source, so FieldStatus
variantis no longer drift — verified (the base check reports it; the head check does not). - Claim: a value any current source gives stays required — false for current sources written as generic or indexed-access types (finding).
- Claim: Core's prop-docs test compares the Chinese tables' types — verified (
core-prop-docs.test.mjs:88-108). - Claim: three entries leave the known-drift list, which only shrinks — verified.
- Claim: 183 English tables (1,951 types) and 87 Chinese tables (935 types) are judged — verified.
- Claim: with Text
asand PowerSearch's ChinesestatusVariantbroken again, both prop-docs tests fail on exactly those — verified (red-first run). - Claim:
prop-drift.test.mjscovers a value deprecated everywhere and one a current source gives — verified for a union-member source only. - Claim: scope is Text, PowerSearch, FieldStatus docs and the CLI's shared check — verified.
- Claim (unticked box): not documentation-only, since the shared check changes — verified.
- Claim (ticked box): runtime, API, visual and policy changes were removed or split — false (finding).
- Claim (ticked box): public text and artifacts hold no internal context — verified (added lines, title, body, branch and commit messages).
- Claim: the CLI discovery, doc-compiler, docs, integration and Core prop-docs tests pass (87 files, 1,727 tests) — consistent: the discovery, integration, doctor-integration and prop-docs tests plus Core's PowerSearch, Text and doc-shape tests pass (109 files, 2,731 tests); the exact set was not reproduced.
- Claim: Core's PowerSearch and doc-shape tests, the knowledge check and Prettier pass — verified.
- Changeset: Text
aslistsh1–h3and PowerSearchstatusVariantliststooltip, with text saying what PowerSearch shows — verified. - Changeset: the doctor no longer reports a union that leaves out a value deprecated in every source — verified; it also stops reporting some current values (finding).
- Title: both props list every value their types allow, judged by one shared check — verified.
- File
.changeset/doc-prop-unions-match-types.md— clear. - File
packages/cli/assets/docs/tree/check-the-props.doc.mjs— clear (states the rule the code must meet). - File
packages/cli/foundation/discovery/prop-drift.mjs— finding (generic and indexed-access sources). - File
packages/cli/foundation/discovery/prop-drift.test.mjs— clear; needs the two repro shapes with the fix. - File
packages/cli/test/core-prop-docs.known-drift.json— clear. - File
packages/cli/test/core-prop-docs.test.mjs— clear. - File
packages/core/src/PowerSearch/PowerSearch.doc.mjs— clear. - File
packages/core/src/PowerSearch/PowerSearch.tsx— clear. - File
packages/core/src/Text/Text.doc.mjs— clear.
The deprecated-value allowance for the shared prop check moves to its own change, so FieldStatus variant stays on the known-drift list here.
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because the CI run found no free capacity and was cancelled; re-run all CI jobs so the required checks run before merge.
The Text as and PowerSearch statusVariant docs now list every value their types accept, the tooltip text matches what PowerSearch shows, and the new check holds the Chinese tables' types to the code through the shared comparison. The points from the earlier reviews are resolved: the separate checker is gone, the deprecated-value allowance moved to its own change, and the fixed entries left the known-drift list.
Claims and files checked
Review mode: incremental; reason: none
- Claim:
astryx component <Name>prints the doc's type — verified (CLI output on base and head). - Claim: Text's
asdocs left outh1–h3, which Text renders — verified (Text.tsx:164). - Claim: PowerSearch's
statusVariantdocs left outtooltip, which its type takes — verified (fieldStatusPlacement.ts:18,PowerSearch.tsx:386). - Claim: the prop types are the source of truth and docs follow them — verified against the Text and PowerSearch records.
- Claim: Text
aslistsh1–h3; PowerSearch liststooltipin English, Chinese and the compact line, and says the message is not shown, is announced, and the border keeps the status type — verified (Text.doc.mjs:99;PowerSearch.doc.mjs:104-106,:413-415,:566;Field.tsx:271-281;Tokenizer.tsx:2249). - Claim: Core's docs test compares the Chinese tables' types (87 tables, 935 types) — verified (
core-prop-docs.test.mjs:88-108, counts measured). - Claim: two entries leave the known-drift list, which only shrinks — verified.
- Claim: breaking Text
asor PowerSearch's ChinesestatusVariantagain fails both tests on exactly those — verified. - Claim: scope is Text and PowerSearch — verified.
- Claim (box): documentation only, or every generated artifact named — verified (the other files are the docs test and its list; no generated file holds the old text).
- Claim (box): runtime, API, visual and policy changes removed or split — verified (built API surface unchanged).
- Claim (box): no internal context in public text — verified (added lines, commits, title, body, branch).
- Claim:
core-prop-docs.test.mjspasses (2 tests) — verified. - Claim: Core's PowerSearch, Text and doc-shape tests pass (27 files, 909 tests) — verified.
- Claim: Prettier and the knowledge check pass — verified.
- Changeset: Text
aslistsh1–h3, PowerSearchstatusVariantliststooltip, and thetooltiptext says what PowerSearch shows — verified. - Title: both props list every value their types allow — verified.
- File
.changeset/doc-prop-unions-match-types.md— clear. - File
packages/cli/test/core-prop-docs.known-drift.json— clear. - File
packages/cli/test/core-prop-docs.test.mjs— clear. - File
packages/core/src/PowerSearch/PowerSearch.doc.mjs— clear. - File
packages/core/src/PowerSearch/PowerSearch.tsx— clear. - File
packages/core/src/Text/Text.doc.mjs— clear.
- #12072 fix(templates): payment form and checkout wrap the summary below the form on a narrow first paint Author: Joey Farina <[email protected]> - #12274 fix(core): cap the Selector family's trigger-width list minimum at the viewport Author: josephfarina <[email protected]> - #12215 fix(cli): advise keeping one dependency when two packages declare one provider ID Author: Joey <[email protected]> - #12322 [experimental] export --reverse: use the project's own copy of an aliased file, or restore the page's copy with its paths entry Author: josephfarina <[email protected]> - #12403 docs(core): Text's as and PowerSearch's statusVariant list every value their types allow Author: Joey Farina <[email protected]> - #12494 fix(templates): dashboard templates use page sections, not cards, for page regions Author: Joey Farina <[email protected]> - #12282 fix(cli): theme build --check and doctor ignore which CLI release, and which command name, built a theme Author: Joey Farina <[email protected]> - #12420 fix(Chat): ChatToolCalls and ChatDictationButton without a required prop name it and the fix in development Author: Joey Farina <[email protected]> - #12205 fix(cli): equally scored icons put first one whose id the query names in full Author: Joey Farina <[email protected]> - #12455 fix(core): a theme sets the room between a checkbox or a switch and its label Author: josephfarina <[email protected]> - #12658 perf(cli): the first theme build after a CLI upgrade reuses the JavaScript it compiled from a theme's local modules Author: Joey <[email protected]> - #12323 [experimental] export: React logs no render timings while the export draws a page Author: Joey Farina <[email protected]>
|
Landed in #12713. |
Reader impact
People and agents read a component's prop values from its docs (
astryx component <Name>prints the doc'stype), and tools check a page's values against them. Two docs listed fewer values than the prop's type allows, so readers were told a valid value is wrong:aslistedspan,p,divandlabel, while Text also rendersh1,h2andh3.statusVariantlistedattachedanddetached, while it also takestooltip.Source of truth
The prop types in
packages/core/src(Text.tsx,PowerSearch.tsxthroughFieldStatusPlacement). Docs follow the types.Correction
aslists'h1' | 'h2' | 'h3'; PowerSearchstatusVariantlists'tooltip'(English and Chinese, and its compact line), and its text says what PowerSearch shows for it: the message is not shown on screen, screen readers still announce it, and the border still shows the status type.as, PowerSearchstatusVariant); the list only shrinks.Evidence
asand PowerSearch's ChinesestatusVariantbroken again, both prop-docs tests fail on exactly those.Scope
Components: Text, PowerSearch
Testing
packages/cli/test/core-prop-docs.test.mjs(2 tests); Core's PowerSearch, Text and doc-shape tests (27 files, 909 tests).pnpm check:knowledge.