Skip to content

improvement(tables): migrate inputs to emcn chip components and clean up tables feature#4995

Merged
waleedlatif1 merged 3 commits into
stagingfrom
worktree-tables-emcn-input-migration
Jun 12, 2026
Merged

improvement(tables): migrate inputs to emcn chip components and clean up tables feature#4995
waleedlatif1 merged 3 commits into
stagingfrom
worktree-tables-emcn-input-migration

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • migrate all form-style inputs in the tables feature to the emcn chip family: column name (column-config + workflow sidebars), enrichment output names, enrichments search (with icon={Search}), table find, and filter value now use ChipInput; filter column/operator pickers now use ChipDropdown instead of hand-rolled 28px pills
  • drive error states through the error prop instead of className border overrides; fix ChipCombobox error misuse where the message replaced the options list (workflow picker, enrichment input mapping)
  • fix undefined --text-danger CSS var (rendered in currentColor, not red) and wrong text-destructive token in field errors — both now --text-error
  • hoist duplicated RequiredLabel/FieldError into shared sidebar-fields, extract ActionIconButton in the table action bar (4x duplicated chrome string), align enrichments-sidebar close buttons with sibling sidebars, swap lucide X/ChevronDown for the emcn icons
  • cleanup pass over the tables feature: keyed ExpandedCellEditor so an in-progress cell draft survives SSE/refetch row updates; memoize filter/aside props feeding the memoized Resource.Header/Resource.Options; derive uploading from uploadProgress; drop unstable mutation object from handleCreateTable deps; delete dead useTableRows hook

Type of Change

  • Improvement

Testing

bun run check:api-validation passes, tables unit tests pass (28/28), typecheck clean. Tested manually

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 Jun 12, 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 Jun 12, 2026 5:17pm

Request Review

@cursor

cursor Bot commented Jun 12, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
UI-only refactors and removal of an unused query hook; expanded-cell draft isolation is a targeted editing fix with no auth or data-path changes.

Overview
Migrates tables UI to emcn chip controls and aligns validation styling across column, workflow, enrichment, filter, and find surfaces.

Form fields move from Input and custom dropdowns to ChipInput and ChipDropdown, with errors driven by the error prop and messages shown via shared FieldError / RequiredLabel (sidebar-fields). ChipCombobox no longer misuses error as inline copy (workflow picker, enrichment inputs); run-settings errors use --text-error instead of broken --text-danger. Enrichments search uses ChipInput with a search icon; sidebar close buttons use Button; action bar icons share ActionIconButton.

Behavior / perf fixes: expanded cell editing uses a keyed ExpandedCellEditor so drafts survive row refetches while the popover stays open; filter rules keep stale column ids visible after column removal; Resource.Options / Resource.Header get memoized filter / aside props on table detail and list pages; CSV upload uploading is derived from progress; useTableRows is removed as dead code.

Reviewed by Cursor Bugbot for commit c180722. Configure here.

@greptile-apps

greptile-apps Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR is a UI migration + cleanup pass over the tables feature: all hand-rolled inputs and dropdown pickers are replaced with the canonical ChipInput / ChipDropdown components, and shared RequiredLabel / FieldError helpers are extracted into a new sidebar-fields module to eliminate duplication across the column-config and workflow sidebars.

  • Component migrations: InputChipInput (column names, enrichment output names, search boxes, filter value, table find); hand-rolled 28 px <button> pills → ChipDropdown for filter column/operator pickers; DropdownMenu wrappers → ActionIconButton for the action bar's 4× duplicated Tooltip+Button chrome.
  • Error state standardisation: all field errors now use the --text-error CSS token and the shared FieldError component; ChipCombobox error string-misuse (where the message replaced the option list) is fixed by displaying the error via FieldError beneath the combobox instead.
  • Correctness / performance fixes: ExpandedCellEditor is keyed on the edited cell so in-progress drafts survive SSE/refetch row updates; filter/aside props feeding memoised Resource.Header/Resource.Options are now stable useMemo-derived objects; uploading is derived from uploadProgress.total > 0 instead of a parallel boolean; the useTableRows dead hook is deleted.

Confidence Score: 5/5

Safe to merge — the changes are purely additive UI migrations and cleanup with no schema, API, or data-layer changes.

