feat(types): widen the overlay family's trigger to the node array every other face already accepts (#7081) - #7768
Merged
Conversation
…very other face already accepts (objectui#7081) `trigger` on DialogSchema, AlertDialogSchema, SheetSchema, DrawerSchema, PopoverSchema, HoverCardSchema and DropdownMenuSchema goes from `SchemaNode` to `SchemaNode | SchemaNode[]` on the TypeScript face, optionality kept per member, each docblock naming its renderer read site and `renderChildren`'s `Array.isArray` branch. The zod mirror already spelled the union on all nine overlay `trigger` members, every renderer hands `schema.trigger` to `renderChildren`, and every registration ships `defaultProps.trigger` as an array: the declaration catches up with what ships; the accept set does not move. Also: the seven overlay doc rows follow the declaration; the #7082 pin's legs that were built to go red on this change are re-derived to the union; the #7104 control row likewise; a new pin holds all faces on all nine members with the two already-union siblings as controls; changeset (minor, a widening). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BAZFhALsQsGqxui8sNqM8s
…psible leg at objectui#7767 `describe.each` over objects rendered `$name` as `undefined` in this vitest, so the suite title is built from a tuple; the out-of-family Collapsible counter-leg now names the card it was filed as. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BAZFhALsQsGqxui8sNqM8s
…rlay-trigger-union
Contributor
✅ 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
|
Collaborator
Author
|
Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7081
The overlay family's
triggerslot now declares, on the TypeScript face, the node array its Zod mirror, its runtime and its own shippeddefaultPropsalready accept. Seven members widen fromSchemaNodetoSchemaNode | SchemaNode[]—DialogSchema,AlertDialogSchema,SheetSchema,DrawerSchema(optional) andPopoverSchema,HoverCardSchema,DropdownMenuSchema(required) — matching the spellingContextMenuSchemaandTooltipSchemaalready carried. Optionality is kept per member;SchemaNodeitself and every other member are untouched. Each widened docblock names its renderer read site andrenderChildren'sArray.isArraybranch.Tier:
CONTRACT_REVIEW_TIER— the published TS face widens. Left in draft for thedomain:specPM seat's review; labelneeds:contract-review. Triage on the card (comment 5527740245): the validator's accept set does not move —zod/overlay.zod.tsalready spells every one of the nine overlaytriggermembersz.union([SchemaNodeSchema, z.array(SchemaNodeSchema)])— so this is the declaration catching up with what ships.Triage condition 1 — read sites (measured on
737037f2, re-measured unchanged onc8842a8b)schema.trigger.MEMBER(member access on the slot): 0 hits underpackages/(ts/tsx, excluding dist and node_modules)..trigger.MEMBER/trigger.(type|id|label|props)on ANY receiver: 2 hits, both unrelated types —app-shell/.../FlowRunsPanel.tsx:343(run.trigger.type, a flow run) and a DOM element inrecord-picker-label-association.test.tsx:106.renderChildren(schema.trigger= 10 hits (the nine overlay renderers pluscollapsible.tsx);schema.KEY.MEMBERon any key underpackages/components/src= 21 hits.tscerrors at any read site (@object-ui/typesand@object-ui/componentstype-check both exit 0), so nothing was cast away and no single-vs-array bug was hiding behind the narrow declaration.Triage condition 2 — parity pins
No
triggerrow existed on any ledger, and none was needed:origin/main(2760075f, PR #7758 for #7069) was merged into this branch before opening, and its fifth ledgerWiderThanDeclaredexcludes slots spelled throughSchemaNodeSchema, so the overlaytriggermembers are outside its population.pnpm --filter @object-ui/types type-checkandpnpm exec vitest run packages/types/(122 files, 2151 tests, the new parity runtime leg included) are green on the merged treec8842a8b.zod-mirror-parity.test.tsis not touched by this PR.What moves, file by file
packages/types/src/overlay.ts— the seven widenings, one docblock sentence each (READ SITE line, house form).packages/types/src/__tests__/overlay-node-slot-doc-types-7082.test.ts— the legs built to go red on this change are re-derived:_HoverCardTrigger, the threeAdmitsArraylegs (false→true), the fourtriggerrows inCORRECTED, the "not pre-empted" describe (now "landed", same mirror assertion, siblingnot.toBe→toBe), and the blind-replace counter-probe inverted to the singular direction. Header prose records the landing. Control legs, requiredness legs and theEmptySchema.actionrow are intact.packages/types/src/__tests__/alert-dialog-read-dialect-7104.test.ts— one line outside the dispatched surface: its "rows both faces always agreed on" control read the alert-dialogtriggerdoc row asSchemaNode; it now reads the union. Declared as a deviation below.content/docs/components/overlay/{alert-dialog,dialog,drawer,dropdown-menu,hover-card,popover,sheet}.mdx— thetriggerrow only, type text only (optionality left as is: the requiredness divergences are finding(docs): the other two overlay menu pages have #6521's defect too —dropdown-menu.mdxandcontext-menu.mdxpublish undeclared keys and hidechildren/shortcut#7073's class and are pinned by the finding(docs): six component pages publishtrigger/content/actionasComponentSchema, a different shipped type than theSchemaNodethose keys actually declare #7082 file). All seven rows sit inplaintextfences.packages/types/src/__tests__/overlay-trigger-union-7081.test.ts— NEW pin, 71 tests. Per member (the seven plus the two already-union siblings as controls): type-levelEqualto the union,AdmitsArraytrue, optionality kept (type-levelIsOptionalKeyand the source row); the mirror parses a single node and an array and refuses a non-node AT thetriggerpath; the registration's shippeddefaultProps.triggeris read off the renderer source, is an array, equals a verbatim typed copy, and parses through the mirror; the typed copy is authored into a typed document (shippedDialog…shippedDropdownMenu) — the card's own complaint as a compile — beside a singular document per member (the widening keeps every singulartriggertype-checking); the docs row publishes the union. Counter-controls:SchemaNodeuntouched (Equalagainst its five-way union), a synthetic singular slot still refuses an array (@ts-expect-error), andCollapsibleSchema.triggerstill refuses one (recorded for finding(types):CollapsibleSchema.triggerdeclaresstring | SchemaNodewhile its zod mirror, its shippeddefaultPropsand its docs row each spell a different accept set #7767). Census legs: nine union spellings in the mirror, nine in the declaration, zero bareSchemaNodetriggermembers left..changeset/7081-overlay-trigger-union.md—@object-ui/types: minor, PR finding(types,docs):BaseSchema.hiddenis declaredboolean, but the renderer evaluates it as a predicate — the third key onvisible/disabled's evaluated path, never widened #7455's "widening, not a replacement" form.Ablation (recorded from the locked run on
4da4892b; restore proven)overlay.tsreverted to3e377c93's blob (9df1af15, byte-identical to the base's): on disk union spellings 9 → 2, singular 7,objectui#7081mentions 7 → 0.tsc -p packages/types/tsconfig.test.jsonexit 2, 25 errors: 21 in the new pin (seven_*Trigger, seven_*AdmitsArray, sevenshipped*documents) and 4 in the #7082 pin (_HoverCardTriggerplus its threeAdmitsArraylegs); no error touched a control, the counter-controls or the singular documents. The new pin's runtime legs under the mutation: 9 failed / 62 passed of 71 — the seven "declaration spells the union" source rows and the two declaration census legs red, every mirror,defaultProps, renderer and docs leg green (the mirror and the renderers never moved). Restore:git checkout HEAD -- ABSOLUTE_PATHunder an EXIT/INT/TERM trap,git diff HEADempty,git hash-object=e55ec1c0=HEAD:packages/types/src/overlay.ts, counts back to 9 / 0 / 7, pin 71/71 green. The pin's type legs compile fromsrcthrough relative imports (tsconfig.test.json), so nodistis on the ablation path.Gates (exit captured before any pipe; heavy runs under the shared verify lock, shared-box seconds)
pnpm --filter @object-ui/types buildc8842a8bpnpm --filter @object-ui/types type-check(tsc --noEmit+ examples + tests projects)c8842a8bpnpm exec vitest run --maxWorkers=2 packages/types/c8842a8bpnpm --workspace-concurrency=2 --filter '@object-ui/components^...' build4da4892bpnpm --filter @object-ui/components type-check4da4892bpnpm exec vitest run --maxWorkers=2 packages/components/4da4892bpnpm --filter @object-ui/types lint4da4892b(+ the pin re-linted at48bfaadf)node scripts/check-changeset-presence.mjsc8842a8bnode scripts/check-changeset-fixed.mjs·check-changeset-no-major.mjsc8842a8bnode scripts/check-control-bytes.mjsc8842a8bpnpm check:spec-symbols·check:doc-types·check:doc-fences·node scripts/check-doc-links.mjsc8842a8bpnpm check:doc-snippets--build-filterclosure is 26 packages (the whole workspace); narrowed measurement instead: all 7 changed doc lines sit inplaintextfences andTS_FENCE_LANGUAGESists/tsx/typescript, so the gate compiles nothing this PR touchescheck-governed-merges.mjs --test, final file list)c8842a8bThe components legs were run at
4da4892b; the two later commits touch only a test file underpackages/typesand the merge oforigin/main, neither of which the components package imports.Deviations from the dispatch
alert-dialog-read-dialect-7104.test.ts(one control line) edited outside the named file surface — it reads a doc row this PR changes and would have gone red.:355toContextMenuSchemaand:608toTooltipSchema; on the tree it is the reverse (:355Tooltip,:608ContextMenu). Both already carried the union; nothing changes.describe.eachtitle uses a tuple (%s) rather than$name, which renderedundefinedunder this vitest.dropdown-menu.mdx: only thetriggerrow changed, so its trailing comment no longer aligns with the sibling rows' column (re-aligning would touch rows outside the diff).Out of scope, filed
CollapsibleSchema.triggerdeclaresstring | SchemaNodewhile its zod mirror, its shippeddefaultPropsand its docs row each spell a different accept set #7767 —CollapsibleSchema.trigger(disclosure.ts:97,string | SchemaNode) has the same asymmetry against its mirror (disclosure.zod.ts:52, the union), its shipped default (collapsible.tsx:51, an array) and its docs row (collapsible.mdx:15,SchemaNode). The only non-overlaytriggerwith the shape (repo-wide grep). Not widened here.Session:
https://claude.ai/code/session_01BAZFhALsQsGqxui8sNqM8s🤖 Generated with Claude Code
https://claude.ai/code/session_01BAZFhALsQsGqxui8sNqM8s
Generated by Claude Code