Skip to content

[docs] Core: list the props ComplexSelector, Selector, Toast and ContextMenuItem take - #12541

Closed
josephfarina wants to merge 6 commits into
mainfrom
josephfarina/core-docs-missing-props
Closed

josephfarina wants to merge 6 commits into
mainfrom
josephfarina/core-docs-missing-props

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Reader impact

astryx component <Name> is how an agent or a person learns what props a component takes. For four components, it left out props the component takes, so a reader could not find them, and a check that compares a page's props with the docs could not trust the docs for these components:

  • ComplexSelector: isLabelHidden, description, labelTooltip, isOptional, isRequired.
  • Selector: changeAction, labelTooltip, placement, isDefaultOpen.
  • Toast: isExiting.
  • ContextMenuItem, which re-exports DropdownMenuItem: onClick, href, target, rel, isDisabled, hasCloseOnSelect, variant, ref. Without onClick and href, its docs did not say how an item acts.

Source of truth

The components' own props types: ComplexSelectorProps and SelectorProps, ToastProps, and DropdownMenuItem's props (whose own docs already list these props). Each new entry takes its type, default and meaning from the source's declaration and JSDoc, or, for ContextMenuItem, from DropdownMenuItem's doc entries.

Correction

Each doc gains an entry for each prop above. core-prop-docs.known-drift.json loses the ten not_in_doc lines these entries fix (ContextMenuItem is not compared there, since its doc has no same-stem source).

The native Selector contract reads core's Selector doc, so its generated Swift binding (packages/native/apple/Sources/AstryxNative/Generated/Selector.swift) changes with it: it gains labelTooltip, which the native Switch and TextInput bindings already take. placement and isDefaultOpen are declared web-only in packages/native/src/components/Selector.ts, beside presentation, because native platforms place and open their own control. The native contract gains nothing else.

Evidence

core-prop-docs.test.mjs compares each Core doc's props with the TypeScript props of the export it describes. It passes with the ten lines removed, so each new entry agrees with the code (name, required, default, and type where the comparison reads it).

Scope

Components: ComplexSelector, Selector, Toast, ContextMenuItem, and the generated native Selector binding

  • This PR changes documentation only, or names every necessary generated artifact.
  • Runtime, visual, and policy changes were removed or split. The one API change is the generated native binding's labelTooltip, named above.
  • Public text and artifacts contain no internal Meta context.

