Skip to content

Commit 0f986cf

Browse files
committed
chore(tables): address review nits on row selection refactor
- guard selectedRowCount 'all' branch on contextRow membership in rows - restore blank line between row-selection helpers and constants
1 parent 3fa050d commit 0f986cf

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

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

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ function rowSelectionCoversAll(sel: RowSelection, rows: TableRowType[]): boolean
116116
for (const r of rows) if (!sel.ids.has(r.id)) return false
117117
return true
118118
}
119+
119120
const COL_WIDTH_MIN = 80
120121
const COL_WIDTH_AUTO_FIT_MAX = 1000
121122
// Wide enough to host the row-number + per-row run button side by side.
@@ -2448,7 +2449,9 @@ export function Table({
24482449
const contextRow = contextMenu.isOpen ? contextMenu.row : null
24492450
if (!contextRow) return 1
24502451

2451-
if (rowSelection.kind === 'all') return Math.max(rows.length, 1)
2452+
if (rowSelection.kind === 'all') {
2453+
return rows.some((r) => r.id === contextRow.id) ? Math.max(rows.length, 1) : 1
2454+
}
24522455

24532456
if (rowSelection.kind === 'some' && rowSelection.ids.has(contextRow.id)) {
24542457
let count = 0

0 commit comments

Comments
 (0)