GeezerVison is showing github.com — fix(table-block): resolve canonical tableId in filter/sort builders by waleedlatif1 · Pull Request #4294 · simstudioai/sim
Conversation
Summary
- Filter/sort builders in the Table block were always showing "no options available" in the column picker
- They read the selected tableId from subBlock id
'tableId', but the Table block stores the value under 'tableSelector' (basic) or 'manualTableId' (advanced) via canonicalParamId — the lookup always returned null, so useTable stayed disabled and columns never loaded
- Added
useCanonicalSubBlockValue which resolves a value by canonicalParamId through the canonical index (same pattern dropdowns use for dependsOn), and swapped it into FilterBuilder and SortBuilder
Type of Change
Testing
Tested manually — columns now populate in the Query Rows filter/sort builders and the Update/Delete by filter builder when a table is selected in either basic or advanced mode.
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)
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
greptile-apps[bot] reacted with thumbs up emoji
The visual filter/sort builders read the selected tableId from subBlock id
'tableId', but the Table block stores it under 'tableSelector' (basic) or
'manualTableId' (advanced) via canonicalParamId. The lookup always returned
null, so useTable was disabled and the column picker always showed
"no options available".
Adds useCanonicalSubBlockValue that resolves by canonicalParamId through
the canonical index, mirroring the pattern used by dropdown dependsOn.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
| Project |
Deployment |
Actions |
Updated (UTC) |
| docs |
Skipped |
|
Apr 24, 2026 11:15pm |

|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
cursor
Bot
commented
Apr 24, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
PR Summary
Low Risk
Low risk, localized UI-state read change: filter/sort builders now resolve tableId via canonicalParamId mapping, which could affect which sub-block value wins in edge cases but doesn’t touch auth/data writes.
Overview
Fixes Table block filter/sort builders failing to load column options when the selected table is stored under canonical basic/advanced inputs.
Adds useCanonicalSubBlockValue to read a sub-block value via canonicalParamId resolution (using the existing canonical index + resolveDependencyValue), and switches FilterBuilder/SortBuilder to use it when deriving tableId for useTableColumns.
Reviewed by Cursor Bugbot for commit caa42e4. Configure here.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Greptile Summary
This bug fix resolves a longstanding issue where the column picker in the Table block's filter and sort builders always showed "no options available" because useSubBlockValue was looking up 'tableId' as a raw sub-block ID — which doesn't exist — while the actual values live under 'tableSelector' (basic) or 'manualTableId' (advanced) via canonicalParamId. The new useCanonicalSubBlockValue hook reuses buildCanonicalIndex / resolveDependencyValue from the existing visibility module to resolve whichever canonical member currently holds the value, exactly as the dropdown dependsOn logic does.
Confidence Score: 5/5
Safe to merge — targeted bug fix with no breaking changes and no P0/P1 issues found.
The implementation follows established patterns (useStoreWithEqualityFn + isEqual, buildCanonicalIndex/resolveDependencyValue), handles null gracefully (useTableColumns already accepts null via ?? undefined), and the change is minimal and focused. All remaining observations are P2 or lower.
No files require special attention.
Important Files Changed
| Filename |
Overview |
| apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/hooks/use-canonical-sub-block-value.ts |
New hook that resolves sub-block values through the canonical index, fixing the broken table ID lookup for filter/sort builders; correctly uses useStoreWithEqualityFn with isEqual and memoized selectors following established patterns. |
| apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/filter-builder/filter-builder.tsx |
Swaps useSubBlockValue for useCanonicalSubBlockValue for tableIdValue; the API change (no setter destructuring) is intentional and correct since the value is read-only. |
| apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/sort-builder/sort-builder.tsx |
Same tableIdValue fix as filter-builder.tsx; no other changes, straightforward and correct. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["FilterBuilder / SortBuilder\nuseCanonicalSubBlockValue(blockId, 'tableId')"] --> B["buildCanonicalIndex(blockConfig.subBlocks)"]
B --> C{canonicalId found\nfor 'tableId'?}
C -- Yes --> D["getCanonicalValues(group, blockValues)"]
D --> E["resolveCanonicalMode\n(basic or advanced?)"]
E -- basic --> F["values['tableSelector']"]
E -- advanced --> G["values['manualTableId']"]
F --> H["tableIdValue → useTableColumns"]
G --> H
C -- No --> I["values['tableId'] (undefined fallback)"]
I --> J["tableIdValue = null\n(columns stay empty)"]
H --> K["Column options populated ✓"]
Loading
Reviews (1): Last reviewed commit: "fix(table-block): resolve canonical tabl..." | Re-trigger Greptile
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This branch was previously deployed
1 inactive
deployment
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|