All changed paths are UI components or a dead-hook deletion. The chip component migrations are drop-in replacements (ChipInput forwards its ref, ChipDropdown handles string values correctly), CSS token fixes eliminate a class of invisible-colour bugs, and the ExpandedCellEditor keying fix is a correctness improvement with no regressions. The uploading state derivation and memo-stability fixes are straightforward. No database queries, auth paths, or API contracts are touched.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/cells/expanded-cell-popover.tsx Extracts ExpandedCellEditor into a keyed sub-component so SSE row updates no longer reset an in-progress draft; handleSave/handleTextareaKeyDown logic is preserved verbatim.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/sidebar-fields/sidebar-fields.tsx New shared module hoisting RequiredLabel and FieldError with the correct --text-error token, replacing three separate inline copies that used stale or wrong CSS vars.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-action-bar/table-action-bar.tsx ActionIconButton extracted to eliminate 4× duplicated Tooltip+Button chrome; interface and callers are consistent, disabled is always a boolean.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-filter/table-filter.tsx Column/operator pickers migrated to ChipDropdown; stale-column guard added so a deleted column's id stays selectable; filter value moved to ChipInput.
apps/sim/app/workspace/[workspaceId]/tables/tables.tsx uploading derived from uploadProgress.total > 0 (eliminates separate boolean); filter/aside props memoised for Resource stability; createTable removed from handleCreateTable deps with correct eslint-disable.
apps/sim/hooks/queries/tables.ts Removes dead useTableRows hook; fixes misplaced downloadTableExport JSDoc (was accidentally placed before cancelTableImport); updates RowsCacheEntry comment.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/workflow-sidebar/workflow-sidebar.tsx Migrates column-name Input → ChipInput with proper error prop; removes ChipCombobox error-string misuse; imports shared RequiredLabel/FieldError.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/enrichments-sidebar/enrichment-config.tsx Output-name Input → ChipInput with error prop; input-mapping validation error now uses shared FieldError; cn import removed.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-find.tsx Input → ChipInput; ref forwarded to inner input via forwardRef — compatible with the RefObject<HTMLInputElement

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    subgraph Shared["sidebar-fields (new)"]
        RL["RequiredLabel"]
        FE["FieldError\n(--text-error token)"]
    end

    subgraph ColumnConfig["column-config-sidebar"]
        CI1["ChipInput\n(column name)"]
    end

    subgraph WorkflowSidebar["workflow-sidebar"]
        CI2["ChipInput\n(column name)"]
        CC1["ChipCombobox\n(workflow picker)\n— error via FieldError below"]
    end

    subgraph EnrichmentConfig["enrichment-config"]
        CI3["ChipInput\n(output name)"]
        CC2["ChipCombobox\n(input mapping)\n— error via FieldError below"]
    end

    subgraph FilterRow["table-filter / FilterRuleRow"]
        CD1["ChipDropdown\n(column)"]
        CD2["ChipDropdown\n(operator)"]
        CI4["ChipInput\n(value)"]
    end

    subgraph TableFind["table-find"]
        CI5["ChipInput\nref forwarded → HTMLInputElement"]
    end

    subgraph ActionBar["table-action-bar"]
        AIB["ActionIconButton\n(extracted — 4× de-dup)\nTooltip + Button chrome"]
    end

    subgraph ExpandedCell["expanded-cell-popover"]
        ECE["ExpandedCellEditor\nkey=rowId:colKey\ndraft survives SSE refetch"]
    end

    Shared -->|imported by| ColumnConfig
    Shared -->|imported by| WorkflowSidebar
    Shared -->|imported by| EnrichmentConfig
Loading

Reviews (2): Last reviewed commit: "improvement(tables): scope create-table ..." | Re-trigger Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit cb2907c. Configure here.

@waleedlatif1 waleedlatif1 force-pushed the worktree-tables-emcn-input-migration branch from 5611551 to c180722 Compare June 12, 2026 17:17
@waleedlatif1

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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit c180722. Configure here.

@waleedlatif1 waleedlatif1 merged commit e2523e0 into staging Jun 12, 2026
15 checks passed
@waleedlatif1 waleedlatif1 deleted the worktree-tables-emcn-input-migration branch June 12, 2026 17:30
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