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
{{ message }}
Repository navigation
Commit c7130c6
Browse filesBrowse the repository at this point in the historyBrowse files
fix(tables): fix bulk ops truncation for tables larger than one page (#4532)
* fix(tables): fix bulk ops truncation for tables larger than one page
Bulk operations (column-header delete, select-all copy/cut/delete/run)
were silently truncated to the first 1000 rows because handlers only
iterated the loaded pages from useInfiniteQuery.
Fix:
- Extract tableRowsInfiniteOptions factory (infiniteQueryOptions) so
the hook and imperative drain share the same typed cache key
- Add background drain via useEffect watching hasNextPage/isFetchingNextPage
— chains fetchNextPage until getNextPageParam returns undefined
- Add ensureAllRowsLoaded to use-table: reads cache via getQueryData +
calls fetchNextPage in a while loop until the last page is partial
- Await ensureAllRowsLoaded at every kind:'all' bulk-op entry point in
table-grid (column delete, copy, cut, action-bar delete/run)
- Add chunkBatchUpdates to send updates in MAX_BULK_OPERATION_SIZE=1000
chunks so server validation never rejects oversized batches
- Fix undo-redo: make executeAction async and chunk clear-cells,
update-cells, and delete-column cell-restore with mutateAsync loops
Tests: 41 passing across use-table, tables queries, and use-table-undo
* chore(tables): remove extraneous comments
* fix(tables): add missing useEffect import; chunk range-selection delete and cut
* fix(tables): add hasRunningGroupExecution and import it
* fix(tables): define mergePagePreservingIdentity helper used in polling cache merge
* fix(tables): define ROWS_POLL_INTERVAL_WHILE_RUNNING_MS constant used in polling loop
* fix(tables): capture rowSel before await in delete handler; handle clipboard NotAllowedError
* fix(tables): abort cut on clipboard NotAllowedError to prevent silent cell deletion
* fix(tables): push undo before chunkBatchUpdates to survive partial chunk failures
* fix(tables): use text input for number cells; idle poll backoff; csv error toast; column-cut drain
* fix(tables): audit fixes — column-copy drain, polling scope, merge identity
- Fix polling tick: move Promise.all inside else-branch so dirty[] stays in
scope; keep hasDirty=true during active mutations so the short interval
fires while chunked batch-updates are in flight
- Add isColumnSelectionRef branch to handleCopy (mirrors handleCut fix):
column-header Cmd+C now drains all pages before building clipboard content
- Replace String(updatedAt) comparison in mergePagePreservingIdentity with
Date.getTime() equality — handles ISO vs +00:00 timezone variants
- Remove redundant batchUpdates.length > 0 guards at chunkBatchUpdates
callsites (empty-array case is handled inside the function)
- Export _mergePagePreservingIdentity for unit testing
- Add 6 unit tests covering mergePagePreservingIdentity edge cases
* improvement(tables): cleanup — extract components, stabilize callbacks, fix ref sync
* improvement(tables): remove polling, eager drain, and parallelize batch updates
- Drop the per-page polling loop — SSE stream already patches execution
cell state in real time and invalidates on buffer prune; polling was
redundant and burned CPU/network on every open table
- Remove eager mount drain (fetchNextPage loop in use-table.ts); scroll
handler and ensureAllRowsLoaded handle progressive/on-demand loading
- Parallelize chunkBatchUpdates with a 3-worker pool instead of serial
chunks, reducing bulk-op round-trips by ~3x
- Delete mergePagePreservingIdentity and its tests (no longer called)
* chore(tables): remove stale comments and dead defensive code
- Fix chunkBatchUpdates JSDoc to reflect parallel dispatch (was "sequentially")
- Inline CHUNK_CONCURRENCY=3, single-use constant needs no abstraction
- Drop stale "Polls while any cell is in flight" from useTableRows JSDoc
- Remove two generic "Validation errors surfaced by caller" comments
- Remove ASCII separator line from workflow group mutations section
- Remove dead `if (!variables) return` guard in useImportCsvIntoTable onSettled
(TanStack v5 always provides variables to onSettled)
* fix(tables): run-all selection sends all rows to server, not just loaded pages
When rowSelection.kind === 'all', selectedRunScope now flags allRows: true.
The action-bar run handlers pass rowIds: undefined to the server when allRows
is set, matching the server contract (missing rowIds = run all eligible rows).
Stop likewise routes through scope: 'all' instead of per-row cancels.
Previously, selecting all rows and clicking Run would silently only run the
rows loaded in the current infinite-query cache (potentially one page of 1000
on a 5000-row table).
* test(tables): remove background-drain describe block (behavior intentionally removed)
* fix(tables): surface CSV import error toast; remove dead hasRunningGroupExecution
* fix(tables): make runWithoutRecording async-aware so undoRedoInProgress covers full undo execution
* feat(tables): render URL cells with favicon and clickable link
* feat(tables): clickable URL cells with favicons using tldts
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/cells/expanded-cell-popover.tsx
Copy file name to clipboardExpand all lines: apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/cells/inline-editors.tsx
+6-5Lines changed: 6 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -131,7 +131,7 @@ function InlineDateEditor({
131
131
)
132
132
}
133
133
134
-
/** Inline editor for `string`/`number`/`json` columns — single-line text input. */
134
+
/** Inline editor for `string`/`number`/`json` columns — single-line text input. Number columns use `type="number"` so the browser rejects non-numeric input. */
0 commit comments