Skip to content

Table: component-based styling + selection plugin - #123

Merged
cixzhang merged 10 commits into
mainfrom
tables-selection-v2
Feb 18, 2026
Merged

cixzhang merged 10 commits into
mainfrom
tables-selection-v2

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

Replace plugin-based styling with component-based styling. XDSBaseTable gains a components prop so XDSTable passes { Row, Cell, HeaderCell } instead of a styling plugin. Components own their styles via XDSTableContext, reading density/dividers/striped/hover from context.

Add XDSTableHeaderCell component for styled elements with density, header font, and divider styles. Add extraStyles prop to XDSTableRow, XDSTableCell, and XDSTableHeaderCell for plugin-provided styles.

Add useXDSTableSelection hook — a table plugin providing row checkboxes, select-all with indeterminate state, selected row highlighting, and aria-selected attributes. Uses React Context for independent checkbox re-rendering without triggering full row re-renders.

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

Copy link
Copy Markdown
Contributor Author

Review Notes

Overall

The component-based styling refactor is the right move — styling co-located with components, plugins handle behavior + structure, XDSBaseTable stays truly unstyled. The selection plugin establishes a solid pattern for future plugins.

Architecture: Header Cell Slot Model (forward-looking)

Based on discussion about how the internal table system handles structured headers, we should plan for header cells to support a slot-based layout that plugins compose into:

┌──────────────────────────────────────────────┐
│ beforeCell │ beforeLabel label afterLabel │ afterCell │
│            │ extraContent                 │           │
└──────────────────────────────────────────────┘

When sorting/filtering/resize plugins land, HeaderCellRenderProps would extend to:

interface HeaderCellRenderProps {
  htmlProps: HTMLAttributes<HTMLTableCellElement>;
  styles: StyleXStyles[];
  // Slot content — plugins compose into these
  beforeCell?: ReactNode;
  afterCell?: ReactNode;
  beforeLabel?: ReactNode;
  afterLabel?: ReactNode;
  extraContent?: ReactNode;
  label: ReactNode;  // initialized from column.header
}

Plugins transform by appending to their target slot:

  • Resize → afterCell / beforeCell (drag handles)
  • Sort → beforeLabel / afterLabel (sort icon, depends on text align)
  • Filter → extraContent (filter row below label)
  • Info → beforeLabel / afterLabel (info icons)

Each plugin only touches its slot — they compose without knowing about each other. The header cell component stays simple, just rendering the layout.

No changes needed in this PR — the current HeaderCellRenderProps can be extended when those plugins land. Just documenting the direction.

Smaller items

  1. aria-selected handling: Currently isSelected || undefined, which means unselected rows have no aria-selected attribute. Some screen readers expect aria-selected="false" on all rows when any row has aria-selected="true" (per WAI-ARIA grid pattern). Consider using isSelected ? true : false when selection is active.

  2. Selection checkbox labels: All row checkboxes use label="Select row". Screen readers navigating by form controls hear "Select row" repeatedly with no way to distinguish rows. A getItemLabel config option (e.g. getItemLabel: (item) => item.name) could provide unique accessible labels like "Select Alice".

  3. Selection cell width: Hardcoded to 48px — consider using a spacing token for consistency.

  4. Plugin ordering: XDSTable accepts Record<string, TablePlugin> which converts to array via Object.values(). Order is insertion order in practice but worth documenting that plugin execution order follows the record key insertion order.

Replace plugin-based styling with component-based styling. XDSBaseTable
gains a `components` prop so XDSTable passes { Row, Cell, HeaderCell }
instead of a styling plugin. Components own their styles via
XDSTableContext, reading density/dividers/striped/hover from context.

Add XDSTableHeaderCell component for styled <th> elements with density,
header font, and divider styles. Add `extraStyles` prop to XDSTableRow,
XDSTableCell, and XDSTableHeaderCell for plugin-provided styles.

Add useXDSTableSelection hook — a table plugin providing row checkboxes,
select-all with indeterminate state, selected row highlighting, and
aria-selected attributes. Uses React Context for independent checkbox
re-rendering without triggering full row re-renders.
@cixzhang
cixzhang force-pushed the tables-selection-v2 branch from 9d97871 to 6a057ae Compare February 17, 2026 19:39
@github-actions

github-actions Bot commented Feb 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

Modified Components

CheckboxInput
Metric Before After Delta
Bundle Size (ESM) N/A 347B N/A
Lines of Code N/A 310 -
Complexity N/A High (20) -
Table
Metric Before After Delta
Bundle Size (ESM) N/A 767B N/A
Lines of Code N/A 808 -
Complexity N/A Very High (52) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@xds/core 6.0KB 9.9KB 1.6KB

Accessibility Audit

Status: 3 accessibility violation(s) found.

XDSCheckboxInput - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
XDSTable - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name
Selection - 1 issue(s)
  • serious: Links must have discernible text
    • Rule: link-name

Component Previews

Includes interactive hover previews as animated GIFs.

XDSCheckboxInput

Default

Screenshot:

Default

Interaction Preview: (view video)

Default interaction

Run yarn storybook and navigate to: form-xdscheckboxinput--default

Checked

Screenshot:

Checked

Interaction Preview: (view video)

Checked interaction

Run yarn storybook and navigate to: form-xdscheckboxinput--checked

With Description

Screenshot:

With Description

Interaction Preview: (view video)

With Description interaction

Run yarn storybook and navigate to: form-xdscheckboxinput--with-description

With Hidden Label

Screenshot:

With Hidden Label

Interaction Preview: (view video)

With Hidden Label interaction

Run yarn storybook and navigate to: form-xdscheckboxinput--with-hidden-label

Indeterminate

Screenshot:

Indeterminate

Interaction Preview: (view video)

Indeterminate interaction

Run yarn storybook and navigate to: form-xdscheckboxinput--indeterminate

Disabled

Screenshot:

Disabled

Interaction Preview: (view video)

Disabled interaction

Run yarn storybook and navigate to: form-xdscheckboxinput--disabled

Disabled Checked

Screenshot:

Disabled Checked

Interaction Preview: (view video)

Disabled Checked interaction

Run yarn storybook and navigate to: form-xdscheckboxinput--disabled-checked

All Variations

Screenshot:

All Variations

Interaction Preview: (view video)

All Variations interaction

Run yarn storybook and navigate to: form-xdscheckboxinput--all-variations

Small Size

Screenshot:

Small Size

Interaction Preview: (view video)

Small Size interaction

Run yarn storybook and navigate to: form-xdscheckboxinput--small-size

Size Comparison

Screenshot:

Size Comparison

Interaction Preview: (view video)

Size Comparison interaction

Run yarn storybook and navigate to: form-xdscheckboxinput--size-comparison

With Start Icon

Screenshot:

With Start Icon

Interaction Preview: (view video)

With Start Icon interaction

Run yarn storybook and navigate to: form-xdscheckboxinput--with-start-icon

Start Icon Variations

Screenshot:

Start Icon Variations

Interaction Preview: (view video)

Start Icon Variations interaction

Run yarn storybook and navigate to: form-xdscheckboxinput--start-icon-variations

With Error Status

Screenshot:

With Error Status

Interaction Preview: (view video)

With Error Status interaction

Run yarn storybook and navigate to: form-xdscheckboxinput--with-error-status

With Warning Status

Screenshot:

With Warning Status

Interaction Preview: (view video)

With Warning Status interaction

Run yarn storybook and navigate to: form-xdscheckboxinput--with-warning-status

With Success Status

Screenshot:

With Success Status

Interaction Preview: (view video)

With Success Status interaction

Run yarn storybook and navigate to: form-xdscheckboxinput--with-success-status

Status Variations

Screenshot:

Status Variations

Interaction Preview: (view video)

Status Variations interaction

Run yarn storybook and navigate to: form-xdscheckboxinput--status-variations

XDSTable

Default

Screenshot:

Default

Interaction Preview: (view video)

Default interaction

Run yarn storybook and navigate to: core-xdstable--default

Compact

Screenshot:

Compact

Interaction Preview: (view video)

Compact interaction

Run yarn storybook and navigate to: core-xdstable--compact

Spacious

Screenshot:

Spacious

Interaction Preview: (view video)

Spacious interaction

Run yarn storybook and navigate to: core-xdstable--spacious

Striped With Hover

Screenshot:

Striped With Hover

Interaction Preview: (view video)

Striped With Hover interaction

Run yarn storybook and navigate to: core-xdstable--striped-with-hover

Grid Dividers

Screenshot:

Grid Dividers

Interaction Preview: (view video)

Grid Dividers interaction

Run yarn storybook and navigate to: core-xdstable--grid-dividers

Column Dividers

Screenshot:

