Skip to content

Commit d3428ff

Browse files
fix(table): show value once column output has landed mid-run
The cell renderer treated any `status: 'running'` event as in-flight, even when the column's own output had already been written. During a multi-block group run, partial-write events for a later block carry the earlier block's outputs but tag only the later block as running — that flipped the finished column back to the amber Pending pill until the terminal `completed` event arrived. Re-order the priority chain so the column's value wins over `pending-upstream`. Active re-run of the column itself (`blockRunning`) still wins over the stale value, so a re-run on a previously-completed cell still surfaces the running pill before the new value overwrites. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9398a2b commit d3428ff

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/cells

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/cells/cell-render.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,27 @@ export function resolveCellRender({
7676

7777
if (blockError) return { kind: 'block-error' }
7878

79-
// In-flight wins over the existing value: when the group is being re-run,
80-
// the current value is about to be overwritten — surface the run state so
81-
// the user sees the cell is changing. Without this, a queued / running
82-
// re-run on a previously-completed cell looks like nothing happened until
83-
// the new value lands.
79+
// Active re-run of THIS column wins over its prior value — the value is
80+
// about to be overwritten and the user should see the cell is changing.
8481
const inFlight =
8582
exec?.status === 'running' || exec?.status === 'queued' || exec?.status === 'pending'
83+
if (inFlight && blockRunning) return { kind: 'running' }
84+
85+
// Value wins over `pending-upstream`: once this column's output has
86+
// landed, the cell is done from the user's perspective — even if the
87+
// group is still running other blocks downstream. Without this, mid-run
88+
// partial-write events (`status: 'running'` carrying outputs but tagging
89+
// a different block as running) would flip a finished column back to the
90+
// amber Pending pill until the terminal `completed` event arrives.
91+
if (!isNull) return { kind: 'value', text: stringifyValue(value) }
92+
8693
if (inFlight && !(groupHasBlockErrors && !blockRunning)) {
87-
if (blockRunning) return { kind: 'running' }
8894
if (exec?.status === 'queued' || exec?.status === 'pending') return { kind: 'queued' }
89-
// `running` with this block not in `runningBlockIds` = upstream block
90-
// still going; surface as the amber Pending pill per logs convention.
95+
// `running` with this block not in `runningBlockIds` and no value yet =
96+
// upstream block still going; surface as the amber Pending pill.
9197
return { kind: 'pending-upstream' }
9298
}
9399

94-
if (!isNull) return { kind: 'value', text: stringifyValue(value) }
95-
96100
// Waiting wins over a stale terminal state: if deps are unmet right now,
97101
// the prior `cancelled` / `error` is informational at best — the cell
98102
// can't actually run until the user fills the missing input. Surface the

0 commit comments

Comments
 (0)