improvement(tables): restore column configuration UX - #7390
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
5ff4e81 to
f0bdfb9
Compare
Greptile SummaryRestores table-column configuration interactions, including inline header renaming with in-place validation and shared clipboard handling for row IDs.
Confidence Score: 4/5The failed-mutation path should be fixed before merging because it leaves an operation that never succeeded in the user's undo history. Rename requests are optimistically represented in undo history before persistence, while the failure path rolls back the displayed schema without removing the corresponding undo action. Files Needing Attention: apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx | Integrates inline rename validation and clipboard handling, but records rename undo history before persistence succeeds. |
| apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/headers/column-header-menu.tsx | Adds rename error presentation and double-click rename behavior while protecting workflow-output columns. |
| apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/utils.ts | Adds column-name validation aligned with the backend pattern, length, and duplicate-name rules. |
Reviews (1): Last reviewed commit: 5ff4e81 | Re-trigger Greptile
| // restores the label (not the id) and targets the right column. | ||
| onSave: (columnName, newName) => { | ||
| const oldName = columnsRef.current.find((c) => c.key === columnName)?.name ?? columnName | ||
| pushUndoRef.current({ type: 'rename-column', oldName, newName, columnId: columnName }) |
There was a problem hiding this comment.
Failed rename pollutes undo history
When a rename request fails after passing local validation, the undo action has already been recorded even though the mutation rolls back the schema. The next undo therefore replays an operation that never succeeded, consuming the user's undo or unexpectedly applying the previously rejected name.
There was a problem hiding this comment.
2 issues found across 8 files
Confidence score: 3/5
- In
table-grid.tsx, clearing a column name can letsubmitRenameexit edit mode without an error, leaving the user unable to correct the invalid empty value; validate the trimmed value before exiting edit mode. - In
table-grid.tsx, a rejected save for a previous column can mark the currently edited column's input invalid, confusing users during overlapping rename operations; updaterenameErroronly when the active editing id still matches the failed column.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx">
<violation number="1" location="apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx:1522">
P2: When a previous column's save rejects after a new column enters rename mode, this unconditional update marks the new input invalid. Set `renameError` only when the active editing id still matches the failed `columnName`.</violation>
<violation number="2" location="apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx:1540">
P2: When the user clears a column name, this guard skips `columnNameIssue`, and `submitRename` exits edit mode without an error. Validate the empty trimmed value here so the input remains active and editable.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
| if (isValidationError(error)) { | ||
| toast.error(extractValidationIssues(error)[0]?.message ?? getErrorMessage(error)) | ||
| } | ||
| setRenameError(true) |
There was a problem hiding this comment.
P2: When a previous column's save rejects after a new column enters rename mode, this unconditional update marks the new input invalid. Set renameError only when the active editing id still matches the failed columnName.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx, line 1522:
<comment>When a previous column's save rejects after a new column enters rename mode, this unconditional update marks the new input invalid. Set `renameError` only when the active editing id still matches the failed `columnName`.</comment>
<file context>
@@ -1502,16 +1504,60 @@ export function TableGrid({
+ if (isValidationError(error)) {
+ toast.error(extractValidationIssues(error)[0]?.message ?? getErrorMessage(error))
+ }
+ setRenameError(true)
+ throw error
+ })
</file context>
| setRenameError(true) | |
| if (columnRenameRef.current.editingId === columnName) setRenameError(true) |
| const { editingId, editValue, submitRename } = columnRenameRef.current | ||
| const trimmedName = editValue.trim() | ||
| const currentColumn = columnsRef.current.find((column) => column.key === editingId) | ||
| if (trimmedName && currentColumn && trimmedName !== currentColumn.name) { |
There was a problem hiding this comment.
P2: When the user clears a column name, this guard skips columnNameIssue, and submitRename exits edit mode without an error. Validate the empty trimmed value here so the input remains active and editable.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx, line 1540:
<comment>When the user clears a column name, this guard skips `columnNameIssue`, and `submitRename` exits edit mode without an error. Validate the empty trimmed value here so the input remains active and editable.</comment>
<file context>
@@ -1502,16 +1504,60 @@ export function TableGrid({
+ const { editingId, editValue, submitRename } = columnRenameRef.current
+ const trimmedName = editValue.trim()
+ const currentColumn = columnsRef.current.find((column) => column.key === editingId)
+ if (trimmedName && currentColumn && trimmedName !== currentColumn.name) {
+ const issue = columnNameIssue(
+ trimmedName,
</file context>
| if (trimmedName && currentColumn && trimmedName !== currentColumn.name) { | |
| if (currentColumn && trimmedName !== currentColumn.name) { |
Summary
Stack
This PR contains the general table UX split out of #7105. It is stacked on the Reference column foundation only because Copy Row ID is introduced there.
Type of Change
Testing
bun run type-checkfromapps/simChecklist