Column Dividers

Interaction Preview: (view video)

Column Dividers interaction

Run yarn storybook and navigate to: core-xdstable--column-dividers

No Dividers

Screenshot:

No Dividers

Interaction Preview: (view video)

No Dividers interaction

Run yarn storybook and navigate to: core-xdstable--no-dividers

Auto Columns

Screenshot:

Auto Columns

Interaction Preview: (view video)

Auto Columns interaction

Run yarn storybook and navigate to: core-xdstable--auto-columns

Custom Cell Renderer

Screenshot:

Custom Cell Renderer

Interaction Preview: (view video)

Custom Cell Renderer interaction

Run yarn storybook and navigate to: core-xdstable--custom-cell-renderer

Children Mode

Screenshot:

Children Mode

Interaction Preview: (view video)

Children Mode interaction

Run yarn storybook and navigate to: core-xdstable--children-mode

All Densities

Screenshot:

All Densities

Interaction Preview: (view video)

All Densities interaction

Run yarn storybook and navigate to: core-xdstable--all-densities

Kitchen Sink

Screenshot:

Kitchen Sink

Interaction Preview: (view video)

Kitchen Sink interaction

Run yarn storybook and navigate to: core-xdstable--kitchen-sink

Selection

Default

Screenshot:

Default

Interaction Preview: (view video)

Default interaction

Run yarn storybook and navigate to: core-xdstable-selection--default

With Preselection

Screenshot:

With Preselection

Interaction Preview: (view video)

With Preselection interaction

Run yarn storybook and navigate to: core-xdstable-selection--with-preselection

Non Selectable Rows

Screenshot:

Non Selectable Rows

Interaction Preview: (view video)

Non Selectable Rows interaction

Run yarn storybook and navigate to: core-xdstable-selection--non-selectable-rows

Disabled Rows

Screenshot:

Disabled Rows

Interaction Preview: (view video)

Disabled Rows interaction

Run yarn storybook and navigate to: core-xdstable-selection--disabled-rows

Compact

Screenshot:

Compact

Interaction Preview: (view video)

Compact interaction

Run yarn storybook and navigate to: core-xdstable-selection--compact

Spacious

Screenshot:

Spacious

Interaction Preview: (view video)

Spacious interaction

Run yarn storybook and navigate to: core-xdstable-selection--spacious

With Striped Rows

Screenshot:

With Striped Rows

Interaction Preview: (view video)

With Striped Rows interaction

Run yarn storybook and navigate to: core-xdstable-selection--with-striped-rows


Generated by PR Enrichment workflow | Storybook | View full report

Separate file (TableSelection.stories.tsx) nested under Core/XDSTable/Selection
to avoid merge conflicts when parallelizing plugin development.

Stories: Default, WithPreselection, NonSelectableRows, DisabledRows,
Compact, Spacious, WithStripedRows
Aligns with XDS xstyle naming convention. 'additionalXStyles' signals
these are extra StyleX styles layered on top of the component's own
styles, distinct from consumer-facing 'xstyle' prop.
Verifies that selection changes don't cause unnecessary row re-renders:
- Single row selection: other rows stay at 1 render ✅
- Select-all: row content doesn't re-render ✅
- 3 sequential selections: unaffected rows stay at 1 render ✅
- Documents pitfall: inline plugins={{}} breaks memoization

Key finding: consumers must memoize the plugins record with useMemo()
for optimal performance. The plugin object itself is stable (useRef),
but the wrapping record must also be stable.
- Remove colgroup from XDSBaseTable — fixes plugin column injection
  and prepares for future div-based grid layout
- Add useXDSBaseTablePlugins hook that converts named plugin records
  to stable memoized arrays, comparing by plugin identity so inline
  plugins={{}} does not break row memoization
- XDSTable now uses the hook instead of manual useMemo
- Selection plugin uses context-driven SelectionRowAttributes for
  reactive aria-selected without depending on row re-renders
- Remove colgroup test, update selection tests for new memoization
The density padding (12px inline) was expanding the cell beyond the
width constraint. Selection cell now uses tighter --spacing-2 padding
and pins width with min/max/width all set to 40px.
Comment on lines +115 to +123
useEffect(() => {
const tr = ref.current?.parentElement;
if (!tr) return;
if (isSelected) {
tr.setAttribute('aria-selected', 'true');
} else {
tr.removeAttribute('aria-selected');
}
}, [isSelected]);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm worried about dropped renders potentially putting this into a bad state. We should rely on more straightforward props passing. It's find if the row element re-renders as long as we properly memoize the children cell from unnecessary updates.

}, [isSelected]);

