Skip to content

docs(Table, useToast): row open, selection, plugin, empty-state and toast-option answers - #12344

Merged
josephfarina merged 10 commits into
mainfrom
ca2-component-docs
Nov 18, 2026
Merged

josephfarina merged 10 commits into
mainfrom
ca2-component-docs

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Reader impact

People and agents who build with Table and useToast had to read the package type files to answer five common questions. After this change, astryx component / astryx hook answers them:

  1. How to open a row (detail page or side panel) from a Table.
  2. How getIsItemSelectable differs from getIsItemEnabled in useTableSelection.
  3. What a custom TablePlugin can change, and in which order Table calls it.
  4. How to show an empty state when filters leave no rows.
  5. Which fields useToast's showToast(options) takes.

Source of truth

  • packages/core/src/Table/types.ts (TablePlugin, BaseTableProps.emptyState, render-prop shapes, TableRenderContext.rowModel)
  • packages/core/src/Table/useBaseTablePlugins.ts (plugin order, identity), BaseTable.tsx (flat row model for windowing)
  • packages/core/src/Table/plugins/selection/useTableSelection.tsx, useTableSelectionState.tsx
  • packages/core/src/Table/plugins/filtering/useTableFiltering.tsx, useTableFilterState.tsx
  • packages/core/src/Toast/types.ts (ToastOptions)

Correction

  • Table: documents the emptyState prop (it was missing from the doc; removed from the prop-drift allowlist). The plugins prop now lists the transform functions in call order, their arguments, the rowModel: 'flat' declaration (without it, windowing and plugin loading state turn off), and plugin identity. Two new best practices: open a row with a Link or Button in its main cell through renderCell (Table has no row-click prop; a <tr> click handler is not keyboard reachable; a renderCell column turns windowing off), and set emptyState when filters can leave no rows. Two examples: a link cell, and a side-panel button cell.

  • useTableFiltering: documents the required searchConfig prop (was missing), states that the plugin draws controls only and you filter the rows (toSearchFilters + applyFilters), with a complete example that includes an emptyState with a "Clear filters" button.

  • useTableFilterState: names the clearAll result (English and Chinese).

  • useTableSelection: the first sentence of each callback now says what a false result does (no checkbox vs a disabled checkbox that keeps its state), and that select-all is the caller's job in this hook and handled by useTableSelectionState. New example with both callbacks through useTableSelectionState.

  • useToast: the return entry is now value (the hook returns the show function itself, useToast(): ShowToastFn, not an object {showToast}; the rendered signature was useToast(): { showToast }), its first sentence shows const showToast = useToast(), and it lists every ToastOptions field with its type and default, including onHide and renderContent, which were not named before. New best practice for an Undo action.

  • Generated artifacts: packages/cli/test/__golden__/no-icon-set/search-search.json and search-search.txt are regenerated (the new Table best practice adds one astryx search search match: 115 → 116 on the current main; the top 20 are unchanged) with pnpm exec vitest run --project node packages/cli/test/experimental-isolation.test.mjs -u.

  • useToast provider: the usage text now says useToast needs no provider or mounted ToastViewport: inside LayerProvider (or a ToastViewport) it uses that viewport; otherwise the first toast mounts a fallback viewport on document.body with a development warning (Toast/useToast.tsx getFallbackContext).

  • Chinese text: Table best practices and the useTableSelection, useTableFiltering and useTableFilterState descriptions match the English changes.

Evidence

Rendered locally with the branch CLI: astryx component Table, astryx component Table --props, astryx component useTableSelection, astryx component useTableFiltering --detail full, astryx hook useToast all show the new text.

Scope

Components: Table, useTableSelection, useTableFiltering, useTableFilterState, useToast

  • This PR changes documentation only, or names every necessary generated artifact.
  • Runtime, API, visual, and policy changes were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm exec vitest run --project node packages/cli/test/{core-doc-quality,core-doc-types,core-prop-docs,golden-reads,docs-graph,docs-topic-refs}.test.mjs: 29 passed.
  • pnpm exec vitest run --project ui packages/core/src/docPropLiterals.test.ts packages/core/src/docPropReferences.test.ts: 22 passed.
  • pnpm exec vitest run --project node packages/cli/test/experimental-isolation.test.mjs: 54 passed.
  • pnpm specs:for --diff origin/main reviewed; no record governs doc-only text here.

@vercel

vercel Bot commented Nov 17, 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 18, 2026 5:48am UTC

Request Review

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

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 18, 2026, 5:55 AM UTC

@josephfarina
josephfarina marked this pull request as ready for review November 17, 2026 13:56
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 7bb5fd0

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
TableBody 3.5 kB (0) · 3.3 kB CSS (0) — — · ✓ · ✗
TableFooter 3.5 kB (0) · 3.3 kB CSS (0) — — · ✓ · ✗
TableHeader 3.5 kB (0) · 3.3 kB CSS (0) — — · ✓ · ✗
6 more components
Component Size LoC Visual · A11y · RTL
TableRow 7.1 kB (0) · 4.0 kB CSS (0) — — · ✓ · ✗
Table 121.8 kB (0) · 19.8 kB CSS (0) — — · ✓ · —
TableCell 104.6 kB (0) · 19.3 kB CSS (0) — — · ✓ · ✓
TableHeaderCell 104.5 kB (0) · 19.1 kB CSS (0) — — · ✓ · ✓
TableSelectionToolbar 76.6 kB (0) · 14.1 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 (+4.0 kB); no new dependencies.

Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


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: the new Table, Table plugin and useToast answers match the code, but one example in Table.doc.mjs teaches two things that are not true.

  • The side-panel example (lines 391-401) says rowModel: 'flat' keeps virtualization working, though its renderCell name column already makes a windowed Table render every row, and it marks the open row with aria-current="true" only, while the current useTableActivation record pairs that state with a visible marker; please remove the custom plugin from the example, since the Button cell already answers the question.

Smaller points that do not block: the plugins description says every transform receives {htmlProps, xstyle, ...}, which is not true of transformColumns and transformTableContext; it names only windowing as the cost of a missing rowModel: 'flat', though loading turns off too; the row-open best practice could say that a renderCell column turns windowing off; and the Chinese descriptions of useTableFilterState and useTableFiltering still carry the old text.

Claims and files checked

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

  • Claim: Table now documents its empty-state prop, opening a row from a link or button cell (no row-click prop), and what a custom plugin can change and in which order: verified against the Table types, the base table's empty row and the plugin ordering code.
  • Claim: the filtering hook documents its required search configuration and that callers filter the rows themselves, with an empty state; the filter-state hook names its clear-all result: verified against the filtering plugin, which draws controls only, and the filter-state hook's return value.
  • Claim: the selection hook explains a row with no checkbox versus a disabled checkbox and what select-all does with each: verified against the selection cell and the selection-state hook's select-all.
  • Claim: the toast hook lists every option with its default: verified, all nine options and their defaults match the toast types and viewport.
  • Claim: no API or behavior changes: verified, the API report shows no rows and only doc strings change.
  • Claim: the CLI now answers the five questions: verified by rendering the five commands at the base and the head.
  • Claim: the empty-state prop was missing from the doc and leaves the drift allowlist: verified, and the prop-drift test passes.
  • Claim: the plugins description lists the transforms in call order with arguments, the flat row model and plugin identity: verified, with the two wording points above.
  • Claim: two new Table best practices and two examples, including a custom plugin that marks the open row: present; the side-panel example is the blocking finding.
  • Claim: the filtering example includes an empty state with a clear-filters button: verified.
  • Claim: the description's docs tests pass (29 node tests, 22 UI tests): verified by re-running both sets.
  • Claim: documentation only, no runtime, API, visual or policy change: verified.
  • Claim: no internal context in public text: verified.
  • Claim: no spec record governs this doc text: partly false; the Table, Toast and Table activation records govern what these docs describe, and the side-panel example conflicts with the activation record (the blocking finding).
  • File .changeset/table-toast-answers-in-docs.md: clear.
  • File packages/cli/test/core-prop-docs.known-drift.json: clear.
  • File packages/core/src/Table/Table.doc.mjs: blocking finding (side-panel example) and three non-blocking points.
  • File packages/core/src/Table/useTableFilterState.doc.mjs: non-blocking (Chinese description).
  • File packages/core/src/Table/useTableFiltering.doc.mjs: non-blocking (Chinese description); its empty-state example agrees with the Table and filter-state docs.
  • File packages/core/src/Table/useTableSelection.doc.mjs: clear.
  • File packages/core/src/Toast/useToast.doc.mjs: clear.

Automated review (maintainer link)

Comment thread packages/core/src/Table/Table.doc.mjs Resolved
Comment thread packages/core/src/Table/Table.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.

Changes requested: the new Table, Table plugin and useToast answers match the code and the side-panel example is fixed, but one new Table best practice breaks a search golden in the required test suite.

  • Miss: the best practice "When filters or a search can leave no rows" (packages/core/src/Table/Table.doc.mjs:341) makes Table a new match for astryx search search, so packages/cli/test/experimental-isolation.test.mjs fails its search search golden (118 expected, 119 found) and CI's test-node (8/9) leg fails on this head; regenerate packages/cli/test/__golden__/no-icon-set/search-search.json and search-search.txt with pnpm exec vitest run --project node packages/cli/test/experimental-isolation.test.mjs -u.

One optional follow-up: astryx component Table --zh still prints the older Chinese best-practice list, and the Chinese getIsItemSelectable and getIsItemEnabled descriptions keep their old text, so Chinese readers miss the row-open, empty-state and select-all answers.

Claims and files checked

Review mode: incremental; reason: none

  • Claim (release note): Table documents its empty-state prop, opening a row from a link or button in its main cell (no row-click prop), and what a custom plugin can change and in which order: verified against the Table types, the empty-row rendering and the plugin ordering code.
  • Claim (release note): the filtering hook documents its required search configuration and that callers filter the rows themselves, with an empty state; the filter-state hook names its clear-all result: verified, the filtering plugin draws controls only and the filter-state hook returns clear-all.
  • Claim (release note): the selection hook explains a row with no checkbox versus a disabled checkbox and what select-all does with each: verified against the selection cell and the selection-state hook's select-all.
  • Claim (release note): the toast hook lists every option with its default: verified, all nine options and their defaults match the toast types and viewport.
  • Claim (release note): no API or behavior changes: verified, the API report shows no rows and only doc data changes.
  • Claim: the CLI now answers the five questions: verified by rendering the named commands at the base and the head.
  • Claim: the empty-state prop was missing from the doc and leaves the drift allowlist: verified, and the prop-drift test passes.
  • Claim: the plugins description lists the transforms in call order with their arguments, the flat row model (without it, windowing and plugin loading state turn off) and plugin identity: verified.
  • Claim: two new Table best practices (a link or button in the main cell, since a row click handler is not keyboard reachable and a custom cell renderer turns windowing off; an empty state when filters can leave no rows) and two examples (a link cell and a side-panel button cell): verified; the empty-state practice's wording is the blocking search-golden finding.
  • Claim: the filtering hook documents its required search configuration, says it draws controls only, and has a complete example with a clear-filters empty state: verified.
  • Claim: the filter-state hook names clear-all in English and Chinese: verified.
  • Claim: each selection callback's first sentence says what a false result does, select-all is the caller's job unless the selection-state hook handles it, and a new example uses both callbacks: verified.
  • Claim: the toast hook's show function lists every option with its type and default, including the hide callback and the custom content renderer, plus a new Undo best practice: verified.
  • Claim: the named docs tests pass (29 node tests, 22 UI tests): verified by re-running both sets; the wider node suite's search golden still fails (the blocking finding).
  • Claim: documentation only, with runtime, API, visual and policy changes removed and no internal context in public text: verified.
  • Claim: the spec lookup was reviewed and no record governs the doc-only text: accurate in substance; the lookup lists the Table, Toast and consumer-docs records, which govern what these docs describe, and the docs agree with them.
  • File .changeset/table-toast-answers-in-docs.md: clear.
  • File packages/cli/test/core-prop-docs.known-drift.json: clear.
  • File packages/core/src/Table/Table.doc.mjs: blocking (search golden) and non-blocking (Chinese best-practice list).
  • File packages/core/src/Table/useTableFilterState.doc.mjs: clear.
  • File packages/core/src/Table/useTableFiltering.doc.mjs: clear.
  • File packages/core/src/Table/useTableSelection.doc.mjs: non-blocking (Chinese callback descriptions).
  • File packages/core/src/Toast/useToast.doc.mjs: clear.

