Skip to content

Commit 99cbfcb

Browse files
fix(tables): single run/stop control, right-aligned row numbers, View-execution guard
- table: de-duplicate the run/stop control in the embedded mothership view — drop TableGrid's own embedded run-status bar; it now lives only in the options bar (left-aligned next to Filter + Sort). Removes the orphaned RunStatusControl import + onStopAll/cancelRunsPending props. - data-row: right-align the row number within its box (hugs the right edge, no hover position jump) with a scaled right inset — 2px for ≤3-digit indices, 4px for 4+ so narrow columns don't look over-padded. - table-grid: require a real executionId in the action bar's canViewExecution flag so an error that never produced an execution (enqueue failure → status 'error', executionId null) doesn't offer "View execution". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent d0cac34 commit 99cbfcb

3 files changed

Lines changed: 11 additions & 21 deletions

File tree

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/data-row.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,12 @@ export const DataRow = React.memo(function DataRow({
201201
tabIndex={0}
202202
aria-checked={isRowSelected}
203203
aria-label={`Select row ${rowIndex + 1}`}
204-
className='group/checkbox flex h-[20px] shrink-0 items-center justify-center'
204+
className={cn(
205+
'group/checkbox flex h-[20px] shrink-0 items-center justify-end',
206+
// Lighter right inset for narrow indices (≤3 digits → numDivWidth ≤ 28);
207+
// full 4px once the column widens (4+ digits, numDivWidth ≥ 36).
208+
numDivWidth >= 36 ? 'pr-1' : 'pr-0.5'
209+
)}
205210
style={{ width: numDivWidth }}
206211
onMouseDown={(e) => {
207212
if (e.button !== 0) return
@@ -213,7 +218,7 @@ export const DataRow = React.memo(function DataRow({
213218
>
214219
<span
215220
className={cn(
216-
'text-center text-[var(--text-tertiary)] text-xs tabular-nums',
221+
'text-right text-[var(--text-tertiary)] text-xs tabular-nums',
217222
isRowSelected ? 'hidden' : 'block group-hover/checkbox:hidden'
218223
)}
219224
>

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

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import {
4040
import type { ColumnConfig } from '../column-config-sidebar'
4141
import { ContextMenu } from '../context-menu'
4242
import { NewColumnDropdown } from '../new-column-dropdown'
43-
import { RunStatusControl } from '../run-status-control'
4443
import type { WorkflowConfig } from '../workflow-sidebar'
4544
import { ExpandedCellPopover } from './cells'
4645
import { ADD_COL_WIDTH, CELL_HEADER_CHECKBOX, COL_WIDTH, SELECTION_TINT_BG } from './constants'
@@ -160,10 +159,6 @@ interface TableGridProps {
160159
onStopRows: (rowIds: string[]) => void
161160
/** Single-row stop for the per-row gutter button. */
162161
onStopRow: (rowId: string) => void
163-
/** Wholesale cancel — page-header "Stop all". */
164-
onStopAll: () => void
165-
/** Whether `useCancelTableRuns` is currently in flight. */
166-
cancelRunsPending: boolean
167162
/**
168163
* Fired whenever the action-bar selection or running-count derivations
169164
* change. Wrapper uses this to render <TableActionBar>.
@@ -258,8 +253,6 @@ export function TableGrid({
258253
onRunRows,
259254
onStopRows,
260255
onStopRow,
261-
onStopAll,
262-
cancelRunsPending,
263256
onSelectionChange,
264257
queryOptions,
265258
columnRenameSinkRef,
@@ -2949,8 +2942,12 @@ export function TableGrid({
29492942
rowId: row.id,
29502943
groupId,
29512944
executionId: exec?.executionId ?? null,
2945+
// Requires a real executionId: an error that never produced an execution
2946+
// (e.g. enqueue failure → status 'error' with executionId null) has no
2947+
// trace to open, so "View execution" must not offer it.
29522948
canViewExecution:
29532949
!isEnrichmentGroup &&
2950+
Boolean(exec?.executionId) &&
29542951
(status === 'completed' || status === 'error' || status === 'running' || isPaused),
29552952
}
29562953
}, [normalizedSelection, rows, displayColumns, workflowGroupById])
@@ -3097,16 +3094,6 @@ export function TableGrid({
30973094

30983095
return (
30993096
<div ref={containerRef} className='flex h-full flex-col overflow-hidden'>
3100-
{embedded && totalRunning > 0 && (
3101-
<div className='flex shrink-0 items-center justify-end border-[var(--border)] border-b px-3 py-1.5'>
3102-
<RunStatusControl
3103-
running={totalRunning}
3104-
onStopAll={onStopAll}
3105-
isStopping={cancelRunsPending}
3106-
/>
3107-
</div>
3108-
)}
3109-
31103097
<div className='relative flex min-h-0 flex-1'>
31113098
<div
31123099
ref={scrollRef}

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,6 @@ export function Table({
521521
onRunRows={onRunRows}
522522
onStopRows={onStopRows}
523523
onStopRow={onStopRow}
524-
onStopAll={onStopAll}
525-
cancelRunsPending={cancelRunsMutation.isPending}
526524
onSelectionChange={onSelectionChange}
527525
queryOptions={queryOptions}
528526
columnRenameSinkRef={columnRenameSinkRef}

0 commit comments

Comments
 (0)