Skip to content

fix(grid): stable row IDs and live API handle#1425

Open
gcko wants to merge 2 commits into
mainfrom
fix/grid-handle-row-ids
Open

fix(grid): stable row IDs and live API handle#1425
gcko wants to merge 2 commits into
mainfrom
fix/grid-handle-row-ids

Conversation

@gcko

@gcko gcko commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Two complementary fixes for the AG Grid wrapper component to improve row selection stability and handle API correctness:

  1. Use _index for stable row IDs in query results: Query result rows are now tagged with _index by dataFrameToRowObjects, but the getRowId function wasn't checking for it. This caused AG Grid to lose row selections when a query re-ran and data was transformed with new random IDs. Now using _index as the second priority (after __rowKey but before rowIndex) to ensure stable IDs across re-renders.

  2. Make handle API live via getters: Changed the handle API to return live values via getters instead of snapshots, ensuring consumers always get the current API reference and DOM element.

Test Plan

  • ✅ All 76 related test files pass (1724 tests, 5 skipped)
  • ✅ Added comprehensive unit tests for row ID priority levels: __rowKey, _index, rowIndex, and random fallback
  • ✅ Full frontend test suite passes (3983 tests)
  • ✅ Type checking passes
  • ✅ Linting passes

🤖 Generated with Claude Code

gcko added 2 commits June 11, 2026 10:54
Query rows are tagged with _index by dataFrameToRowObjects, but getRowId
was not checking for it. This caused AG Grid to lose row selections when
a query re-ran and data was transformed with new random IDs.

Added _index as the second priority check (after __rowKey but before rowIndex)
to ensure query result rows maintain stable IDs across re-renders.

Also added unit tests covering all four priority levels: __rowKey, _index,
rowIndex, and random fallback.

Signed-off-by: Jared Scott <jared.m.scott@hotmail.com>
Signed-off-by: Jared Scott <jared.scott@datarecce.io>
Signed-off-by: Jared Scott <jared.scott@datarecce.io>
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.

1 participant