Automated review (maintainer link)

Comment thread packages/core/src/Table/Table.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.

Changes requested: the regenerated search search goldens and the new Chinese text fix both earlier points, and every doc answer matches the code, but the description now misstates the pull request's scope.

  • The ticked box "This PR changes documentation only, or names every necessary generated artifact" no longer holds: the description does not name the regenerated packages/cli/test/__golden__/no-icon-set/search-search.json and search-search.txt (118 to 119 matches), so add one line that names them and the command that regenerated them; no code change is needed.
Claims and files checked

Review mode: incremental; reason: none

  • Claim (release note): Table documents its empty-state prop, opening a row from a link or button in its main cell (no row-click prop), and what a custom plugin can change and in which order: verified against the Table types, the empty-row rendering and the plugin ordering code.
  • Claim (release note): the filtering hook documents its required search configuration and that callers filter the rows themselves, with an empty state; the filter-state hook names clear-all: verified, the filtering plugin draws controls only and the filter-state hook returns clear-all.
  • Claim (release note): the selection hook explains a row with no checkbox versus a disabled checkbox and what select-all does with each: verified against the selection cell and the selection-state hook's select-all.
  • Claim (release note): the toast hook lists every option with its default: verified, all nine options and their defaults match the toast types and viewport.
  • Claim (release note): no API or behavior changes: verified, the API report shows no rows and only doc data changes.
  • Claim: the CLI now answers the five questions: verified by rendering the named commands at the base and the head.
  • Claim: the empty-state prop was missing from the doc and leaves the drift allowlist: verified, and the prop-drift test passes.
  • Claim: the plugins description lists the transforms in call order with their arguments, the flat row model (without it, windowing and plugin loading state turn off) and plugin identity: verified.
  • Claim: two new Table best practices (a link or button in the main cell; an empty state when filters can leave no rows) and two examples (a link cell and a side-panel button cell): verified, in English, Chinese and dense form.
  • Claim: the filtering hook documents its required search configuration, says it draws controls only, and has a complete example with a clear-filters empty state: verified.
  • Claim: the filter-state hook names clear-all in English and Chinese: verified.
  • Claim: each selection callback's first sentence says what a false result does, select-all is the caller's job unless the selection-state hook handles it, and a new example uses both callbacks: verified, in English and Chinese.
  • Claim: the toast hook's show function lists every option with its type and default, including the hide callback and the custom content renderer, plus a new Undo best practice: verified.
  • Claim: the named docs tests pass (29 node tests, 22 UI tests): verified by re-running both sets; the search golden test passes too.
  • Claim: the pull request changes documentation only, or names every necessary generated artifact: false, the two regenerated search goldens are not named (the blocking finding).
  • Claim: runtime, API, visual and policy changes were removed or split: verified.
  • Claim: public text contains no internal context: verified.
  • Claim: the spec lookup was reviewed and no record governs the doc-only text: accurate in substance; the Table and Toast records govern what these docs describe, and the docs agree with them.
  • File .changeset/table-toast-answers-in-docs.md: clear.
  • File packages/cli/test/__golden__/no-icon-set/search-search.json: matches the head output; unnamed in the description (blocking).
  • File packages/cli/test/__golden__/no-icon-set/search-search.txt: matches the head output; unnamed in the description (blocking).
  • File packages/cli/test/core-prop-docs.known-drift.json: clear.
  • File packages/core/src/Table/Table.doc.mjs: clear.
  • File packages/core/src/Table/useTableFilterState.doc.mjs: clear.
  • File packages/core/src/Table/useTableFiltering.doc.mjs: clear.
  • File packages/core/src/Table/useTableSelection.doc.mjs: clear.
  • File packages/core/src/Toast/useToast.doc.mjs: clear.

Automated review (maintainer link)

@josephfarina
josephfarina marked this pull request as draft November 17, 2026 17:04
@josephfarina
josephfarina marked this pull request as ready for review November 17, 2026 17:04

@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: the description now names the regenerated search search goldens, which fixes the earlier point, and every other doc answer matches the code, but the Table docs give the plugin transforms in an order Table does not call them.

  • Miss: the plugins description in packages/core/src/Table/Table.doc.mjs (line 251) says Table calls transformBodyCell and transformBodyRow before transformScrollWrapper and transformTableContext, but Table runs the scroll-wrapper and context transforms first and then, as each row renders, transformBodyRow before that row's transformBodyCell, so describe it as the pipeline order with when each transform runs (noting that transformTableContext runs in reverse plugin order) and correct the description's "in call order" line to match.

Earlier reviews of this text missed this. The fix is one sentence, and nothing else needs to change.