// Hidden <td> to get a DOM reference for finding the parent <tr>
return <td ref={ref} style={{display: 'none'}} aria-hidden="true" />;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Even with the ref update strategy this doesn't make sense. We can enable plugins to pass a ref to register with a row or cell.

const configRef = useRef(config);
configRef.current = config;

// Return a stable plugin object via ref to avoid unnecessary re-renders

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This works as long as the config is only callbacks but it's possible it could contain variants or visual updates. Ex. if htmlProps or styles update this plugin ref won't update and may not trigger the table to update. Those props may need to be memoized or shallow equal memoed.

Setting ref in render is generally considered a React antipattern so we should avoid it.

/** Props for XDSTableCell — thin `<td>` wrapper */
export interface XDSTableCellProps extends TdHTMLAttributes<HTMLTableCellElement> {
children?: ReactNode;
additionalXStyles?: StyleXStyles[];

@cixzhang cixzhang Feb 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

At this level, it can just be called xstyle. At the plugin level, the styles we apply for the plugin should be additive (ex. plugin A and B apply different styles that add together). Maybe we consolidate on just xstyle as the prop in all cases for consistency.

<td
ref={ref}
{...props}
{...stylex.props(...(additionalXStyles ?? []))}>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We should avoid recomputing [] each time. I think it can just be...

{...stylex.props(additionalXStyles)}

}

