Skip to content

fix(tables): enrichment sidebar column-id display + filter-scoped run menu#5459

Merged
TheodoreSpeaks merged 2 commits into
stagingfrom
fix/table-enrich
Jul 7, 2026
Merged

fix(tables): enrichment sidebar column-id display + filter-scoped run menu#5459
TheodoreSpeaks merged 2 commits into
stagingfrom
fix/table-enrich

Conversation

@TheodoreSpeaks

@TheodoreSpeaks TheodoreSpeaks commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Enrichment edit sidebar showed column ids: since the column-ids refactor, workflowGroup.outputs[].columnName / inputMappings[].columnName persist the stable column id (col_…), but the enrichment config sidebar seeded its edit state straight from those refs — reopening a saved enrichment showed the raw column id in the Output Columns name field, input-mapping selections didn't resolve, and retyping the real column name falsely tripped "Column already exists". Fixed by resolving refs via columnMatchesRef, keying combobox options by getColumnId, seeding display names, and targeting renames at the stable id
  • Run menu now respects the active filter: "Run all rows", "Run empty rows", and the "Run N empty rows" presets in the workflow-group header menus (inline quick-run + right-click) now dispatch only against rows matching the active filter, using the same filter-scoped dispatch path as select-all. Labels switch to "Run all filtered rows" / "Run empty filtered rows" / "Run N empty filtered rows" while a filter is active. "Run N selected rows" keeps its explicit row scope

Type of Change

  • Bug fix
  • Improvement

Testing

Tested manually against the staging repro table; type-check, lint:check, check:api-validation:strict, and enrichment/column-keys vitest suites pass

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 Jul 7, 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 Jul 7, 2026 1:42am

Request Review

@cursor

cursor Bot commented Jul 7, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Filter-scoped runs change which rows workflow dispatches touch when a filter is set; enrichment save paths touch column rename and group mapping APIs but are localized UI fixes.

Overview
Fixes the enrichment edit sidebar after stable column ids (col_…) started persisting in workflow-group inputMappings and output refs. Edit state now resolves those refs with columnMatchesRef, keys input comboboxes with getColumnId, shows display names in output fields, and sends renames to updateColumn using the stable id so validation and selections match on reopen.

Separately, workflow-group run actions from the grid header now apply the active table filter for table-scoped modes (run all / empty / N empty), while run selected still uses explicit row ids. Run menu labels switch to “filtered rows” when a filter is active so the scope is obvious.

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

@greptile-apps

greptile-apps Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes two independent bugs in the tables feature: (1) the enrichment configuration sidebar was seeding its edit state directly from raw col_… IDs stored in workflow group refs, causing the Output Columns name field to display opaque IDs instead of display names and falsely triggering "Column already exists" on re-save; (2) the header run-menu items ("Run all rows", "Run empty rows", "Run N empty rows") were ignoring the active filter, running against the entire table instead of only matching rows.

  • Enrichment sidebar: Adds columnMatchesRef/getColumnId resolution when seeding inputMappings and outputNames state, and rewrites the column-rename path to target the stable column ID rather than the display name.
  • Filter-scoped run menu: handleRunColumn in table-grid.tsx now derives the active filter from queryOptions.filter when no explicit rowIds are provided, passing it through to onRunColumn; the WorkflowGroupMetaCell receives a new hasActiveFilter prop that switches menu labels to "Run all/empty filtered rows".

Confidence Score: 5/5

Both fixes are narrowly scoped and self-consistent; the enrichment config correctly threads column-ID resolution throughout all edit-mode paths, and the filter propagation mirrors the existing context-menu select-all pattern.

The enrichment sidebar fix resolves each ID reference through columnMatchesRef before seeding state, correctly seeds display names for the output name field, and targets stable IDs on rename — all three failure modes from the bug description are addressed in concert. The filter fix in handleRunColumn follows the exact pattern already used in the context menu's runSelection path, and the single WorkflowGroupMetaCell render site in table-grid.tsx receives the new prop. No regressions are visible in the changed paths.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/enrichments-sidebar/enrichment-config.tsx Refactors enrichment edit-mode seeding to resolve col_… refs via columnMatchesRef/getColumnId; output names now seed from display names, input mapping keys are stable column IDs, and column renames target the stable ID — correctly fixing the ID-in-name-field and false 'Column already exists' bugs.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/headers/workflow-group-meta-cell.tsx Adds hasActiveFilter prop and runMenuLabels helper; both the inline Play dropdown and the right-click ColumnOptionsMenu now show 'filtered rows' labels when a filter is active. Clean, isolated label change with no logic mutations.
apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx handleRunColumn now passes queryOptions.filter when rowIds is absent; hasActiveFilter is threaded to WorkflowGroupMetaCell. Consistent with how the context-menu runSelection path already handled filter-scoped select-all runs.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant User
    participant MetaCell as WorkflowGroupMetaCell
    participant Grid as TableGrid.handleRunColumn
    participant Prop as onRunColumn (prop)
    participant Server

    Note over MetaCell: hasActiveFilter prop now passed from TableGrid

    User->>MetaCell: Click "Run all rows" (filter active)
    MetaCell->>Grid: onRunColumn(groupId, 'all')
    Note over Grid: rowIds is undefined, derive filter
    Grid->>Grid: "filter = queryOptions.filter ?? undefined"
    Grid->>Prop: onRunColumn(groupId, 'all', undefined, undefined, filter)
    Prop->>Server: Run scoped to matching rows

    User->>MetaCell: Click "Run N selected rows"
    MetaCell->>Grid: onRunColumn(groupId, 'all', selectedRowIds)
    Note over Grid: rowIds present, filter = undefined
    Grid->>Prop: onRunColumn(groupId, 'all', selectedRowIds, undefined, undefined)
    Prop->>Server: Run scoped to explicit row IDs
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant User
    participant MetaCell as WorkflowGroupMetaCell
    participant Grid as TableGrid.handleRunColumn
    participant Prop as onRunColumn (prop)
    participant Server

    Note over MetaCell: hasActiveFilter prop now passed from TableGrid

    User->>MetaCell: Click "Run all rows" (filter active)
    MetaCell->>Grid: onRunColumn(groupId, 'all')
    Note over Grid: rowIds is undefined, derive filter
    Grid->>Grid: "filter = queryOptions.filter ?? undefined"
    Grid->>Prop: onRunColumn(groupId, 'all', undefined, undefined, filter)
    Prop->>Server: Run scoped to matching rows

    User->>MetaCell: Click "Run N selected rows"
    MetaCell->>Grid: onRunColumn(groupId, 'all', selectedRowIds)
    Note over Grid: rowIds present, filter = undefined
    Grid->>Prop: onRunColumn(groupId, 'all', selectedRowIds, undefined, undefined)
    Prop->>Server: Run scoped to explicit row IDs
Loading

Reviews (2): Last reviewed commit: "feat(tables): scope group-header run men..." | Re-trigger Greptile

@TheodoreSpeaks TheodoreSpeaks changed the title fix(tables): resolve column ids to display names in enrichment edit sidebar fix(tables): enrichment sidebar column-id display + filter-scoped run menu Jul 7, 2026
@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile review

@TheodoreSpeaks TheodoreSpeaks merged commit e9a922d into staging Jul 7, 2026
19 checks passed
@TheodoreSpeaks TheodoreSpeaks deleted the fix/table-enrich branch July 7, 2026 01:51
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