Claims and files checked

Review mode: incremental; reason: none

  • Claim (release note): Table documents its empty-state prop, opening a row from a link or button in its main cell (no row-click prop), and what a custom plugin can change and in which order: the empty state, row opening and what a plugin can change are verified; the stated order is false (the blocking finding).
  • Claim (release note): the filtering hook documents its required search configuration and that callers filter the rows themselves, with an empty state; the filter-state hook names clear-all: verified, the plugin changes only columns, header cells and context, and the hook returns clear-all.
  • Claim (release note): the selection hook explains a row with no checkbox versus a disabled checkbox and what select-all does with each: verified against the selection cell and the selection-state hook.
  • Claim (release note): the toast hook lists every option with its default: verified, nine options match the toast types and viewport.
  • Claim (release note): no API or behavior changes: verified, the API report lists no rows and only doc data changes.
  • Claim: the CLI now answers the five questions: verified by rendering the named commands at the base and the head.
  • Claim: the listed source files are where the answers come from: verified.
  • Claim: the empty-state prop was missing from the doc and leaves the drift allowlist: verified, and the prop-drift test passes.
  • Claim: the plugins description lists the transforms in call order: false, a runtime probe shows a different order (the blocking finding).
  • Claim: the plugins description gives each transform's arguments, the flat row-model declaration (without it, windowing and plugin loading state turn off) and plugin identity: verified.
  • Claim: two new Table best practices and two examples: verified, in English, Chinese and dense form.
  • Claim: the filtering hook documents its required search configuration, says it draws controls only, and has a complete example with a clear-filters empty state: verified.
  • Claim: the filter-state hook names clear-all in English and Chinese: verified.
  • Claim: each selection callback's first sentence says what a false result does, select-all is the caller's job unless the selection-state hook handles it, and a new example uses both callbacks: verified.
  • Claim: the toast show function lists every option with its type and default, including the hide callback and the custom content renderer, plus an Undo best practice: verified.
  • Claim: the two search goldens are regenerated (118 to 119, top 20 unchanged) with the named command: verified, only the count lines change and that suite passes.
  • Claim: the Chinese text matches the English changes for the named docs: verified.
  • Claim: the branch CLI shows the new text for the five named commands: verified.
  • Claim: the pull request changes documentation only, or names every necessary generated artifact: verified, the goldens are now named.
  • Claim: runtime, API, visual and policy changes were removed or split: verified.
  • Claim: public text contains no internal context: verified.
  • Claim: the named docs tests pass (29, 22 and 54 tests): verified by re-running all three sets.
  • Claim: the spec lookup found no record governing doc-only text: accurate in substance, the Table and Toast records govern what these docs describe, and the docs agree with them.
  • File .changeset/table-toast-answers-in-docs.md: clear.
  • File packages/cli/test/__golden__/no-icon-set/search-search.json: clear, matches the head output.
  • File packages/cli/test/__golden__/no-icon-set/search-search.txt: clear, matches the head output.
  • File packages/cli/test/core-prop-docs.known-drift.json: clear.
  • File packages/core/src/Table/Table.doc.mjs: plugins call order (blocking).
  • File packages/core/src/Table/useTableFilterState.doc.mjs: clear.
  • File packages/core/src/Table/useTableFiltering.doc.mjs: clear.
  • File packages/core/src/Table/useTableSelection.doc.mjs: clear.
  • File packages/core/src/Toast/useToast.doc.mjs: clear.

Automated review (maintainer link)

Comment thread packages/core/src/Table/Table.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.

Changes requested: the plugin docs now put the body transforms last, which fixes the earlier point, and the other doc answers match the code, but the stated call order is still wrong when a Table uses column virtualization.

  • Miss: the plugins description in packages/core/src/Table/Table.doc.mjs (line 251) says transformHeaderCell and transformHeaderRow run before transformScrollWrapper and transformTableContext, but with useTableColumnsVirtualization the header renders inside the column window, so those two header transforms run after both; add a clause such as "With column virtualization, transformHeaderCell and transformHeaderRow run after transformScrollWrapper and transformTableContext, when the column window renders."

The wording suggested in the earlier review missed this case. The fix is one clause.

Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Claim (release note): Table documents its empty-state prop, opening a row from a link or button in its main cell (no row-click prop), and what a custom plugin can change and in which order. The empty state, row opening and what a plugin can change are verified. The order is false for a column-virtualized table (the blocking finding).
  • Claim (release note): the filtering hook documents its required search configuration and that callers filter the rows themselves, with an empty state, and the filter-state hook names clear-all. Verified against the hook types and return value.
  • Claim (release note): the selection hook explains a row with no checkbox versus a disabled checkbox, and what select-all does with each. Verified against the selection cell and the selection-state hook.
  • Claim (release note): the toast hook lists every option with its default. Verified: the nine options match the toast types and the viewport.
  • Claim (release note): no API or behavior changes. Verified: the API generator lists no rows and only doc data changes.
  • Claim: the CLI now answers the five questions. Verified by rendering the Table props at this head; the other docs' text is unchanged since it was last rendered.
  • Claim: the listed source files are where the answers come from. Verified.
  • Claim: the empty-state prop was missing from the doc and leaves the drift allowlist. Verified, and the prop-drift test passes.
  • Claim: the plugins description lists the transforms in call order. False with column virtualization, where a probe records the header transforms after the scroll-wrapper and context transforms (the blocking finding). True for a plain or row-windowed table.
  • Claim: the plugins description gives each transform's arguments, the flat row-model declaration (without it windowing and plugin loading state turn off) and plugin identity. Verified.
  • Claim: two new Table best practices and two examples. Verified in English, Chinese and dense form.
  • Claim: the filtering hook documents its required search configuration, says it draws controls only, and has a complete example with a clear-filters empty state. Verified.
  • Claim: the filter-state hook names clear-all in English and Chinese. Verified.
  • Claim: each selection callback's first sentence says what a false result does, select-all is the caller's job unless the selection-state hook handles it, and a new example uses both callbacks. Verified.
  • Claim: the toast show function lists every option with its type and default, including the hide callback and the custom content renderer, plus an Undo best practice. Verified.
  • Claim: the two search goldens are regenerated (118 to 119, top 20 unchanged) with the named command. Verified: only the count lines change, and that suite passes.
  • Claim: the Chinese text matches the English changes for the named docs. Verified.
  • Claim: the pull request changes documentation only, or names every necessary generated artifact. Verified.
  • Claim: runtime, API, visual and policy changes were removed or split. Verified.
  • Claim: public text contains no internal context. Verified.
  • Claim: the named docs tests pass (29, 22 and 54 tests). Verified by re-running all three sets.
  • Claim: the spec lookup found no record governing doc-only text. Accurate in substance: the Table and Toast records govern what these docs describe, and the docs agree with them apart from the order case above.
  • File .changeset/table-toast-answers-in-docs.md: clear, except its order wording, which shares the blocking finding.
  • File packages/cli/test/__golden__/no-icon-set/search-search.json: clear.
  • File packages/cli/test/__golden__/no-icon-set/search-search.txt: clear.
  • File packages/cli/test/core-prop-docs.known-drift.json: clear.
  • File packages/core/src/Table/Table.doc.mjs: plugin call order with column virtualization (blocking).
  • File packages/core/src/Table/useTableFilterState.doc.mjs: clear.
  • File packages/core/src/Table/useTableFiltering.doc.mjs: clear.
  • File packages/core/src/Table/useTableSelection.doc.mjs: clear.
  • File packages/core/src/Toast/useToast.doc.mjs: clear.

Automated review (maintainer link)

Comment thread packages/core/src/Table/Table.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: the build and test jobs have not run on this head yet, because CI was full; re-run all jobs so they run. The new sentence on column virtualization fixes the last point: with a column-virtualized table the header transforms do run after the scroll-wrapper and context transforms, and the other doc answers match the code. Nothing else needs to change.

Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Claim (release note): Table documents its empty-state prop, opening a row from a link or button in its main cell (no row-click prop), and what a custom plugin can change and in which order. Verified against the table renderer, including the column-virtualized order.
  • Claim (release note): the filtering hook documents its required search configuration and that callers filter the rows themselves, with an empty state, and the filter-state hook names clear-all. Verified against the hook types and return value.
  • Claim (release note): the selection hook explains a row with no checkbox versus a disabled checkbox, and what select-all does with each. Verified against the selection cell and the selection-state hook.
  • Claim (release note): the toast hook lists every option with its default. Verified: the nine options and defaults match the toast types and the viewport.
  • Claim (release note): no API or behavior changes. Verified: the API generator lists no rows and only doc data changes.
  • Claim: the CLI now answers the five questions. Verified by rendering the Table, selection, filtering, filter-state and toast docs at this head.
  • Claim: the listed source files are where the answers come from. Verified.
  • Claim: the empty-state prop was missing from the doc and leaves the drift allowlist. Verified, and the prop-drift test passes.
  • Claim: the plugins description lists the transforms in call order, their arguments, the flat row-model declaration (without it windowing and plugin loading state turn off) and plugin identity. Verified, for plain, row-windowed and column-virtualized tables.
  • Claim: two new Table best practices and two examples. Verified in English, Chinese and dense form.
  • Claim: the filtering hook documents its required search configuration, says it draws controls only, and has a complete example with a clear-filters empty state. Verified.
  • Claim: the filter-state hook names clear-all in English and Chinese. Verified.
  • Claim: each selection callback's first sentence says what a false result does, select-all is the caller's job unless the selection-state hook handles it, and a new example uses both callbacks. Verified.
  • Claim: the toast show function lists every option with its type and default, including the hide callback and the custom content renderer, plus an Undo best practice. Verified.
  • Claim: the two search goldens are regenerated (118 to 119, top 20 unchanged) with the named command. Verified: only the count lines change, and that suite passes.
  • Claim: the Chinese text matches the English changes for the named docs. Verified.
  • Claim: the pull request changes documentation only, or names every necessary generated artifact. Verified.
  • Claim: runtime, API, visual and policy changes were removed or split. Verified.
  • Claim: public text contains no internal context. Verified.
  • Claim: the named doc tests pass (29, 22 and 54 tests). Verified by re-running all three sets at this head.
  • Claim: the spec lookup found no record governing doc-only text. Accurate in substance: the Table and Toast records govern what these docs describe, and the docs agree with them.
  • File .changeset/table-toast-answers-in-docs.md: clear.
  • File packages/cli/test/__golden__/no-icon-set/search-search.json: clear.
  • File packages/cli/test/__golden__/no-icon-set/search-search.txt: clear.
  • File packages/cli/test/core-prop-docs.known-drift.json: clear.
  • File packages/core/src/Table/Table.doc.mjs: clear.
  • File packages/core/src/Table/useTableFilterState.doc.mjs: clear.
  • File packages/core/src/Table/useTableFiltering.doc.mjs: clear.
  • File packages/core/src/Table/useTableSelection.doc.mjs: clear.
  • File packages/core/src/Toast/useToast.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.

Changes requested: the useToast doc now names its return value, so the CLI prints the real signature (useToast(): (options: ToastOptions) => () => void), and every doc answer matches the code, but the rename breaks one docsite test.

  • apps/docsite/src/__tests__/type-definitions.test.ts:212 still finds the useToast return row by the name showToast, so "attaches typeRefs and matching typeDefs to a hook return field" fails with the docsite data generated from this head (it passes on the base); change the lookup to 'value', whose row already carries typeRefs: ['ToastOptions'].

