fix(table): show Stop / X-running for edit-triggered auto-runs#4682
Conversation
…d cells The "X running" badge + per-row gutter Stop only updated on manual Run (useRunColumn bumped the run-state counter). Edit-triggered auto-runs (useUpdateTableRow, useBatchUpdateTableRows, useCreateTableRow) stamped cells pending in the rows cache but never bumped runningCellCount/runningByRowId, so Stop stayed hidden even though cells were queued (the counter is already queued-inclusive). Extracted countNewlyInFlight + bumpRunState helpers and wired them into all the optimistic auto-fire paths with onError rollback; reused them in useRunColumn.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Adds shared helpers ( Reviewed by Cursor Bugbot for commit 6128714. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR fixes the "X running" badge and per-row Stop button not appearing for edit-triggered auto-runs (
Confidence Score: 4/5Safe to merge — the core fix is correct and well-structured with no data loss or security concerns. The apps/sim/hooks/queries/tables.ts — the Important Files Changed
|
Summary
useRunColumnbumped the run-state counter). Edit-triggered auto-runs (useUpdateTableRow,useBatchUpdateTableRows,useCreateTableRow) stamped cellspendingin the rows cache but never bumpedrunningCellCount/runningByRowId, so Stop stayed hidden even though cells were queued.countNewlyInFlight+bumpRunStatehelpers and wired them into all optimistic auto-fire paths withonErrorrollback; reused them inuseRunColumnto dedupe.countRunningCellsserver +applyCellSSE both count queued/running/pending), so this makes Stop appear the moment auto-fired cells go queued.Type of Change
Testing
Tested manually on staging; tsc, vitest (lib/table + hooks/queries, 202 passing), lint, and
check:api-validation:strictall pass.Checklist