if (additionalXStyles) {
cellStyles.push(...additionalXStyles);

@cixzhang cixzhang Feb 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

cellStyles.push(...xstyle);

Comment thread packages/core/src/Table/XDSTableRow.tsx Outdated
/** Props for XDSTableRow — thin `<tr>` wrapper */
export interface XDSTableRowProps extends HTMLAttributes<HTMLTableRowElement> {
children: ReactNode;
additionalXStyles?: StyleXStyles[];

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same, this can just be xstyle

@cixzhang

Copy link
Copy Markdown
Contributor Author

Let's also organize the plugins into their own folders, like Table/plugins/selection/...

cixzhang and others added 3 commits February 18, 2026 00:45
…gins

1. Rename additionalXStyles → xstyle across Row/Cell/HeaderCell/types
2. Fix empty array recomputation: use stylex.props(xstyle) directly
3. Remove SelectionRowAttributes (imperative DOM updates) — use
   straightforward props passing via transformBodyRow instead
4. Remove pluginRef antipattern — use useMemo([config]) instead of
   setting ref in render
5. Move selection plugin to Table/plugins/selection/ folder

Row re-renders on selection change are now expected. The important
optimization is that checkbox content re-renders independently
via SelectionContext.
- Move selection functional tests to plugins/selection/useXDSTableSelection.test.tsx
- Move selection perf tests to plugins/selection/useXDSTableSelection-perf.test.tsx
- Remove selection tests from XDSTable.test.tsx (65 tests remain)
- Fix lint: remove unused TableHeaderCellComponentProps import from XDSBaseTable
…ader underline

- Use xstyle prop instead of spreading stylex.props on selection cells
- Accept both StyleXStyles and StyleXStyles[] for xstyle on cell components
- Add box-sizing: border-box to all cell density styles
- Scope last-row border removal to tbody to preserve header underline
- Remove gap on CheckboxInput when label is hidden
- Adjust selection column width to 36px
@cixzhang
cixzhang merged commit a3024e9 into main Feb 18, 2026
5 checks passed
@cixzhang
cixzhang deleted the tables-selection-v2 branch February 18, 2026 23:36
cixzhang added a commit that referenced this pull request Apr 26, 2026
* Table: component-based styling + selection plugin

Replace plugin-based styling with component-based styling. XDSBaseTable
gains a `components` prop so XDSTable passes { Row, Cell, HeaderCell }
instead of a styling plugin. Components own their styles via
XDSTableContext, reading density/dividers/striped/hover from context.

Add XDSTableHeaderCell component for styled <th> elements with density,
header font, and divider styles. Add `extraStyles` prop to XDSTableRow,
XDSTableCell, and XDSTableHeaderCell for plugin-provided styles.

Add useXDSTableSelection hook — a table plugin providing row checkboxes,
select-all with indeterminate state, selected row highlighting, and
aria-selected attributes. Uses React Context for independent checkbox
re-rendering without triggering full row re-renders.

* Add selection plugin storybook stories

Separate file (TableSelection.stories.tsx) nested under Core/XDSTable/Selection
to avoid merge conflicts when parallelizing plugin development.

Stories: Default, WithPreselection, NonSelectableRows, DisabledRows,
Compact, Spacious, WithStripedRows

* Rename extraStyles → additionalXStyles

Aligns with XDS xstyle naming convention. 'additionalXStyles' signals
these are extra StyleX styles layered on top of the component's own
styles, distinct from consumer-facing 'xstyle' prop.

* Add selection plugin performance tests

Verifies that selection changes don't cause unnecessary row re-renders:
- Single row selection: other rows stay at 1 render ✅
- Select-all: row content doesn't re-render ✅
- 3 sequential selections: unaffected rows stay at 1 render ✅
- Documents pitfall: inline plugins={{}} breaks memoization

Key finding: consumers must memoize the plugins record with useMemo()
for optimal performance. The plugin object itself is stable (useRef),
but the wrapping record must also be stable.

* Remove colgroup, add useXDSBaseTablePlugins hook

- Remove colgroup from XDSBaseTable — fixes plugin column injection
  and prepares for future div-based grid layout
- Add useXDSBaseTablePlugins hook that converts named plugin records
  to stable memoized arrays, comparing by plugin identity so inline
  plugins={{}} does not break row memoization
- XDSTable now uses the hook instead of manual useMemo
- Selection plugin uses context-driven SelectionRowAttributes for
  reactive aria-selected without depending on row re-renders
- Remove colgroup test, update selection tests for new memoization

* Fix selection column width: 36px fixed with maxWidth

* Fix selection column width: override padding, pin with min/max/width

The density padding (12px inline) was expanding the cell beyond the
width constraint. Selection cell now uses tighter --spacing-2 padding
and pins width with min/max/width all set to 40px.

* Address PR feedback: xstyle rename, remove antipatterns, organize plugins

1. Rename additionalXStyles → xstyle across Row/Cell/HeaderCell/types
2. Fix empty array recomputation: use stylex.props(xstyle) directly
3. Remove SelectionRowAttributes (imperative DOM updates) — use
   straightforward props passing via transformBodyRow instead
4. Remove pluginRef antipattern — use useMemo([config]) instead of
   setting ref in render
5. Move selection plugin to Table/plugins/selection/ folder

Row re-renders on selection change are now expected. The important
optimization is that checkbox content re-renders independently
via SelectionContext.

* Colocate selection tests, fix lint warning

- Move selection functional tests to plugins/selection/useXDSTableSelection.test.tsx
- Move selection perf tests to plugins/selection/useXDSTableSelection-perf.test.tsx
- Remove selection tests from XDSTable.test.tsx (65 tests remain)
- Fix lint: remove unused TableHeaderCellComponentProps import from XDSBaseTable

* Fix selection plugin styling: use xstyle prop, add box-sizing, fix header underline

- Use xstyle prop instead of spreading stylex.props on selection cells
- Accept both StyleXStyles and StyleXStyles[] for xstyle on cell components
- Add box-sizing: border-box to all cell density styles
- Scope last-row border removal to tbody to preserve header underline
- Remove gap on CheckboxInput when label is hidden
- Adjust selection column width to 36px
cixzhang added a commit that referenced this pull request Jun 21, 2026
* Table: component-based styling + selection plugin

Replace plugin-based styling with component-based styling. XDSBaseTable
gains a `components` prop so XDSTable passes { Row, Cell, HeaderCell }
instead of a styling plugin. Components own their styles via
XDSTableContext, reading density/dividers/striped/hover from context.

Add XDSTableHeaderCell component for styled <th> elements with density,
header font, and divider styles. Add `extraStyles` prop to XDSTableRow,
XDSTableCell, and XDSTableHeaderCell for plugin-provided styles.

Add useXDSTableSelection hook — a table plugin providing row checkboxes,
select-all with indeterminate state, selected row highlighting, and
aria-selected attributes. Uses React Context for independent checkbox
re-rendering without triggering full row re-renders.

* Add selection plugin storybook stories

Separate file (TableSelection.stories.tsx) nested under Core/XDSTable/Selection
to avoid merge conflicts when parallelizing plugin development.

Stories: Default, WithPreselection, NonSelectableRows, DisabledRows,
Compact, Spacious, WithStripedRows

* Rename extraStyles → additionalXStyles

Aligns with XDS xstyle naming convention. 'additionalXStyles' signals
these are extra StyleX styles layered on top of the component's own
styles, distinct from consumer-facing 'xstyle' prop.

* Add selection plugin performance tests

Verifies that selection changes don't cause unnecessary row re-renders:
- Single row selection: other rows stay at 1 render ✅
- Select-all: row content doesn't re-render ✅
- 3 sequential selections: unaffected rows stay at 1 render ✅
- Documents pitfall: inline plugins={{}} breaks memoization

Key finding: consumers must memoize the plugins record with useMemo()
for optimal performance. The plugin object itself is stable (useRef),
but the wrapping record must also be stable.

* Remove colgroup, add useXDSBaseTablePlugins hook

- Remove colgroup from XDSBaseTable — fixes plugin column injection
  and prepares for future div-based grid layout
- Add useXDSBaseTablePlugins hook that converts named plugin records
  to stable memoized arrays, comparing by plugin identity so inline
  plugins={{}} does not break row memoization
- XDSTable now uses the hook instead of manual useMemo
- Selection plugin uses context-driven SelectionRowAttributes for
  reactive aria-selected without depending on row re-renders
- Remove colgroup test, update selection tests for new memoization

* Fix selection column width: 36px fixed with maxWidth

* Fix selection column width: override padding, pin with min/max/width

The density padding (12px inline) was expanding the cell beyond the
width constraint. Selection cell now uses tighter --spacing-2 padding
and pins width with min/max/width all set to 40px.

* Address PR feedback: xstyle rename, remove antipatterns, organize plugins

1. Rename additionalXStyles → xstyle across Row/Cell/HeaderCell/types
2. Fix empty array recomputation: use stylex.props(xstyle) directly
3. Remove SelectionRowAttributes (imperative DOM updates) — use
   straightforward props passing via transformBodyRow instead
4. Remove pluginRef antipattern — use useMemo([config]) instead of
   setting ref in render
5. Move selection plugin to Table/plugins/selection/ folder

Row re-renders on selection change are now expected. The important
optimization is that checkbox content re-renders independently
via SelectionContext.

* Colocate selection tests, fix lint warning

- Move selection functional tests to plugins/selection/useXDSTableSelection.test.tsx
- Move selection perf tests to plugins/selection/useXDSTableSelection-perf.test.tsx
- Remove selection tests from XDSTable.test.tsx (65 tests remain)
- Fix lint: remove unused TableHeaderCellComponentProps import from XDSBaseTable

* Fix selection plugin styling: use xstyle prop, add box-sizing, fix header underline

- Use xstyle prop instead of spreading stylex.props on selection cells
- Accept both StyleXStyles and StyleXStyles[] for xstyle on cell components
- Add box-sizing: border-box to all cell density styles
- Scope last-row border removal to tbody to preserve header underline
- Remove gap on CheckboxInput when label is hidden
- Adjust selection column width to 36px
cixzhang added a commit that referenced this pull request Nov 9, 2026
…9969)

* docs(useLinkify): add hook docs and a comment-thread example block

A HookDoc next to the hook source (usage, text and options params covering
patterns/hasBuiltins, the ReactNode[] return, best practices), so astryx hook
useLinkify and astryx search return it, and a template block naming useLinkify
in exampleFor: the issue's scenario, a short comment thread in plain text
where the URL and the email address become Links and a custom issue-reference
pattern turns #123/#456 into tracker links, while a comment without matches
stays plain. Removing the hook call removes every link, per INV28. A jsdom
test asserts the four hrefs (url, mailto, two issue links) and that the plain
note renders no anchor.

Closes #9560

* Merge remote-tracking branch 'origin/main' into l3-9969

* docs(useLinkify): register the routes, fix the changeset, correct the global-flag and overlap wording

Adds the hook doc and example to the ShadCN route lock and the sandbox export routes, gives the changeset its frontmatter and contributor credit, says a non-global pattern never finishes rendering when the text matches, and says the earliest match wins with custom patterns winning only at the same start. Drops a test assertion that could never fail.

* test(cli): useLinkify now opens its own hook doc

The recorded resolution for useLinkify moves from Link.doc.mjs to the new useLinkify.doc.mjs, as other hook-doc additions have done.

Co-authored-by: Cindy Zhang <[email protected]>
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