CI's build and test jobs have not run on this head because CI was full, so re-run all jobs after the fix.

Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Claim (release note): Table documents its empty-state prop, opening a row from a link or button in its main cell (no row-click prop), and what a custom plugin can change and in which order. Verified against the table renderer and the plugin ordering.
  • Claim (release note): the filtering hook documents its required search configuration and that callers filter the rows themselves, with an empty state for no matches; the filter-state hook names clear-all. Verified against the hook types and return value.
  • Claim (release note): the selection hook explains a row with no checkbox versus a disabled checkbox, and what select-all does with each. Verified against the selection cell and the selection-state hook.
  • Claim (release note): the toast hook lists every option with its default and says it returns the show function itself, not an object. Verified: the hook's return type is the show function, and the nine options and defaults match the toast types and the viewport.
  • Claim (release note): no API or behavior changes. Verified: the API generator lists no rows and only doc data changes.
  • Claim: the CLI now answers the five questions. Verified by rendering the Table, selection, filtering, filter-state and toast docs at this head.
  • Claim: the listed source files are where the answers come from. Verified.
  • Claim: the empty-state prop was missing from the doc and leaves the drift allowlist. Verified, and the prop-drift test passes.
  • Claim: the plugins description lists the transforms in call order, their arguments, the flat row-model declaration (without it windowing and plugin loading state turn off) and plugin identity. Verified, including the column-virtualized order.
  • Claim: two new Table best practices and two examples. Verified in English, Chinese and dense form.
  • Claim: the filtering hook documents its required search configuration, says it draws controls only, and has a complete example with a clear-filters empty state. Verified.
  • Claim: the filter-state hook names clear-all in English and Chinese. Verified.
  • Claim: each selection callback's first sentence says what a false result does, select-all is the caller's job unless the selection-state hook handles it, and a new example uses both callbacks. Verified.
  • Claim: the toast return entry is now the single value because the hook returns the show function, not an object, and the old rendered signature showed an object. Verified: the brief signature changes from an object with a show-toast field to the function type.
  • Claim: the toast entry's first sentence shows the call, and it lists every option with its type and default, including the hide callback and the custom content renderer, plus an Undo best practice. Verified.
  • Claim: the two search goldens are regenerated (118 to 119, top 20 unchanged) with the named command. Verified: only the count lines change, and that suite passes.
  • Claim: the Chinese text matches the English changes for the named docs. Verified.
  • Claim: the pull request changes documentation only, or names every necessary generated artifact. Verified.
  • Claim: runtime, API, visual and policy changes were removed or split. Verified.
  • Claim: public text contains no internal context. Verified.
  • Claim: the named doc tests pass (29, 22 and 54 tests). Verified by re-running all three sets at this head.
  • Claim: the spec lookup found no record governing doc-only text. Accurate in substance: the Table and Toast records govern what these docs describe, and the docs agree with them.
  • File .changeset/table-toast-answers-in-docs.md: clear.
  • File packages/cli/test/__golden__/no-icon-set/search-search.json: clear.
  • File packages/cli/test/__golden__/no-icon-set/search-search.txt: clear.
  • File packages/cli/test/core-prop-docs.known-drift.json: clear.
  • File packages/core/src/Table/Table.doc.mjs: clear.
  • File packages/core/src/Table/useTableFilterState.doc.mjs: clear.
  • File packages/core/src/Table/useTableFiltering.doc.mjs: clear.
  • File packages/core/src/Table/useTableSelection.doc.mjs: clear.
  • File packages/core/src/Toast/useToast.doc.mjs: the return rename breaks the docsite test above.

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.

Approved pending CI: the docsite registry test now finds the useToast return row by value and passes, which fixes the earlier finding, and every doc answer matches the code. CI's build and test jobs have not finished on this head yet.

  • Non-blocking: the description does not mention the one-line docsite test update; a line under Correction and Testing would keep it in step with the diff.
Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Claim (release note): Table documents its empty-state prop, opening a row from a link or button in its main cell (no row-click prop), and what a custom plugin can change and in which order. Verified against the table renderer, its types and the plugin ordering.
  • Claim (release note): the filtering hook documents its required search configuration and that callers filter the rows themselves, with an empty state for no matches; the filter-state hook names clear-all. Verified against the hook's config type, its transforms and the filter-state return value.
  • Claim (release note): the selection hook explains a row with no checkbox versus a disabled checkbox, and what select-all does with each. Verified against the selection cell and the selection-state hook.
  • Claim (release note): the toast hook lists every option with its default and says it returns the show function itself, not an object. Verified against the toast option types, the hook's return type and the viewport defaults.
  • Claim (release note): no API or behavior changes. Verified: the API generator lists no rows and only doc data and tests change.
  • Claim: the CLI component and hook reads now answer the five questions. Verified by rendering each doc at this head.
  • Claim: the listed source files are where the answers come from. Verified.
  • Claim: the empty-state prop was missing from the doc and leaves the drift allowlist. Verified, and the prop-drift test passes.
  • Claim: the plugins entry lists the transforms in call order, their arguments, the flat row-model declaration (without it, windowing and plugin loading state turn off) and plugin identity. Verified, including the column-virtualized order.
  • Claim: two new Table best practices and two examples. Verified in English, Chinese and dense text.
  • Claim: the filtering hook documents its required search configuration, says it draws controls only, and has a complete example with a clear-filters empty state. Verified.
  • Claim: the filter-state hook names clear-all in English and Chinese. Verified.
  • Claim: each selection callback's first sentence says what a false result does, select-all is the caller's job unless the selection-state hook handles it, and a new example uses both callbacks. Verified.
  • Claim: the toast return entry is now the single value because the hook returns the show function, and the old rendered signature showed an object. Verified: the brief signature changes from an object with a show-toast field to the function type.
  • Claim: the toast entry opens with the call, lists every option with its type and default, including the hide callback and the custom content renderer, and adds an Undo best practice. Verified.
  • Claim: the two search goldens are regenerated (118 to 119, top 20 unchanged) with the named command. Verified: only the count lines change, and that suite passes.
  • Claim: the Chinese text matches the English changes for the named docs. Verified.
  • Claim: the branch CLI renders the new text. Verified by rendering at this head.
  • Claim: the pull request changes documentation only, or names every necessary generated artifact. Accurate in substance; the docsite test update that follows the rename is not named (note above).
  • Claim: runtime, API, visual and policy changes were removed or split. Verified.
  • Claim: public text contains no internal context. Verified.
  • Claim: the named doc tests pass (29, 22 and 54 tests). Verified by re-running all three sets at this head.
  • Claim: the spec lookup found no record governing doc-only text. Accurate in substance: the Table and Toast records govern what these docs describe, and the docs agree with them.
  • File .changeset/table-toast-answers-in-docs.md: clear.
  • File apps/docsite/src/__tests__/type-definitions.test.ts: clear; the lookup reads value and the test passes.
  • File packages/cli/test/__golden__/no-icon-set/search-search.json: clear.
  • File packages/cli/test/__golden__/no-icon-set/search-search.txt: clear.
  • File packages/cli/test/core-prop-docs.known-drift.json: clear.
  • File packages/core/src/Table/Table.doc.mjs: clear.
  • File packages/core/src/Table/useTableFilterState.doc.mjs: clear.
  • File packages/core/src/Table/useTableFiltering.doc.mjs: clear.
  • File packages/core/src/Table/useTableSelection.doc.mjs: clear.
  • File packages/core/src/Toast/useToast.doc.mjs: clear.

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 7bb5fd0

