Skip to content

fix: refresh virtual rows when rowKey changes - #64

Open
nrps9909 wants to merge 1 commit into
react-component:masterfrom
nrps9909:codex/update-virtual-row-key
Open

nrps9909 wants to merge 1 commit into
react-component:masterfrom
nrps9909:codex/update-virtual-row-key

Conversation

@nrps9909

@nrps9909 nrps9909 commented Aug 28, 2026 •

Copy link
Copy Markdown

Changing rowKey while retaining the same items array leaves virtual rows cached with old tagged keys because useItemKey returns a stable useEvent function. This fix uses React.useCallback with rowKey as its dependency so the flattened rows and key lookups recompute when the key contract changes.

Rebased onto master 58c41349e204d9d8116fd2535d0db18918118bec, preserving #67's (item, index) callback and the original array indexes. The integration regression rerenders the same array from rowKey="id" to rowKey="slug".

Local validation on Node 26.10.0 / pnpm 11.21.0 / React 19.3.0:

  • Base with the regression: 1 failure (item:1 instead of item:first), 55 passes, 1 snapshot pass.
  • Fixed head d0adf88009bb67b66972545f8bd26727b8c74bd0: all 4 suites / 56 tests / 1 snapshot pass, including the upstream callback-index expectations.
  • Full lint, TypeScript, ESM/CJS/declaration and Less compilation, focused Prettier and diff checks pass.

The earlier approval was on the old commit; current upstream CI and maintainer review remain separate from these local results. The PR remains open.

AI assistance disclosure: Codex helped trace the stale memo dependency, reconcile the upstream callback-index change, run base/head validation, and prepare this description. The tested source, regression, diff and commit were verified directly.

@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

@nrps9909 is attempting to deploy a commit to the React Component Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: b8d9b5ef-9f48-46ef-ae01-8050383542b0

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (f71de19) to head (c6a7985).

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #64   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines          216       216           
  Branches        56        55    -1     
=========================================
  Hits           216       216           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nrps9909
nrps9909 force-pushed the codex/update-virtual-row-key branch from c6a7985 to d0adf88 Compare October 1, 2026 02:15
@nrps9909

nrps9909 commented Oct 1, 2026

Copy link
Copy Markdown
Author

Resolved the upstream conflict at signed/GitHub-Verified head d0adf88009bb67b66972545f8bd26727b8c74bd0 on current master 58c41349e204d9d8116fd2535d0db18918118bec. The callback preserves #67's (item, index) API while changing identity with rowKey.

The original integration regression still fails on base (item:1 instead of item:first); the fixed head passes all 4 suites / 56 tests / 1 snapshot, including the callback-index tests. Full lint, TypeScript, ESM/CJS/declaration and Less builds, formatting and diff checks pass. These are local results; the earlier approval applies to the previous head and new CI/review remain separate. AI assistance: Codex helped reconcile the callback change and run validation.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants