Skip to content

Commit d8050bf

Browse files
committed
fix(tables): draw row-selection left edge as checkbox cell border so it cannot be cut off
1 parent bc1a0dd commit d8050bf

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

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

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

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,24 @@ export const DataRow = React.memo(function DataRow({
194194
}, [workflowGroups, row])
195195
const isMultiCell = sel !== null && (sel.startRow !== sel.endRow || sel.startCol !== sel.endCol)
196196
const isRowSelected = isRowChecked
197+
/**
198+
* Whether the selection's left edge sits at column 0 for this row. The blue
199+
* edge is drawn as the checkbox cell's own right border (not the overlay's
200+
* `border-l`) so the sticky checkbox cell can never paint over it and the
201+
* gray/blue lines never double up at the column boundary.
202+
*/
203+
const rowInRange = sel !== null && rowIndex >= sel.startRow && rowIndex <= sel.endRow
204+
const isLeftEdgeSelected = isRowChecked || (isMultiCell && rowInRange && sel!.startCol === 0)
197205

198206
return (
199207
<tr onContextMenu={(e) => onContextMenu(e, row)}>
200-
<td className={cn(CELL_CHECKBOX, 'cursor-pointer')}>
208+
<td
209+
className={cn(
210+
CELL_CHECKBOX,
211+
'cursor-pointer',
212+
isLeftEdgeSelected && 'border-r-[var(--selection)]'
213+
)}
214+
>
201215
<div
202216
className={cn(
203217
'flex items-center',
@@ -322,7 +336,7 @@ export const DataRow = React.memo(function DataRow({
322336
isFirstRow && isTopEdge && 'top-0',
323337
isTopEdge && 'border-t border-t-[var(--selection)]',
324338
isBottomEdge && 'border-b border-b-[var(--selection)]',
325-
isLeftEdge && 'border-l border-l-[var(--selection)]',
339+
isLeftEdge && colIndex !== 0 && 'border-l border-l-[var(--selection)]',
326340
isRightEdge && 'border-r border-r-[var(--selection)]'
327341
)}
328342
/>

0 commit comments

Comments
 (0)