@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: every new Table, Table-plugin and useToast answer matches the shipped code, and the built API surface is unchanged. Some of CI's test jobs had not finished on this head when the review ran.

  • Non-blocking: the new useToast usage text says it "needs no provider", while the Don't beside it still says it "must be called from a child component inside the provider"; saying that a call in the provider's own component falls back to a separate viewport would remove the contradiction (inline note).
  • Non-blocking: the description does not mention the one-line docsite test update that follows the value rename.
Claims and files checked

Review mode: full; reason: rebase

  • Claim (release note): Table documents its empty-state prop, opening a row from a link or button in its main cell (no row-click prop), and what a custom plugin can change and in which order. Verified against the table renderer, its types and the plugin ordering.
  • Claim (release note): the filtering hook documents its required search configuration and that callers filter the rows, with an empty state for no matches; the filter-state hook names clear-all. Verified against the hook's config type and the filter-state return value.
  • Claim (release note): the selection hook explains a row with no checkbox versus a disabled checkbox, and what select-all does with each. Verified against the selection cell and the selection-state hook.
  • Claim (release note): the toast hook lists every option with its default and says it returns the show function itself. Verified against the option types, the viewport defaults and the hook's return type.
  • Claim (release note): no API or behavior changes. Verified: the API generator lists no rows and the built surfaces of base and head are identical.
  • Claim: the CLI component and hook reads now answer the five questions. Verified by rendering each doc on both trees.
  • Claim: the listed source files are where the answers come from. Verified.
  • Claim: the empty-state prop was missing from the doc and leaves the drift allowlist. Verified; the prop-drift test passes.
  • Claim: the plugins entry lists the transforms in call order, their arguments, the flat row-model declaration (without it, windowing and plugin loading state turn off) and plugin identity. Verified, including the column-virtualized order and body rows before their cells.
  • Claim: two new Table best practices and two examples. Verified in English, Chinese and dense text.
  • Claim: the filtering hook documents its required search configuration, draws controls only, and has a complete example with a clear-filters empty state. Verified.
  • Claim: the filter-state hook names clear-all in English and Chinese. Verified.
  • Claim: each selection callback says what a false result does, select-all is the caller's job unless the selection-state hook handles it, and a new example uses both callbacks. Verified.
  • Claim: the toast return entry is now the single value, because the hook returns the show function; the old rendered signature showed an object. Verified: the brief signature changes from an object with a show-toast field to the function type.
  • Claim: the toast entry opens with the call, lists every option with its type and default, including the hide callback and the custom content renderer, and adds an Undo best practice. Verified.
  • Claim: the two search goldens are regenerated (115 to 116, top 20 unchanged) with the named command. Verified: only the count lines change and that suite passes.
  • Claim: the toast usage text says no provider or mounted viewport is needed, uses a provider's viewport when present, and otherwise mounts a fallback viewport on the document body with a development warning. Verified against the hook's fallback path and the layer runtime record.
  • Claim: the Chinese text matches the English changes for the named docs. Verified.
  • Claim: the branch CLI renders the new text. Verified by rendering at this head.
  • Claim: the pull request changes documentation only, or names every necessary generated artifact. Accurate: the one test edit is a supporting test (note above).
  • Claim: runtime, API, visual and policy changes were removed or split. Verified.
  • Claim: public text contains no internal context. Verified.
  • Claim: the named doc tests pass (29, 22 and 54 tests). Verified by re-running them at this head.
  • Claim: the spec lookup found no record governing doc-only text. Accurate in substance: the Table and Toast records govern what these docs describe, and the docs agree with them.
  • File .changeset/table-toast-answers-in-docs.md: clear.
  • File apps/docsite/src/__tests__/type-definitions.test.ts: clear; the lookup reads value and the test passes.
  • File packages/cli/test/__golden__/no-icon-set/search-search.json: clear.
  • File packages/cli/test/__golden__/no-icon-set/search-search.txt: clear.
  • File packages/cli/test/core-prop-docs.known-drift.json: clear.
  • File packages/core/src/Table/Table.doc.mjs: clear.
  • File packages/core/src/Table/useTableFilterState.doc.mjs: clear.
  • File packages/core/src/Table/useTableFiltering.doc.mjs: clear.
  • File packages/core/src/Table/useTableSelection.doc.mjs: clear.
  • File packages/core/src/Toast/useToast.doc.mjs: non-blocking provider note above.

Automated review (maintainer link)

{
guidance: false,
description:
'Call useToast in the same component that renders LayerProvider; it must be called from a child component inside the provider.',

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.

Non-blocking: the usage text this pull request adds (line 40) says useToast "needs no provider or mounted ToastViewport", and this unchanged Don't says it "must be called from a child component inside the provider". Both are true in context: called in the component that renders LayerProvider, the hook cannot see that provider, so its toasts go to a separate fallback viewport with the development warning. Saying so here removes the contradiction, for example:

'Call useToast in the same component that renders LayerProvider: it cannot see that provider there, so its toasts go to a separate fallback viewport. Call it from a child inside the provider.',

The dense text at line 110 has the same wording.

@josephfarina
josephfarina merged commit 6ff24e4 into main Nov 18, 2026
85 checks passed
cixzhang added a commit that referenced this pull request Nov 18, 2026
main's useToast doc (#12344) now names the ToastOptions type and every
option, which covers this branch's useToast.doc edit, so the file takes
main's text.
@github-actions
github-actions Bot deleted the ca2-component-docs branch November 19, 2026 06:04
cixzhang added a commit that referenced this pull request Nov 21, 2026
* docs(core): prop types name only types the package exports

Selector's options are SelectorOptionType[] (SelectorOption is a
component), SyntaxTheme's theme is a SyntaxThemeDefinition, Markdown's
plugins are what createMarkdownPlugin() returns, and the imperative
dialog hooks' show() options are written as the exported Dialog and
AlertDialog props they are built from.

* docs(core): Toast's doc describes the card; useToast's doc gives the show options

Toast's props table now matches ToastProps: type, isAutoHide and
autoHideDuration are required, as the card takes them resolved. The
show-only options (uniqueID, collisionBehavior, onHide) and the defaults
the show function fills in move to useToast's doc. The Toast record names
both docs.

* docs(core): Markdown keeps MarkdownPluginEntry; Toast states what show sets in every language

MarkdownPluginEntry is exported from @astryxdesign/core/Markdown/plugins,
so the Markdown doc keeps naming it. The Toast card does not decide that an
error toast persists: useToast()\s show function sets isAutoHide to false
for one, so that sentence moves to isAutoHide, and the zh and dense text say
what show sets for each required prop. The changeset names the docs this
changes.

* docs(core): Toast's playground starts with the values show sets

Without defaults on the now-required type, isAutoHide and
autoHideDuration, the docsite playground started autoHideDuration at 0.
Its defaults are now the values useToast()'s show function sets.

* docs(docsite): a SyntaxThemeDefinition prop gets the syntax theme preset control

SyntaxTheme's doc now types theme as SyntaxThemeDefinition, and the
playground still picked the preset control by the old name, so the
SyntaxTheme page rendered with no picker and a render error. CodeBlock's
syntaxTheme row, typed the same way, gets the picker too.

* docs(docsite): an optional syntax-theme row starts at None and can return to it

The syntax-theme picker now also serves CodeBlock's and Lab DiffViewer's
optional syntaxTheme rows. For an optional prop it offers None first,
shows None while the prop is unset, and None sends nothing, so the
preview keeps the theme-level syntax colors. A required prop keeps the
presets only.

* docs(docsite): Show code names a syntax preset by its identifier

A syntax preset picked in the playground printed as the whole preset
object. Show code now prints the identifier the preset is exported as,
such as syntaxTheme={dracula}, for any prop.

* Merge main into #12337

main's useToast doc (#12344) now names the ToastOptions type and every
option, which covers this branch's useToast.doc edit, so the file takes
main's text.

* docs(changeset): the show-only Toast options leave its props table because the useToast doc lists them

* Merge main into lane4/docs-name-exported-types

# Conflicts:
#	packages/cli/test/core-prop-docs.known-drift.json

* docs(core): Toast keeps its documented type default and native maps the renamed Selector option type

- Native's Selector additions map the exported SelectorOptionType doc name
  to the native SelectorOption type, so the native contract and Swift output
  stay as they were.
- Toast's type keeps its 'info' default and the playground no longer sets
  type, so the theme editor's toast lines stay as they were. The type
  required_mismatch drift entry returns.

* refactor(docsite): Show code names a syntax preset with the one identifier helper

- syntaxThemeChoices gives the preset's name; Show code turns it into the
  identifier with toIdentifierName, as it does for theme names.
- The changeset says only what changes for Toast: isAutoHide and
  autoHideDuration are required; type keeps its 'info' default.

* docs(Toast): the card's props say useToast()'s show function sets them, without restating values

The values stay where component:Toast's record puts them: useToast's doc
describes the show function's defaults. Toast.doc.mjs no longer repeats
them in prose, which read as a new default clause.

* docs: Toast's card doc moves to its own pull request

Toast.doc.mjs and its known-drift entries return to main's, so this pull
request changes no documented default. The card-doc correction (required
isAutoHide and autoHideDuration; the show-only options leave the card's
table) follows in a separate pull request.

* Merge remote-tracking branch 'refs/remotes/l4/main-now36' into lane4/pr12337

* Merge main into lane4/docs-name-exported-types

This branch was successfully deployed

1 active deployment
Preview — 7bb5fd05 Deployed Nov 18, 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