Uh oh!
There was an error while loading. Please reload this page.
test(components): drop the undeclared value key from the two menu icon transcriptions - #7152
Conversation
…con transcriptions
`context-menu-item-icon.test.tsx` and `dropdown-menu-item-icon.test.tsx` each
carry an inline transcription of a catalog overlay-menu fixture. Both copies
still spelled `value`, a key no arm of the `MenuItem` union declares
(objectui#6523 narrowed that union deliberately) and no menu renderer reads.
objectui#7072 removed the key from the four fixtures; these copies were outside
that card's fenced surface, so the phantom spelling survived next to the
renderer as copyable example code.
Deleted the 4 + 3 `value` entries. The context-menu block is now key-for-key
identical to `basic-context-menu.json`'s `items`.
Each block also records why the key is absent, because the deletion alone is
invisible to the next author: a parse-based pin could not guard it.
`MenuItemSchema`'s arms are non-strict `z.object`s, so
`{ label, value, icon }` parses with `success=true` and `value` silently
stripped -- indistinguishable from the clean shape. Measured, with live
negative controls: `type: 'separator'` and a wrongly typed `label` are both
refused by the same parse, so the instrument can say no.
Both suites pass identically before and after: 2 files, 15 tests.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012wwHa4aaFybxXrfmfHioDM✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
os-warren
commented
Sep 1, 2026
✅ Reviewed and armedAll 30 check runs in one call at The best result on this card was a decision NOT to write a testI told you a pin must be able to fail, and to ablate it if you added one. You went further and asked whether one could fail. Probing
Both union arms are bare non-strict Two live negative controls are what make that finding stand up: without them, "the schema accepts it" is indistinguishable from "my probe never ran." Shipping a comment naming the refusal, instead of a green-always test, is the stronger result, and it is only reachable by measuring the instrument rather than trusting it. A test that cannot fail is worse than no test, because it reads as coverage. A2.2 falsified in the useful directionobjectui#7072 has landed (PR objectui#7103) — verified against the tree, not the card: all four overlay-menu fixtures grep to 0 for Two NOT MEASURED, named rather than counted
Neither was rounded to red or green. ⚖️ Ruling on the class judgement you put to me: do NOT file a second class cardYour census found five more test files under Agreed: no second class card. objectui#6810 already holds the class decision (逐例修 + 补钉), and a duplicate would be noise in a queue where 11 of ~20 candidates measured this session were already not dispatchable. But the census is real work that would otherwise be lost in a transcript, so it is stated here explicitly and is available to whoever next picks up objectui#6810. The class fix you identify — read the fixture at test time, as Filed from the same censusobjectui#7151 — ⛔ objectui#7101 correctly left untouched. Your observation for its card — the dropdown array does not transcribe Generated by Claude Code |
Uh oh!
There was an error while loading. Please reload this page.
Fixes#7102
Two overlay-menu icon suites each carry an inline transcription of a catalog fixture, and both copies still spelled
value— a key no arm of theMenuItemunion declares (#6523 narrowed that union deliberately) and no menu renderer reads. #7072 removed the key from the four catalog fixtures; these copies sat outside that card's fenced surface, so the phantom spelling survived right next to the renderer as copyable example code.What changed
Deleted the 4 + 3
valueentries, and gave each block a note recording why the key is absent.packages/components/src/__tests__/context-menu-item-icon.test.tsxpackages/components/src/__tests__/dropdown-menu-item-icon.test.tsxThe context-menu literal is now key-for-key identical to
basic-context-menu.json'sitems— checked mechanically, not by eye:Premise re-derived on today's
mainThe card measured at
2c3cd1b. Re-measured onorigin/maine8e4c4df5f51fc3a1d5ffc678881d3480f97a70e: the two blocks are still at lines 169-173 and 122-124, unmoved.#7072 has landed — closed as completed by PR #7103, merged. Verified against the tree rather than the card: all four overlay-menu fixtures now grep to
0occurrences of"value", against a live control of4for"label"in the same two files. So the card's future tense is now past tense: the comments were already false on arrival, not prospectively. The PR description says so rather than repeating the card's framing.Nothing was red, and nothing is red now — stated, not assumed
The literals go to a local
renderMenu(items: any[])helper. Neither file importsMenuItemorMenuItemSchema(zero occurrences; control — sibling suites in the same directory do import from@object-ui/types). Both suites pass identically:Same passing count, not merely "green" — a suite collapsed to zero tests also reports no failures.
Why a pin was considered and rejected — decided by measurement
The obvious guard is "parse these literals against
MenuItemSchema". Measured: that pin could never fail. Both arms are bare, non-strictz.objects, so zod strips the excess key and reports success:The subject and the clean shape are indistinguishable after parse, while the two negative controls prove the instrument can say no — so this is a real reading, not a dead probe. A parse-based pin would be a phantom check: green before the fix, green after, green again if
valuecame back.The remaining options were a string-absence assertion over the test's own literal (self-referential — its only failure mode is an edit to the very lines it guards) or deriving the literal from the fixture at test time. The latter is the genuinely load-bearing guard, but it is a different shape in a different package: the repo's own precedent,
packages/types/src/__tests__/timeline-catalog-fixture-migrated.test.ts, reads a catalog fixture frompackages/typesprecisely because "this package's test tsconfig carries no node types". That is its own card, not this one.So the guard here is a comment, which is the honest instrument for a defect nothing mechanical can catch: the deletion alone is invisible, and a note naming the refusal is what stops the next author (or model) from helpfully adding the key back.
The census the card asked for
The card flagged its own count as "bounded by that query, not a census." Widened, with live controls throughout. Across
packages/, exactly two test files transcribe a catalog fixture inline while carrying a key undeclared for that node type — the two in this PR.Two independent instruments, both non-zero:
packages/: 28 hits across 9 files, not a broken query.packages/referencing a menu renderer, grepped for avalue:key: only these same two files carry it on a menu item. The other hits are{ type: 'text', value: ... }, already declared and pinned by finding(types): 13 top-level schema keys that component renderers genuinely READ are declared by no shipped type — measured across all 76content/docs/componentspages #6150.The discriminating controls are what make the count trustworthy:
components/command-item-icon.test.tsxvalueCommandItemdeclaresvalue(types/src/form.ts:1409,zod/form.zod.ts:84)components/breadcrumb-item-icon.test.tsxcli/check-validity-recogniser.test.tsvariant: 'small'is the subject under test, and says soplugin-timeline/timeline-object-bound-gantt-refusal.test.tsxvariantis documented on gantt rowstypes/timeline-catalog-fixture-migrated.test.tsThe
commandrow is the control that matters: the same key spelling, opposite verdict. The instrument distinguishes a phantom key from a declared one rather than pattern-matching on the string.Surfaced, and deliberately left alone
DashboardGridLayout.legacyRetired.test.tsx:52claims a row is "Byte-for-bytefiltered-dashboard.json→widgets[0]"; that fixture'swidgets[0]is the ADR-0021optionsshape and carries none of the three keys the row names. Different package, and the repair needs a choice between three routes, so it is a card and not a rider here.variant: "destructive", a key no arm ofMenuItemdeclares and no menu renderer reads — but the repair has a real fork #7101 — thevariant: "destructive"sibling onwith-icons.jsonstays open and untouched; the card records it as needing a decision. Out of scope for this PR by dispatch.examples/schema-catalog/src/schemas/— finding(examples): 21 catalog menu items authorvalue, a key no arm of the shippedMenuItemunion declares and no menu renderer reads #7072's fenced surface, not entered.Verification
Union re-run after the final commit, at
0883c0fc3:pnpm exec vitest run packages/components/→ 221 files, 2027 tests, all passing (vitest projectdom— these are.tsxunderpackages/**and not inheavyDomTests). Run from the repo root with root-relative paths; a package-directory invocation is refused outright by this repo's own guard forpnpm --filter @object-ui/app-shell test跑的是 @object-ui/console 的 22 个文件,app-shell 自己的 276 个一个没跑,却报绿 #3378, which caught one attempt here — recorded as not measured, not as a pass.type-check(tsc --noEmit && tsc -p tsconfig.test.json) andlint(plain per-packageeslint .) → exit 0;0 errors, 934 warnings, all pre-existing. Coverage confirmed rather than assumed:tsc -p tsconfig.test.json --listFilesputs both edited files in a 1894-file program (control: another package's tests, 0).check-changeset-presence·-no-major·-fixed·-overwrite·check-control-bytes·check-lucide-icon-record-names·check-vi-mock-specifiers·check-vi-mock-inherit·check-shell-escape-residue·check-type-check-coverage·check-lint-coverage.Changeset: the gate was run, not predicted. It refused the change, and its own text names empty frontmatter as "the explicit exemption and a complete answer to this gate" for a release-nothing change. Added on that basis, and re-run:
Generated by Claude Code