GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(table-block): resolve canonical tableId in filter/sort builders by waleedlatif1 · Pull Request #4294 · simstudioai/sim

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Apr 24, 2026

Copy link
Copy Markdown
Collaborator

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

  • Bug fix

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
All reactions
  • 👍 1 reaction
@waleedlatif1
fix(table-block): resolve canonical tableId in filter/sort builders
caa42e4
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.
@vercel

vercel Bot commented Apr 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 Apr 24, 2026 11:15pm

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cursor

cursor Bot commented Apr 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1 waleedlatif1 mentioned this pull request Apr 24, 2026
v0.6.57: mothership reliability, ashby refactor, tables row count, copilot id fix, bun upgrade #4293
Merged
@greptile-apps

greptile-apps Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1
waleedlatif1 merged commit e6fefc8 into staging Apr 24, 2026
14 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1
waleedlatif1 deleted the waleedlatif1/tables-col-picker branch April 24, 2026 23:24

This branch was previously deployed

1 inactive deployment
Preview — caa42e45 Deployed Apr 24, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

1 participant

@waleedlatif1
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.