Testing

  • packages/cli/test/core-prop-docs.test.mjs: passes, with the fixed lines deleted from its known list.
  • core-doc-quality, core-doc-types, golden-reads and the api/component suites: 155 tests pass.
  • docPropLiterals, docPropReferences and core-prop-docs: 23 tests pass (Selector's placement lists its four values).
  • packages/native tests (pnpm exec vitest run packages/native): 145 pass and 1 is skipped (146), after pnpm -F @astryxdesign/native generate:apple, including contracts.test.ts "keeps the committed Swift binding in sync with the contracts".

preflight: pass 91c330f (review half; the touched packages' tests ran locally)

…xtMenuItem take

Each doc gains the props its component already takes and the doc left out;
the prop-docs test's known list loses the ten lines this fixes.
@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 19, 2026 2:59am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 18, 2026
@astracat-bot

astracat-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 19, 2026, 3:04 AM UTC

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · d725bf1

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC
ComplexSelector · Storybook 78.7 kB (0) · 12.7 kB CSS (0) 737 (0)
ContextMenu · Storybook 103.4 kB (0) · 18.8 kB CSS (0) 725 (0)
Selector 114.8 kB (0) · 18.7 kB CSS (0) —
2 more components
Component Size LoC
SelectorOption 24.2 kB (0) · 6.7 kB CSS (0) —
Toast · Storybook 105.5 kB (0) · 11.1 kB CSS (0) 1,734 (0)

Package size: @astryxdesign/core 7.66 MB packed (+1.0 kB); no new dependencies.

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.

Current run: CI concluded cancelled; parts of this report may be missing.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: two of the new prop descriptions say something the component does not do.

  • packages/core/src/Toast/Toast.doc.mjs:59: isExiting does not stop the auto-hide timer, since the timer code in Toast.tsx never reads it and onDismiss('auto') still fires after autoHideDuration, so describe what it does instead (it plays the exit motion and stops responding to swipes).
  • packages/core/src/Selector/Selector.doc.mjs:356: leaving placement out puts the selected option over the trigger only when the selector has no search, so add that with hasSearch the popup opens below the trigger.

Every other new entry matches its component's props type. The ContextMenuItem entries match DropdownMenuItem's docs exactly, and the prop-docs check passes with the ten drift lines removed.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: the four docs now list the props the changeset names, which the components already take. Verified against each component's props type.
  • Claim: ContextMenuItem takes those props as the DropdownMenuItem it re-exports. Verified at the ContextMenu entry point.
  • Claim: the CLI's component output left these props out, including ContextMenuItem's onClick and href. Verified against the base branch's output.
  • Claim: each entry takes its type, default and meaning from the source declaration and JSDoc, or from DropdownMenuItem's docs. False for Toast isExiting, which has no JSDoc and whose described timer behavior is wrong; true for the other entries.
  • Claim: the known-drift list loses the ten fixed lines, and ContextMenuItem is not compared because it has no same-stem source. Verified.
  • Claim: the prop-docs test passes, so the entries agree with the code on name, required, default and type. Verified; 156 tests pass across the listed suites.
  • Claim: documentation only, with no runtime, API, visual or policy change. Verified; the API comparison shows no change from this pull request.
  • File .changeset/core-docs-missing-props.md: clear.
  • File packages/cli/test/core-prop-docs.known-drift.json: clear.
  • File packages/core/src/ComplexSelector/ComplexSelector.doc.mjs: clear.
  • File packages/core/src/ContextMenu/ContextMenuItem.doc.mjs: clear.
  • File packages/core/src/Selector/Selector.doc.mjs: placement description (finding above).
  • File packages/core/src/Toast/Toast.doc.mjs: isExiting description (finding above).

Automated review (maintainer link)

Comment thread packages/core/src/Toast/Toast.doc.mjs Resolved

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet, because its run was refused while CI was full, so it needs a re-run.

Both earlier points are fixed: the isExiting entry now describes the exit motion and the swipe lock instead of the timer, and the placement entry now covers searchable selectors. Every new entry matches its component's props, and the ContextMenuItem entries match DropdownMenuItem's docs exactly.

Claims and files checked

Review mode: incremental; reason: none

  • Claim: the four docs now list the props the changeset names, which the components already take. Verified against each component's props type.
  • Claim: ContextMenuItem takes those props as the DropdownMenuItem it re-exports. Verified at the ContextMenu entry point.
  • Claim: the CLI's component output left these props out, including ContextMenuItem's onClick and href. Verified against the base branch's output.
  • Claim: each entry takes its type, default and meaning from its source declaration and doc comment, or from DropdownMenuItem's docs. Verified; isExiting and changeAction have no doc comment, and their text matches the code that reads them.
  • Claim: the known-drift list loses the ten fixed lines, and ContextMenuItem is not compared because it has no same-stem source. Verified.
  • Claim: the prop-docs test passes with those lines removed, and the other listed suites pass with 155 tests. Verified at this head.
  • Claim: documentation only, with no runtime, API, visual or policy change. Verified; the API comparison shows no change from this pull request.
  • Claim: public text carries no internal context. Verified.
  • File .changeset/core-docs-missing-props.md: clear.
  • File packages/cli/test/core-prop-docs.known-drift.json: clear.
  • File packages/core/src/ComplexSelector/ComplexSelector.doc.mjs: clear.
  • File packages/core/src/ContextMenu/ContextMenuItem.doc.mjs: clear.
  • File packages/core/src/Selector/Selector.doc.mjs: clear; the placement entry is fixed.
  • File packages/core/src/Toast/Toast.doc.mjs: clear; the isExiting entry is fixed.

Automated review (maintainer link)

The prop type is LayerPlacement; the doc names its four values, as
docPropLiterals asks, so a reader without an IDE sees what to write.
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 22b828e

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI is still running on this head.

The one change since the last review writes Selector's placement type as 'above' | 'below' | 'start' | 'end', exactly the values its props type allows, and the earlier isExiting and placement description fixes still hold. Every new entry matches its component's props, and the ContextMenuItem entries match DropdownMenuItem's docs.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Claim: the four docs now list the props the changeset names, which the components already take. Verified against each component's props type.
  • Claim: ContextMenuItem takes its new props as the DropdownMenuItem it re-exports. Verified at the ContextMenu entry point.
  • Claim: the CLI's component output left these props out, including ContextMenuItem's onClick and href. Verified against the base branch's output.
  • Claim: each entry takes its type, default and meaning from its source declaration and doc comment, or from DropdownMenuItem's docs. Verified; placement now spells out its props type's four values.
  • Claim: the known-drift list loses the ten fixed lines, and ContextMenuItem is not compared because it has no same-stem source. Verified.
  • Claim: the prop-docs test passes with those lines removed. Verified at this head.
  • Claim: the other listed suites pass with 155 tests. Verified at this head.
  • Claim: documentation only, with no runtime, API, visual or policy change. Verified; the API comparison shows no change from this pull request.
  • Claim: public text carries no internal context. Verified.
  • File .changeset/core-docs-missing-props.md: clear.
  • File packages/cli/test/core-prop-docs.known-drift.json: clear.
  • File packages/core/src/ComplexSelector/ComplexSelector.doc.mjs: clear.
  • File packages/core/src/ContextMenu/ContextMenuItem.doc.mjs: clear.
  • File packages/core/src/Selector/Selector.doc.mjs: clear; the placement type now lists its values.
  • File packages/core/src/Toast/Toast.doc.mjs: clear.

Automated review (maintainer link)

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not approved yet: approval waits on an engineering owner's decision about the native Selector contract, and the description needs one correction.

Regenerating the Swift binding puts Selector's placement and isDefaultOpen into the native Selector core contract, and no current spec says native Selectors honor them, which the native-first surfaces spec requires of every core prop (the native package already keeps presentation web-only for that reason). Approval needs an engineering owner, the author included, to settle whether both stay in the native core, recorded with an /approve-spec comment that names this head's full SHA (the earlier one names the previous head), or else to declare them web-only in packages/native/src/components/Selector.ts and regenerate the binding. CI did not run its tests on this head because admission found CI full, so it needs a re-run.

  • The description's Scope checklist says the pull request is documentation only and that API changes were removed or split, but it regenerates packages/native/apple/Sources/AstryxNative/Generated/Selector.swift, which adds the public SelectorPlacement enum and three Selector props, so please name that regeneration and the native contract change in the description.
Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Claim: the four docs list the props the changeset names, which the components already take. Verified against each props type and the prop-docs test.
  • Claim: ContextMenuItem takes its new props as the DropdownMenuItem it re-exports. Verified at the ContextMenu entry point; the eight entries match DropdownMenuItem's docs.
  • Claim: the component command's output left these props out. Verified against the base branch's output.
  • Claim: each entry takes its type, default and meaning from its source or from DropdownMenuItem's docs. Verified.
  • Claim: the known-drift list loses the ten fixed lines, and ContextMenuItem is not compared there. Verified.
  • Claim: the prop-docs test passes with those lines removed. Verified at this head.
  • Claim: the other listed suites pass with 155 tests. Verified at this head.
  • Claim: documentation only, or every necessary generated artifact named. False: the regenerated Swift Selector binding is not named.
  • Claim: runtime, API, visual and policy changes were removed or split. False: the Swift binding adds public Selector API to the native package.
  • Claim: public text carries no internal context. Verified.
  • Claim: the components in scope are ComplexSelector, Selector, Toast and ContextMenuItem. Verified for the core docs; the native Selector binding also changes.
  • File .changeset/core-docs-missing-props.md: clear.
  • File packages/cli/test/core-prop-docs.known-drift.json: clear.
  • File packages/core/src/ComplexSelector/ComplexSelector.doc.mjs: clear.
  • File packages/core/src/ContextMenu/ContextMenuItem.doc.mjs: clear.
  • File packages/core/src/Selector/Selector.doc.mjs: clear.
  • File packages/core/src/Toast/Toast.doc.mjs: clear.
  • File packages/native/apple/Sources/AstryxNative/Generated/Selector.swift: matches the generator; its placement and isDefaultOpen wait on the owner decision.

Automated review (maintainer link)

…e Selector

Native platforms place and open their own control, as they choose their
own presentation. So the regenerated Swift binding gains only labelTooltip,
which the native Switch and TextInput bindings already take.

[skip ci]
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 91c330f

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: one line of the description needs correcting; the docs and the native Selector contract look right.

  • The Testing section says 168 packages/native tests pass after generate:apple, but at this head that suite runs 146 tests (145 pass, 1 skipped), so please correct the count or name the command that runs 168.

Declaring placement and isDefaultOpen web-only settles the earlier native contract question: the regenerated binding now gains only labelTooltip, and regenerating it at this head reproduces the committed file. CI has not run its test and typecheck jobs on this head yet.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Claim: the four docs list the props the changeset names, which the components already take. Verified against each props type, the prop-docs test and the component command's output.
  • Claim: ContextMenuItem takes its new props as the DropdownMenuItem it re-exports. Verified at the ContextMenu entry point; the eight entries equal DropdownMenuItem's.
  • Claim: the component command left these props out. Verified against the base branch's output.
  • Claim: each entry takes its type, default and meaning from its source or from DropdownMenuItem's docs. Verified.
  • Claim: the known-drift list loses the ten fixed lines, and ContextMenuItem is not compared there. Verified.
  • Claim: the native Swift Selector binding gains labelTooltip, which native Switch and TextInput already take. Verified.
  • Claim: placement and isDefaultOpen are web-only in the native Selector additions, beside presentation. Verified.
  • Claim: the native contract gains nothing else. Verified in every built native platform type.
  • Claim: the prop-docs test passes with the ten lines removed. Verified at this head.
  • Claim: the component suites and the doc quality, type and golden-read tests pass with 155 tests. Verified at this head.
  • Claim: the doc literal and reference tests pass, and Selector's placement lists its four values. Verified at this head.
  • Claim: the native tests pass with 168 tests after regenerating the binding. False: 146 tests, 145 pass and 1 skipped.
  • Claim: documentation only, or every necessary generated artifact named. Verified: the Swift binding is the one generated file, and it is named.
  • Claim: runtime, visual and policy changes were removed, and the one API change is the native labelTooltip. Verified.
  • Claim: public text carries no internal context. Verified.
  • Claim: the components in scope are ComplexSelector, Selector, Toast, ContextMenuItem and the native Selector binding. Verified.
  • Claim: the touched packages' tests ran locally. Consistent: they pass here.
  • File .changeset/core-docs-missing-props.md: clear.
  • File packages/cli/test/core-prop-docs.known-drift.json: clear.
  • File packages/core/src/ComplexSelector/ComplexSelector.doc.mjs: clear.
  • File packages/core/src/ContextMenu/ContextMenuItem.doc.mjs: clear.
  • File packages/core/src/Selector/Selector.doc.mjs: clear.
  • File packages/core/src/Toast/Toast.doc.mjs: clear.
  • File packages/native/apple/Sources/AstryxNative/Generated/Selector.swift: clear; it matches the generator.
  • File packages/native/src/components/Selector.ts: clear.

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 6813bb7

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet, because its commit message skips CI, so the test and build checks still need to run and pass before merge.

The one open point from the last review is fixed: the description's native test line now matches what this head runs (145 pass, 1 skipped). The new doc entries match each component's props, and the native Selector binding gains only labelTooltip.

Claims and files checked

Review mode: incremental; reason: none

  • changed rules (0): none
  • Claim: the four docs list the props the changeset names, which the components already take. Verified against each props type, the prop-docs test and the component command's output.
  • Claim: ContextMenuItem takes its new props as the DropdownMenuItem it re-exports. Verified at the ContextMenu entry point; the eight entries equal DropdownMenuItem's.
  • Claim: the component command left these props out, and ContextMenuItem's docs did not say how an item acts. Verified against the base branch's output.
  • Claim: each entry takes its type, default and meaning from its source or from DropdownMenuItem's docs. Verified.
  • Claim: the known-drift list loses the ten fixed lines, and ContextMenuItem is not compared there. Verified.
  • Claim: the native Swift Selector binding gains labelTooltip, which native Switch and TextInput already take. Verified.
  • Claim: placement and isDefaultOpen are web-only in the native Selector additions, beside presentation. Verified.
  • Claim: the native contract gains nothing else. Verified in every built native platform type.
  • Claim: the prop-docs test passes with the ten lines removed. Verified at this head.
  • Claim: the components in scope are ComplexSelector, Selector, Toast, ContextMenuItem and the native Selector binding. Verified.
  • Claim: documentation only, or every necessary generated artifact named. Verified: the Swift binding is the one generated file, and it is named.
  • Claim: runtime, visual and policy changes were removed, and the one API change is the native labelTooltip. Verified.
  • Claim: public text carries no internal context. Verified.
  • Claim: the prop-docs test passes with its fixed lines deleted from the known list. Verified at this head.
  • Claim: the component suites and the doc quality, type and golden-read tests pass with 155 tests. Verified at this head.
  • Claim: the doc literal and reference tests and the prop-docs test pass with 23 tests, and Selector's placement lists its four values. Verified at this head.
  • Claim: the native tests, run with the named command after regenerating the binding, pass 145 with 1 skipped of 146, the binding sync test included. Verified at this head.
  • Claim: the touched packages' tests ran locally. Consistent: they pass here.
  • File .changeset/core-docs-missing-props.md: clear.
  • File packages/cli/test/core-prop-docs.known-drift.json: clear.
  • File packages/core/src/ComplexSelector/ComplexSelector.doc.mjs: clear.
  • File packages/core/src/ContextMenu/ContextMenuItem.doc.mjs: clear.
  • File packages/core/src/Selector/Selector.doc.mjs: clear.
  • File packages/core/src/Toast/Toast.doc.mjs: clear.
  • File packages/native/apple/Sources/AstryxNative/Generated/Selector.swift: clear; it matches the generator.
  • File packages/native/src/components/Selector.ts: clear.

Automated review (maintainer link)

josephfarina added a commit that referenced this pull request Nov 19, 2026
- #12635 fix(cli): export loads and gives back a page whose modules import TypeScript files by .js names
  Author: @josephfarina
- #12727 fix(cli): export loads a served package's subpath exported only to imports
  Author: @josephfarina
- #12224 fix(cli): a {@link} in a template description resolves as astryx docs resolves it
  Author: @josephfarina
- #12278 fix(core): a Theme given a value that is not a theme keeps the page running
  Author: @josephfarina
- #12751 feat(Layout): LayoutContent names its container, so a theme styles a dialog's body apart from its header and footer
  Author: @josephfarina
- #12168 fix(templates): header, footer and toolbar rows wrap for longer translated labels
  Author: @josephfarina
- #12399 [experimental] export: the dropped-text warning checks Core's docs, and text not drawn yet inside Core components that take children no longer warns
  Author: @josephfarina
- #12541 [docs] Core: list the props ComplexSelector, Selector, Toast and ContextMenuItem take
  Author: @josephfarina
- #12676 docs(cli): a short form keeps its own 640 column inside a wide template frame
  Author: @josephfarina
- #12458 fix(core): Field labels use the primary text colour
  Author: @josephfarina
- #12373 [experimental] export: a link to a place in the page stays in the file in a srcdoc viewer frame
  Author: @josephfarina
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #12827.

@github-actions
github-actions Bot deleted the josephfarina/core-docs-missing-props branch November 20, 2026 06:06

This branch was successfully deployed

1 active deployment
Preview — 6813bb79 Deployed Nov 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant