You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: save staged edits for rows loaded via infinite scroll (#1545)
* fix: save staged edits for rows loaded via infinite scroll
With infinite scroll enabled, the grid queries pageIndex 0 with a grown
pageSize window (25-row batches), but the row mutation hooks resolved
their TanStack DB collection from the paginated pageIndex/pageSize. The
two query scopes diverge once more than one batch is loaded, so
collection.update() targeted a collection missing rows beyond the first
batch and threw UpdateKeyNotFoundError, making "Save n rows" fail
silently (issue #1466).
The mutation hooks (update, updateMany, delete, insert) now receive the
view's exact query props and resolve their collection through the new
useActiveTableQueryCollection hook, so mutations always target the same
collection scope the grid displays — including the search term
dimension that was previously omitted as well.
Verified end-to-end in the ppg demo: editing and deleting rows beyond
the first 25-row batch with infinite scroll enabled now persists and
shows the success toast.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix: address PR #1545 review feedback
- useActiveTableUpdate: drop the ignored AdapterUpdateOptions/table params
from UseActiveTableUpdateParams. Persistence is delegated to the rows
collection's onUpdate handler, so a per-call options channel could never
reach the adapter; removing it makes that explicit instead of silently
ignoring the values (API migration; the hook has no product callers).
- ActiveTableView: keep row mutations targeting the visible window during
infinite-scroll growth. While a grown window is fetching, the grid keeps
showing the previous settled window; mutation query props now stay pinned
to that settled window and swap to the grown scope atomically together
with the rows (new resolveVisibleTableWindow helper + tests), closing the
save/delete race during the transition.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Fix saving staged cell edits silently failing for rows loaded beyond the first batch when infinite scroll is enabled. Row update, delete, and insert mutations now target the same rows-collection scope the grid displays instead of the paginated first page.
Copy file name to clipboardExpand all lines: FEATURES.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -182,6 +182,7 @@ When the ledger has migrations but no contract snapshots to diff (a database wri
182
182
Table data is shown in a grid with server-backed pagination, filtered-row counts, loading feedback, and explicit empty states.
183
183
The footer keeps page navigation, a page jump field, a fixed rows-per-page dropdown, and infinite-scroll mode in one compact control group, so users can either jump directly to a page, switch page density from a known preset, or turn on lazy-loading without leaving the grid.
184
184
Rows-per-page and infinite-scroll preferences persist across tables through local storage, while the known filtered-row count keeps the footer stable during page transitions for the same filtered result set. Infinite scroll preloads before the hard bottom edge, always appends in fixed 25-row chunks regardless of the paginated page-size setting, keeps filling tall viewports until the grid is actually scrollable, and appends new rows in place without snapping the grid back to the top.
185
+
Row editing, deletion, and insertion operate on the same loaded row window the grid displays, so with infinite scroll enabled staged cell edits save correctly even for rows loaded beyond the first 25-row batch.
185
186
Rapid sort and filter changes keep the latest request authoritative, and superseded table reads are aborted so a slower older result cannot overwrite the visible grid.
0 commit comments