Skip to content

Commit ecbb5c8

Browse files
waleedlatif1claude
andcommitted
fix(tables): fix auto-resize header padding, deduplicate rename metadata logic
Increase header text measurement padding from 36px to 57px to account for the chevron dropdown button (pl-0.5 + 9px icon + pr-2.5) that always occupies layout space. Prevents header text truncation on auto-resize. Deduplicate column rename metadata logic by having columnRename.onSave call handleColumnRename instead of reimplementing the same width/order transfer and metadata persist. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0d9c57f commit ecbb5c8

1 file changed

Lines changed: 2 additions & 13 deletions

File tree

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

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

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -431,18 +431,7 @@ export function Table({
431431
const columnRename = useInlineRename({
432432
onSave: (columnName, newName) => {
433433
pushUndoRef.current({ type: 'rename-column', oldName: columnName, newName })
434-
let updatedWidths = columnWidthsRef.current
435-
if (columnName in updatedWidths) {
436-
const { [columnName]: width, ...rest } = updatedWidths
437-
updatedWidths = { ...rest, [newName]: width }
438-
setColumnWidths(updatedWidths)
439-
}
440-
const updatedOrder = columnOrderRef.current?.map((n) => (n === columnName ? newName : n))
441-
if (updatedOrder) setColumnOrder(updatedOrder)
442-
updateMetadataRef.current({
443-
columnWidths: updatedWidths,
444-
columnOrder: updatedOrder,
445-
})
434+
handleColumnRename(columnName, newName)
446435
updateColumnMutation.mutate({ columnName, updates: { name: newName } })
447436
},
448437
})
@@ -771,7 +760,7 @@ export function Table({
771760
try {
772761
measure.className = 'font-medium text-small'
773762
measure.textContent = columnName
774-
maxWidth = Math.max(maxWidth, measure.offsetWidth + 36)
763+
maxWidth = Math.max(maxWidth, measure.offsetWidth + 57)
775764

776765
measure.className = 'text-small'
777766
for (const row of currentRows) {

0 commit comments

Comments
 (0)