Skip to content

Fix spreadsheet showing empty rows after unrealizing an aliased node#3950

Open
flomillot wants to merge 2 commits into
mainfrom
fix/spreadsheet-empty-rows-after-unrealize-aliased-node
Open

Fix spreadsheet showing empty rows after unrealizing an aliased node#3950
flomillot wants to merge 2 commits into
mainfrom
fix/spreadsheet-empty-rows-after-unrealize-aliased-node

Conversation

@flomillot
Copy link
Copy Markdown
Contributor

@flomillot flomillot commented May 19, 2026

Summary

  • SpreadsheetContent pushed rowData to AG Grid imperatively in a useEffect gated by an isGridReady flag that was never reset when the grid unmounted. After unrealizing a node and navigating back to a node with an alias, EquipmentTable remounted with a fresh AG Grid instance but isGridReady stayed true, so onGridReady did not trigger a re-render and the rowData effect ran once before the grid API was ready — ending as a no-op. With aliased nodes the data is cached (no fetch), so rowData was never pushed again and the grid displayed "No data" until F5.
  • Pass rowData as a prop to CustomAGGrid in equipment-table.tsx so AG Grid keeps the rows in sync via its own render cycle, removing the race entirely.
  • Also reset isGridReady to false when disabled flips to true, so the sort and filter effects (which still depend on the flag) re-apply on remount in the same scenario.

Spreadsheet rowData was pushed imperatively via setGridOption inside a
useEffect gated by an isGridReady flag that was never reset when the grid
unmounted. After unrealizing a node and navigating back to an aliased
node, EquipmentTable remounted with a fresh AG Grid instance but
isGridReady stayed true, so onGridReady did not trigger a re-render and
the rowData effect ran once before the grid API was ready, ending as a
no-op. With aliased nodes no fetch occurs, so rowData was never pushed
again and the grid showed "No data".

Pass rowData as a prop to CustomAGGrid so AG Grid keeps it in sync via
its own render cycle, removing the race entirely. Also reset isGridReady
when disabled flips to true so sort and filter effects re-apply on
remount.

Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d9ff3118-161b-4898-a582-0299d3e43237

📥 Commits

Reviewing files that changed from the base of the PR and between ed0662f and 8407ae8.

📒 Files selected for processing (2)
  • src/components/spreadsheet-view/spreadsheet/spreadsheet-content/equipment-table.tsx
  • src/components/spreadsheet-view/spreadsheet/spreadsheet-content/spreadsheet-content.tsx

📝 Walkthrough

Walkthrough

This PR refactors row data synchronization in the spreadsheet grid. It removes an imperative effect that manually synced data via Ag-Grid's API, resets grid readiness on disabled state changes, and moves row data to declarative prop-based passing.

Changes

Row Data Synchronization

Layer / File(s) Summary
Disabled state reset for grid remounting
src/components/spreadsheet-view/spreadsheet/spreadsheet-content/spreadsheet-content.tsx
A new useEffect watches the disabled prop and resets isGridReady to false when the component becomes disabled, enabling clean transitions across unmount/remount cycles.
Shift from imperative to prop-based row data flow
src/components/spreadsheet-view/spreadsheet/spreadsheet-content/spreadsheet-content.tsx, src/components/spreadsheet-view/spreadsheet/spreadsheet-content/equipment-table.tsx
Removes the previous useEffect that imperatively called setGridOption('rowData', ...) to sync data into the grid, and instead passes rowData as a prop to CustomAGGrid for React-driven rendering.

Suggested reviewers

  • TheMaskedTurtle
  • etiennehomer
  • ghazwarhili
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main fix: passing rowData as a prop to resolve empty rows in the spreadsheet grid after node alias navigation.
Description check ✅ Passed The description provides detailed context about the root cause, the specific bug scenario, and both fixes implemented to resolve the grid synchronization issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

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