Skip to content

fix: avoid redundant table cell content renders - #10657

Open
AkashNemade16 wants to merge 2 commits into
adobe:mainfrom
AkashNemade16:akashnemade16-table-dialog-rendering
Open

AkashNemade16 wants to merge 2 commits into
adobe:mainfrom
AkashNemade16:akashnemade16-table-dialog-rendering

Conversation

@AkashNemade16

@AkashNemade16 AkashNemade16 commented Sep 28, 2026 •

Copy link
Copy Markdown

Fixes: #8890

Opening a dialog from a cell reruns render functions in otherwise unchanged cells, rebuilding nested content such as tabs. Memoize the cell render values and row ButtonContext, and keep the empty expand-button props stable for non-tree rows.

This skips unchanged cell content and button updates, not table state updates. Focus and selection behavior are unchanged; Cell hooks and DOM rendering still run.

With three stable rows, opening a per-cell/shared dialog drops render-prop calls across six unrelated cells from 18/36 to zero in StrictMode. The regressions cover both setups, repeated mouse/keyboard opening and closing, and focus restoration.

GitHub Copilot assisted with implementation and validation.

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests). Tests added; the existing TableExample covers the unchanged UI.
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component). N/A: no API or usage change.
  • Looked at the Accessibility Practices for this feature - Aria Practices
  • I understand every change in this PR and can explain why it's there.
  • If AI-assisted, I followed our AI contribution guidance and pointed my assistant at AGENTS.md.

📝 Test Instructions:

Recorded on fccdedafe with Node 24.14.1, before the subsequent main merge:

  • yarn test --maxWorkers=2 --verbose=false: 8,288 tests and 262 snapshots passed; 16 tests skipped. Non-fatal worker teardown warning.
  • yarn test:ssr --verbose=false: all 60 suites and 74 tests passed.
  • yarn lint: passed.

Full browser validation remains incomplete. Firefox fails to launch on this macOS host with a sandbox-extension permission error, also reproduced in standalone Playwright before loading repository code. A later Chromium/WebKit run reported four WebKit Chat scroll/loading failures and stalled; these have not been established as pre-existing failures. The 14 TableView, Modal, Dialog, and Tabs cases passed serially on Chromium and WebKit.

For manual review, use TableExample: open a cell's Delete dialog, close with Escape, and reopen with Enter. Check focus returns to the trigger and arrow navigation still works.

Keep unchanged cell render values and row button context stable when table focus moves to a dialog.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Button component automatically assigns slot="drag" in tables causing performance issues with large datasets

1 participant