Skip to content

Commit 158f889

Browse files
fix(table): address pr review (drop dead workflowNameById prop, reset didDragRef on dragend, align sidebar width)
1 parent 01deeab commit 158f889

5 files changed

Lines changed: 2 additions & 20 deletions

File tree

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ interface CellContentProps {
1414
initialCharacter?: string | null
1515
onSave: (value: unknown, reason: SaveReason) => void
1616
onCancel: () => void
17-
workflowNameById?: Record<string, string>
1817
/**
1918
* Human-readable labels for unmet deps on this row+group, used to render a
2019
* "Waiting" pill when the cell hasn't run because something it depends on

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ export const COL_WIDTH = 160
77

88
/** Column config sidebar width in pixels — drives both the sidebar's own width
99
* and the table's reserved padding-right while a sidebar is open. */
10-
export const COLUMN_SIDEBAR_WIDTH = 480
10+
export const COLUMN_SIDEBAR_WIDTH = 400

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/headers/workflow-group-meta-cell.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ export function WorkflowGroupMetaCell({
318318
)
319319

320320
const handleDragEnd = useCallback(() => {
321+
didDragRef.current = false
321322
onDragEnd?.()
322323
}, [onDragEnd])
323324

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@ export function TableGrid({
289289
tableWorkflowGroups,
290290
workflowStates,
291291
columnSourceInfo,
292-
workflowNameById,
293292
} = useTable({ workspaceId, tableId, queryOptions })
294293

295294
const fetchNextPageRef = useRef(fetchNextPage)
@@ -3034,7 +3033,6 @@ export function TableGrid({
30343033
isLargeRowCountTable={isLargeRowCountTable}
30353034
onStopRow={onStopRow}
30363035
onRunRow={handleRunRow}
3037-
workflowNameById={workflowNameById}
30383036
workflowGroups={tableWorkflowGroups}
30393037
/>
30403038
))}
@@ -3161,8 +3159,6 @@ interface DataRowProps {
31613159
isLargeRowCountTable: boolean
31623160
onStopRow: (rowId: string) => void
31633161
onRunRow: (rowId: string) => void
3164-
/** Lookup from workflow id → human-readable name, used to label running cells. */
3165-
workflowNameById: Record<string, string>
31663162
/**
31673163
* The table's workflow groups, used to compute per-row "Waiting on …" labels
31683164
* for empty workflow-output cells whose group has unmet dependencies.
@@ -3223,7 +3219,6 @@ function dataRowPropsAreEqual(prev: DataRowProps, next: DataRowProps): boolean {
32233219
prev.isLargeRowCountTable !== next.isLargeRowCountTable ||
32243220
prev.onStopRow !== next.onStopRow ||
32253221
prev.onRunRow !== next.onRunRow ||
3226-
prev.workflowNameById !== next.workflowNameById ||
32273222
prev.workflowGroups !== next.workflowGroups
32283223
) {
32293224
return false
@@ -3266,7 +3261,6 @@ const DataRow = React.memo(function DataRow({
32663261
isLargeRowCountTable,
32673262
onStopRow,
32683263
onRunRow,
3269-
workflowNameById,
32703264
workflowGroups,
32713265
}: DataRowProps) {
32723266
const sel = normalizedSelection
@@ -3422,7 +3416,6 @@ const DataRow = React.memo(function DataRow({
34223416
initialCharacter={isEditing ? initialCharacter : undefined}
34233417
onSave={(value, reason) => onSave(row.id, column.name, value, reason)}
34243418
onCancel={onCancel}
3425-
workflowNameById={workflowNameById}
34263419
waitingOnLabels={
34273420
column.workflowGroupId
34283421
? (waitingByGroupId?.get(column.workflowGroupId) ?? undefined)

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/hooks/use-table.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ export interface UseTableReturn {
5252
/** Pre-resolved icon + block-name info per output column name. Headers read
5353
* from this map instead of each subscribing to its own workflow-state query. */
5454
columnSourceInfo: Map<string, ColumnSourceInfo>
55-
/** `workflowId → workflow.name` lookup for cell labels and execution-detail copy. */
56-
workflowNameById: Record<string, string>
5755
}
5856

5957
/**
@@ -137,14 +135,6 @@ export function useTable({ workspaceId, tableId, queryOptions }: UseTableParams)
137135
return map
138136
}, [tableWorkflowGroups, workflowStates])
139137

140-
const workflowNameById = useMemo(() => {
141-
const map: Record<string, string> = {}
142-
for (const wf of workflows ?? []) {
143-
map[wf.id] = wf.name
144-
}
145-
return map
146-
}, [workflows])
147-
148138
return {
149139
tableData,
150140
isLoadingTable,
@@ -159,6 +149,5 @@ export function useTable({ workspaceId, tableId, queryOptions }: UseTableParams)
159149
tableWorkflowGroups,
160150
workflowStates,
161151
columnSourceInfo,
162-
workflowNameById,
163152
}
164153
}

0 commit comments

Comments
 (0)