Skip to content

Commit 5d3c11c

Browse files
committed
docs(tables): mark the canonical-pair seam on the folder scope read
Reading the scope by field id is correct only while it has no advanced twin. With both halves of a canonical pair filled the serializer resolves the basic member, so a hand-rolled read can disagree with what the run uses; the file picker goes through useActiveCanonicalSubBlockValue for exactly that reason. Names the hook to reach for if a twin is ever added.
1 parent 93e234e commit 5d3c11c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/table-selector

‎apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/table-selector/table-selector.tsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ export function TableSelector({
6565
* Falling back to this control's own id keeps the hook call unconditional for
6666
* a picker with no folder scope; its own value is a table id, never a folder
6767
* path, so the scope reads as absent.
68+
*
69+
* A plain read of the field id is correct only because the scope has no
70+
* advanced twin (pinned in table-folders.test.ts). If one is ever added, this
71+
* must become `useActiveCanonicalSubBlockValue` — with both halves of a pair
72+
* filled, the serializer resolves the basic member, and a hand-rolled read can
73+
* disagree with the value the run actually uses.
6874
*/
6975
const [folderScopeValue] = useSubBlockValue<unknown>(
7076
blockId,

0 commit comments

Comments
 (0)