Fix for spreadsheet scroll jump on inline row edit
Avoid invalidating the full rows query on inline edits and updated the row locally to preserve pagination and scroll position.
What does this PR do?
This PR fixes an issue where editing a cell in the spreadsheet caused the view to scroll back to the top.
The root cause was that inline row edits were invalidating the entire rows query, which triggered a re-fetch starting from offset 0. This reset pagination state and caused the spreadsheet to lose its scroll position.
For inline edits, a full data reload isn’t necessary because the row is already updated locally and persisted to the backend. This change avoids invalidating the full rows query for inline edits and instead updates the edited row in the local store.
As a result, pagination and scroll position remain stable after editing a row.
Test Plan
- Open a database table with a large number of rows.
- Scroll down to any position in the table.
- Edit a cell inline and save the change.
- Verify that:
- The edited value updates correctly.
- The scroll position does not reset.
- Pagination state remains unchanged.
- Refresh the page and confirm the updated value persists.
https://github.com/user-attachments/assets/709990b8-e41d-4e97-afb4-68508ded0a34
Related PRs and Issues
Closes #2689
Have you read the Contributing Guidelines on issues?
Yes, I have read and followed the contributing guidelines.
Summary by CodeRabbit
-
Refactor
- Improved row update handling in database table spreadsheet views for more efficient data management.
✏️ Tip: You can customize this high-level summary in your review settings.