Repository navigation
feat(core): make useTableRowExpansion a detail-panel plugin (#4142) - #4609
Merged
humbertovirtudes merged 1 commit intoAug 11, 2026
Merged
Conversation
humbertovirtudes
requested review from
cixzhang,
ejhammond,
imdreamrunner and
josephfarina
as code owners
July 31, 2026 18:40
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Jul 31, 2026
github-actions
Bot
requested review from
cvkxx,
ernestt,
kentonquatman and
rubyycheung
July 31, 2026 18:54
humbertovirtudes
force-pushed
the
feat/row-expansion-detail-panel
branch
from
July 31, 2026 19:41
feee9a4 to
997563c
Compare
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsTable (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
Resolves the tree/rowExpansion overlap by differentiation instead of
removal. The two plugins now serve distinct jobs:
- useTableTreeData + useTableTreeState: hierarchy (child rows that reuse
the parent columns, indented by depth).
- useTableRowExpansion: a full-width detail panel below a row, rendered
by the consumer via renderExpanded(item): master-detail rows (order
details, forms, charts, nested tables).
BREAKING:
- useTableRowExpansion config is now { expandedKeys, onToggle, getRowKey,
renderExpanded, getIsItemExpandable? }. renderExpanded is required.
- useTableRowExpansionState is removed. For tree rows, migrate to
useTableTreeState (see the migration example on the docs).
Core: re-add afterRow to BodyRowRenderProps + BaseTable, a small
additive hook so a plugin can append a full-width <tr> after a row. The
panel spans all columns via the tracked column count.
Story, example block, and docs rewritten for the detail-panel model;
groupedRows doc link repointed to useTableTreeState.
Tests: 13 detail-panel unit tests (RED-verified first); full core Table
suite green; core + docs tsc clean; eslint clean; changeset valid.
humbertovirtudes
force-pushed
the
feat/row-expansion-detail-panel
branch
from
August 11, 2026 05:04
997563c to
73ecd73
Compare
|
@humbertovirtudes is attempting to deploy a commit to the Meta Open Source Team on Vercel. A member of the Team first needs to authorize it. |
humbertovirtudes
added a commit
to humbertovirtudes/astryx
that referenced
this pull request
Aug 11, 2026
…he tree plugin (meta#4142) useTableRowExpansion became a detail-panel plugin (meta#4609) and useTableRowExpansionState was removed. This adds a v0.3.0 codemod so `astryx upgrade` migrates the old tree pattern automatically: const {data, expansionConfig} = useTableRowExpansionState({ baseData, getChildren, getRowKey, expandedKeys, setExpandedKeys, }); const expansion = useTableRowExpansion(expansionConfig); becomes: const {visibleData: data, treeConfig} = useTableTreeState({ data: baseData, childrenKey: 'children', idKey: getRowKey, ... }); const expansion = useTableTreeData(treeConfig); It remaps the config (baseData -> data, getChildren -> childrenKey, getRowKey -> idKey, getIsItemExpandable -> isItemExpandable), fixes the imports, and leaves a guidance comment about expansion state (the controlled expandedKeys/setExpandedKeys mapping is not mechanical). Detail-panel usage (renderExpanded, no useTableRowExpansionState import) is left untouched. Tests: 10 unit tests (RED-verified first); full v0.3.0 codemod suite green (104); registered in the v0.3.0 manifest; eslint + changeset clean.
humbertovirtudes
added a commit
that referenced
this pull request
Aug 11, 2026
…he tree plugin (#4142) (#4884) useTableRowExpansion became a detail-panel plugin (#4609) and useTableRowExpansionState was removed. This adds a v0.3.0 codemod so `astryx upgrade` migrates the old tree pattern automatically: const {data, expansionConfig} = useTableRowExpansionState({ baseData, getChildren, getRowKey, expandedKeys, setExpandedKeys, }); const expansion = useTableRowExpansion(expansionConfig); becomes: const {visibleData: data, treeConfig} = useTableTreeState({ data: baseData, childrenKey: 'children', idKey: getRowKey, ... }); const expansion = useTableTreeData(treeConfig); It remaps the config (baseData -> data, getChildren -> childrenKey, getRowKey -> idKey, getIsItemExpandable -> isItemExpandable), fixes the imports, and leaves a guidance comment about expansion state (the controlled expandedKeys/setExpandedKeys mapping is not mechanical). Detail-panel usage (renderExpanded, no useTableRowExpansionState import) is left untouched. Tests: 10 unit tests (RED-verified first); full v0.3.0 codemod suite green (104); registered in the v0.3.0 manifest; eslint + changeset clean.
This was referenced Aug 13, 2026
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.
Summary
Resolves the
useTableRowExpansion/ tree-plugin overlap tracked in #4142 by differentiation instead of removal. Rather than deprecating and deletinguseTableRowExpansion, this repurposes it for a distinct job, so both plugins earn their place:useTableTreeData+useTableTreeStateown hierarchy: nested child rows that reuse the parent columns, indented by depth (expand-all, whole-row click, cycle guard).useTableRowExpansionowns the detail panel: a full-width panel below a row, rendered by the consumer viarenderExpanded(item). This is the master-detail / accordion-row pattern (order details, forms, charts, nested tables).This is the plugin's original design (it shipped as a
renderExpandeddetail panel before being refactored into the inherited-columns tree), so it restores a proven shape rather than inventing one.Breaking change
useTableRowExpansionconfig is now{ expandedKeys, onToggle, getRowKey, renderExpanded, getIsItemExpandable? }.renderExpandedis required; the consumer ownsexpandedKeys(viauseState).useTableRowExpansionStateis removed. It was a tree flattener; a detail panel does not flatten a tree.useTableRowExpansionfor tree rows, migrate touseTableTreeData+useTableTreeState. A before/after example is on theuseTableRowExpansiondocs (astryx component useTableRowExpansion --detail full).What changed
afterRowtoBodyRowRenderProps+BaseTable, a small hook so a plugin can append a full-width<tr>after a row. The detail panel spans all columns via the tracked final column count (nocolSpan={999}hack).useTableRowExpansionrewritten to detail-panel mode: leading chevron column, right-click expand/collapse action,renderExpandedpanel below each expanded row. The inherited-columns tree rendering is removed (that lives in the tree plugin).useTableRowExpansion.doc.mjsrewritten for the detail-panel API, with a "migrating tree rows to the tree plugin" example.groupedRowsdoc link repointed touseTableTreeState.Config mapping (tree rows -> tree plugin)
useTableRowExpansion(State)useTableTreeState/useTableTreeDatabaseData(nested)datagetChildren: item => item.childrenchildrenKey: 'children'getRowKey: item => item.ididKey: 'id'oridKey={item => item.id}getIsItemExpandableisItemExpandableexpandedKeys+setExpandedKeysdefaultExpandedIdsorexpandedIds+onExpandedIdsChangeisAllExpanded+onToggleExpandAllhasExpandAllControlTest plan
colSpan= all columns, per-row panels, non-expandable rows, context-menu action, i18n label.tsc(core + docs) clean;eslintclean;check:changesetsvalid.afterRowis additive and defaulted-off, so other Table plugins are unaffected.Supersedes
This replaces the earlier "deprecate + remove" plan. The soft-deprecation PR (#4587) should be closed rather than merged, since we are keeping the plugin.
Note for maintainers
The one core API-surface addition is
afterRowonBodyRowRenderProps. It is small, additive, and defaulted-off, and it is what the plugin originally used. Flagging it explicitly since it is a Table-core primitive.