improvement(block): table empty-state filter/sort builders + upsert conflict-column selection#5123
Conversation
…me/drop prompt `drizzle-kit push --force` only suppresses the data-loss confirm, not the rename-vs-drop disambiguation prompt. That prompt fires whenever a diff both adds and drops tables/columns at once (e.g. migration 0231 created sim_trigger_state while dropping the workspace_notification_* tables), and in CI it crashes with a bare "Interactive prompts require a TTY" stack trace. Catch that specific failure in the dev push step and emit a GitHub error annotation explaining the cause and the fix (drop the stale objects on the dev DB to match schema.ts — the same DROPs the versioned migration already applied to staging/prod), instead of leaving an opaque trace. Exit status is preserved either way. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ct-column selection
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Upsert Row adds optional Conflict Column (basic Table GET returns Reviewed by Cursor Bugbot for commit d2fbab1. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR improves the table block in three areas: filter/sort builders now render an empty "+ Add condition" affordance instead of a phantom blank row; the filter converter skips blank-column rules to prevent
Confidence Score: 5/5Safe to merge; all three feature areas are backwards-compatible and the logic changes are well-scoped. The filter/sort empty-state refactor only affects how the initial store value is rendered — existing serialized rule arrays are handled identically. The converter's blank-column skip is additive and guarded by the existing empty-array fast-path. The upsert conflict-target wiring is fully optional, the backend resolution logic is unchanged, and the error wording is the only behavioral diff. The live-plan maxRows fetch replaces a stale stored value without touching any write paths. apps/sim/hooks/selectors/providers/sim/selectors.ts — the fetchById path does not filter by col.unique, leaving it mildly inconsistent with fetchList. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[FilterBuilder / SortBuilder renders] --> B{rules.length > 0?}
B -- No --> C{isReadOnly?}
C -- Yes --> D[return null]
C -- No --> E[Show Add condition button]
E -->|click| F[addRule adds new rule]
F --> B
B -- Yes --> G[Render rule rows]
G -->|remove last rule| H[removeRule sets rules to empty]
H --> B
I[upsert_row block] --> J{conflictTarget provided?}
J -- Yes --> K{Is it a unique column?}
K -- Yes --> L[Use as conflict target]
K -- No --> M[Throw: not a unique column]
J -- No --> N{uniqueColumns.length == 1?}
N -- Yes --> O[Auto-resolve to that column]
N -- No --> P[Throw: specify conflict column]
Q[table.columns selector] -->|fetchList| R[GET table detail]
R --> S[Filter col.unique === true]
S --> T[Return unique cols as options]
%%{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"}}}%%
flowchart TD
A[FilterBuilder / SortBuilder renders] --> B{rules.length > 0?}
B -- No --> C{isReadOnly?}
C -- Yes --> D[return null]
C -- No --> E[Show Add condition button]
E -->|click| F[addRule adds new rule]
F --> B
B -- Yes --> G[Render rule rows]
G -->|remove last rule| H[removeRule sets rules to empty]
H --> B
I[upsert_row block] --> J{conflictTarget provided?}
J -- Yes --> K{Is it a unique column?}
K -- Yes --> L[Use as conflict target]
K -- No --> M[Throw: not a unique column]
J -- No --> N{uniqueColumns.length == 1?}
N -- Yes --> O[Auto-resolve to that column]
N -- No --> P[Throw: specify conflict column]
Q[table.columns selector] -->|fetchList| R[GET table detail]
R --> S[Filter col.unique === true]
S --> T[Return unique cols as options]
Reviews (5): Last reviewed commit: "fix(tables): source workspaceId for colu..." | Re-trigger Greptile |
…e conflict column
|
@greptile review |
… on rename/drop prompt" This reverts commit 2626482.
…ema (counts, ids, live plan row limit)
|
@greptile review |
|
@greptile review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 033d416. Configure here.
|
@greptile review |
|
Re: Bugbot's "Live maxRows mismatches insert cap" — this is a false positive after merging staging. Insert enforcement is no longer the frozen |

Summary
{ '': … }predicateBackwards compatibility
Type of Change
Testing
Tested manually; lint, api-validation:strict, and
tsc --noEmitpass; table row tests pass (20/20)Checklist