fix(trigger): resolve dependsOn for trigger-mode subblocks sharing canonical groups with block subblocks#4095
Conversation
…nonical groups with block subblocks
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview This prevents trigger fields from staying disabled when their IDs aren’t the canonical group’s Reviewed by Cursor Bugbot for commit bb721c9. Configure here. |
Greptile SummaryThis PR fixes a The fix is a one-line Confidence Score: 5/5Safe to merge — targeted one-line fix with no regression risk for regular blocks. The change is a single nullish-coalescing fallback in No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["resolveDependencyValue(dependencyKey, values, canonicalIndex)"] --> B{canonicalId found?}
B -- No --> C["return values[dependencyKey]"]
B -- Yes --> D{group found?}
D -- No --> C
D -- Yes --> E["getCanonicalValues(group, values)"]
E --> F["resolveCanonicalMode(group, values, overrides)"]
F --> G{"mode === 'advanced'?"}
G -- Yes --> H["canonicalResult = advancedValue ?? basicValue"]
G -- No --> I["canonicalResult = basicValue ?? advancedValue"]
H --> J{canonicalResult null/undefined?}
I --> J
J -- No --> K["return canonicalResult"]
J -- Yes --> L["return values[dependencyKey]"]
L --> M["Trigger mode: returns values['triggerCredentials']"]
Reviews (1): Last reviewed commit: "fix(trigger): resolve dependsOn for trig..." | Re-trigger Greptile |
Summary
dependsOngating for trigger-mode subblocks (e.g. Google Sheets spreadsheet picker stays disabled after selecting credentials)resolveDependencyValueresolves trigger subblock IDs through the canonical group from the full block definition, where the group'sbasicIdis the regular block's subblock ID (e.g.credential), not the trigger's subblock ID (e.g.triggerCredentials) — sovalues['credential']is always undefined in trigger modevalues[dependencyKey]when the canonical result is null/undefined — covers the case where the dependency key is a trigger-mode subblock that participates in a canonical group but isn't registered as the group'sbasicIdoradvancedIddependencyKeyIS the group'sbasicIdType of Change
Testing
Tested manually
Checklist