Fix spreadsheet showing empty rows after unrealizing an aliased node#3950
Fix spreadsheet showing empty rows after unrealizing an aliased node#3950flomillot wants to merge 2 commits into
Conversation
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>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis 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. ChangesRow Data Synchronization
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ 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. Comment |
|



Summary
SpreadsheetContentpushedrowDatato AG Grid imperatively in auseEffectgated by anisGridReadyflag that was never reset when the grid unmounted. After unrealizing a node and navigating back to a node with an alias,EquipmentTableremounted with a fresh AG Grid instance butisGridReadystayedtrue, soonGridReadydid not trigger a re-render and therowDataeffect ran once before the grid API was ready — ending as a no-op. With aliased nodes the data is cached (no fetch), sorowDatawas never pushed again and the grid displayed "No data" until F5.rowDataas a prop toCustomAGGridinequipment-table.tsxso AG Grid keeps the rows in sync via its own render cycle, removing the race entirely.isGridReadytofalsewhendisabledflips totrue, so the sort and filter effects (which still depend on the flag) re-apply on remount in the same scenario.