fix(designer): Copied set variables missing dropdown values#9393
Merged
lambrianmsft merged 3 commits intoJul 14, 2026
Conversation
dce77a4 to
5aeaafc
Compare
Contributor
🤖 AI PR Validation ReportPR Review ResultsThank you for your submission! Here's detailed feedback on your PR title and body compliance:✅ PR Title
✅ Commit Type
✅ Risk Level
✅ What & Why
✅ Impact of Change
✅ Test Plan
|
| Section | Status | Recommendation |
|---|---|---|
| Title | ✅ | No change needed |
| Commit Type | ✅ | No change needed |
| Risk Level | ✅ | Correctly declared as low |
| What & Why | ✅ | No change needed |
| Impact of Change | ✅ | No change needed |
| Test Plan | ✅ | Unit tests present |
| Contributors | Add reviewers before merge | |
| Screenshots/Videos | Optional: add before/after dropdown image |
✅ This PR passes all required checks and is clear to merge. Two non-blocking nudges: add reviewers and consider a before/after screenshot of the populated dropdown.
Powered by: Copilot CLI (claude-opus-4.8) | Last updated: Tue, 14 Jul 2026 15:16:03 GMT
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a copy/paste regression in the Logic Apps designer where pasted variable-setting actions (e.g., SetVariable) could lose their upstream-variable context, resulting in an empty variable-name dropdown. The change updates the paste metadata/token initialization path and adds a guarded UI fallback to avoid an empty-dropdown dead end.
Changes:
- Forward paste-site upstream token node IDs into
initializeOutputTokensForOperationsso pasted nodes inherit the correct upstream slice. - Add a fallback for the
variablenameeditor: when scoped variable options are empty, fall back to all declared variables (filtered bysupportedTypes). - Add/extend unit tests (v1) to cover the new plumbing and the dropdown fallback behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| libs/designer/src/lib/ui/panel/nodeDetailsPanel/tabs/parametersTab/index.tsx | Adds fallback logic for variable-name dropdown options when scoped list is empty. |
| libs/designer/src/lib/ui/panel/nodeDetailsPanel/tabs/parametersTab/test/getEditorAndOptions.spec.ts | Adds tests covering fallback behavior and non-regression when scoped options exist. |
| libs/designer/src/lib/core/actions/bjsworkflow/operationdeserializer.ts | Forwards existingOutputTokens keys into token initialization and exports helper for testing. |
| libs/designer/src/lib/core/actions/bjsworkflow/test/operationdeserializer.spec.ts | Adds regression coverage for existingOutputTokens plumbing (minor comment cleanup needed). |
| libs/designer-v2/src/lib/ui/panel/nodeDetailsPanel/tabs/parametersTab/index.tsx | Mirrors the variable dropdown fallback behavior in designer-v2. |
| libs/designer-v2/src/lib/core/actions/bjsworkflow/operationdeserializer.ts | Mirrors paste-site upstream token forwarding and exports helper in designer-v2. |
rllyy97
approved these changes
Jul 13, 2026
…ition scope When a Condition (or other scope) containing an InitializeVariable-referencing Set Variable is copy-pasted into another location, the pasted Set Variable's Name dropdown was empty. Root cause: pasteScopeOperation passes the paste-site upstream slice via pasteParams.existingOutputTokens, but initializeOperationMetadata was not forwarding those upstream node ids into initializeOutputTokensForOperations (defaulted to []), so each pasted node's upstreamNodeIds only contained fragment-internal predecessors -- missing the outer InitializeVariable. Fixes: * Forward Object.keys(pasteParams.existingOutputTokens) as the 5th arg to initializeOutputTokensForOperations so pasted nodes inherit the paste-site upstream slice. * Add a safety fallback in getEditorAndOptions: when the scoped variable list is empty but variables are declared elsewhere, show all declared variables filtered by supportedTypes. The runtime does not scope variable assignments by graph position, so any declared variable is legally assignable. * Applied identically to designer-v2 (which is what the customer's app renders). Tests: * New operationdeserializer.spec.ts covers the pasteParams plumbing. * getEditorAndOptions.spec.ts extended with parameterized fallback tests across all 5 variablename operations. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: af9ea0d5-71e4-45d9-9790-0edc869beadd
5aeaafc to
a113e64
Compare
Contributor
AI PR Validation ReportIssues Found
Please update your PR to match the template. The check re-runs automatically on edit. Last updated: Mon, 13 Jul 2026 22:10:32 GMT | Copilot unavailable, using deterministic checks |
14 tasks
Eric-B-Wu
approved these changes
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Commit Type
Risk Level
What & Why
TL;DR: When a Condition scope containing a
SetVariable(or anyvariablename-editor action) is copy-pasted elsewhere in the workflow, the pasted action's Name dropdown was empty. Customers had to drop into code view to reference the variable.Root cause:
pasteScopeOperationgathers the paste-site upstream slice intopasteParams.existingOutputTokens, butinitializeOperationMetadatadid not forward those ids intoinitializeOutputTokensForOperations(the 5thnodeIdsToRefresharg defaulted to[]). Each pasted node'supstreamNodeIdstherefore only contained fragment-internal predecessors — missing the outerInitializeVariable— sogetAvailableVariables(variables, upstreamNodeIds)returned nothing and the dropdown was empty.Fixes:
operationdeserializer.ts(bothlibs/designerandlibs/designer-v2) — forwardObject.keys(pasteParams.existingOutputTokens)as the 5th arg so pasted nodes inherit the paste-site upstream slice.parametersTab/index.tsx— safety fallback ingetEditorAndOptionsvariablename branch: when the scoped list is empty but variables are declared elsewhere, show all declared variables filtered bysupportedTypes. The runtime does not scope variable assignments by graph position, so any declared variable is legally assignable. This preserves the ideal UX when the scoped list is non-empty; it only prevents an empty-dropdown dead-end.Applied identically to
designeranddesigner-v2since the customer's app renders through/v2.Impact of Change
SetVariable/IncrementVariable/DecrementVariable/AppendToStringVariable/AppendToArrayVariableactions inside a copied scope now show their variable options in the Name dropdown, matching the behavior of a freshly-added action. No workaround via code view required.initializeOutputTokensForOperationsis now exported fromoperationdeserializer.ts(v1 + v2) for regression coverage. No breaking API changes; the added 5th arg is optional and defaults to[].pasteParamsis only non-null during paste) and a guarded empty-list fallback in one editor resolver.Test Plan
[https://localhost:4200/v2](https://localhost:4200/v2%60) — copied a Condition containing a Set Variable, pasted into the else-branch of another Condition, opened the pasted Set Variable; Name dropdown populated correctly. Full designer test suite: 183/183 (v1) and 127/127 (v2) passing.New/updated tests:
libs/designer/src/lib/core/actions/bjsworkflow/__test__/operationdeserializer.spec.ts— covers theexistingOutputTokensplumbing (with-ids and default-empty paths).libs/designer/src/lib/ui/panel/nodeDetailsPanel/tabs/parametersTab/__test__/getEditorAndOptions.spec.ts— parameterized fallback tests across all 5variablenameoperations (setVariable, increment/decrement, appendToString/Array) plus a regression asserting the fallback does NOT alter behavior whenscopedOptionsis non-empty.Contributors
Screenshots/Videos