Sitelet https://github.com/simstudioai/sim/pull/7048
Skip to content

improvement(tables): inline column creation and header-menu editing - #7048

Closed
j15z wants to merge 2 commits into
stagingfrom
fix/revert-table-side-column
Closed

improvement(tables): inline column creation and header-menu editing#7048
j15z wants to merge 2 commits into
stagingfrom
fix/revert-table-side-column

Conversation

@j15z

@j15z j15z commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Columns are created inline: pick a type from "+ New column", name it in the header, press Enter. Nothing persists until the name commits, so Escape or a reload before that leaves nothing behind
  • Select columns open the options sidebar only after the name commits; Save persists name + options in one create, Cancel/X/another panel discards the draft
  • Column editing moves out of the sidebar into the header menu: Rename column, a Change type submenu (converting to Select opens the options sidebar), Set/Remove unique, and Configure select/currency for per-type settings. The sidebar no longer carries name or type fields
  • Invalid names are refused in place with a toast and red text instead of surfacing as a raw contract error
  • Fixes an infinite recursion in the date display formatter (a number retyped to date, e.g. 100, overflowed the stack and tripped the table error boundary); every registry formatter is now guarded by a totality test
  • Fixes the "+ New column" menu stealing focus from the draft input during its exit animation, the draft cell collapsing the add-column cell (missing <col> in the fixed layout), and the column flicker after creation (create response is now written to the schema cache on success)

Type of Change

  • Improvement

Testing

Tested manually. bun run lint, block-registry check, bun run check:audits, type-check, and 1,633 table/query tests pass. Playwright probes cover instant create, invalid/duplicate names, reload-before-naming, select save/cancel/abandon, type changes, and the layout/flicker cases.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 24, 2026 9:33pm

Request Review

@cursor

cursor Bot commented Aug 24, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches core table schema mutations, column create/update flows, and undo replay; changes are UX-heavy but include formatter and cache-timing fixes that affect grid stability.

Overview
Column creation and editing move into the grid header. Picking a scalar type from "+ New column" now mounts a draft header for naming; nothing hits the API until the name commits (Escape or leaving the flow drops the draft). Select columns open the options sidebar only after a valid name, then persist name + options in one create. The config sidebar is narrowed to select options / multiselect, currency code, and convert-to-select — name, type, and unique are no longer edited there.

The column chevron menu gains Rename, Change type (select conversions route through the options sidebar), Set/Remove unique (registry-driven), and Configure for types with hasConfiguration. Plain column header clicks only select; workflow outputs still open their sidebar on click.

Validation and polish: columnNameIssue refuses bad/duplicate names in the header with toast + red text. The new-column dropdown defers onPickType until after close to avoid Radix stealing focus; draft columns get their own <col> so layout does not collapse. useAddTableColumn writes the create response into the detail cache immediately to avoid post-create flicker.

Fixes: Date formatDateCellDisplay no longer recurses on values like 100 after retype to date (totality tests on formatters). Undo/redo for create-column and type changes now carries full column metadata.

Reviewed by Cursor Bugbot for commit 6ece736. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR moves table-column creation and editing into inline headers and header menus while retaining sidebars for type-specific configuration.

  • Adds deferred inline column drafts with validation, cancellation, layout handling, and schema-cache reconciliation.
  • Adds header-menu actions for rename, type conversion, uniqueness, and select/currency configuration.
  • Updates undo state and column-type formatting tests, including a guard against recursive date formatting.

Confidence Score: 5/5

The PR appears safe to merge because the previously reported import-path issue is fixed and no blocking failure remains.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/headers/draft-column-header.tsx Adds the local draft-name input and now uses the requested absolute @/ import for ColumnTypeIcon.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx Coordinates draft-column lifecycle, inline rename validation, persistence, type changes, layout, and undo recording.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/column-config-sidebar/column-config-sidebar.tsx Narrows the sidebar to select and currency configuration, including draft-select creation and select conversion.
apps/sim/hooks/queries/tables.ts Updates table mutation cache behavior to reconcile created and edited schema data.
apps/sim/hooks/use-table-undo.ts Extends undo handling to retain complete created-column definitions and type-change state.
apps/sim/lib/table/dates.ts Makes date display formatting total for invalid numeric conversions and avoids recursive formatting failure.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Pick[Pick new column type] --> Draft[Create local header draft]
  Draft -->|Escape or reload| Discard[Discard without persistence]
  Draft -->|Commit scalar name| Create[Persist column]
  Draft -->|Commit select name| Options[Open options sidebar]
  Options -->|Save| Create
  Options -->|Cancel or replace panel| Discard
  Header[Existing column header menu] --> Rename[Rename inline]
  Header --> Type[Change type]
  Header --> Unique[Set or remove unique]
  Header --> Configure[Configure select or currency]
Loading

Reviews (2): Last reviewed commit: "fix(tables): preserve column actions acr..." | Re-trigger Greptile

@j15z
j15z force-pushed the fix/revert-table-side-column branch from 8990821 to 6ece736 Compare August 24, 2026 21:32
@j15z

j15z commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

@j15z

j15z commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6ece736. Configure here.

},
onSettled: () => {
invalidateTableSchemaOnly(queryClient, tableId)
queryClient.invalidateQueries({ queryKey: tableKeys.lists() })

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create drops schema refetch

Medium Severity

useAddTableColumn writes result.data.columns into the detail cache on success but no longer invalidates or cancels the detail query. An in-flight detail fetch that started earlier can finish afterward and overwrite that write with a pre-create schema, so the new column disappears until some later unrelated refetch.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6ece736. Configure here.


draftSelectSaveSinkRef.current = (options, multiple) =>
persistDraft({ options, ...(multiple ? { multiple: true } : {}) })
abortColumnDraftSinkRef.current = () => setColumnDraft(null)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Escape clears saving draft

Medium Severity

handleDraftCancel always clears columnDraft and does not consult draftPersistingRef / draftSelectSavingRef. During an in-flight select save, Escape can drop the draft while slideout CLOSE stays blocked, so a failed create leaves the options sidebar open with nothing left for Save to persist.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6ece736. Configure here.

@j15z

j15z commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator Author

Closing as superseded by the narrower sidebar-based Reference column implementation on https://github.com/simstudioai/sim/tree/feat/table-fks. Column creation and configuration now live in the sidebar; inline renaming, Edit column, and pinning remain.

@j15z j15z closed this Aug 26, 2026
@waleedlatif1
waleedlatif1 deleted the fix/revert-table-side-column branch August 26, 2026 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant