Skip to content

fix(vscode): preserve platform so .NET Framework shows in custom-code dropdown#9367

Merged
lambrianmsft merged 1 commit into
Azure:mainfrom
lambrianmsft:net-framework-custom-code-fix-main
Jul 3, 2026
Merged

fix(vscode): preserve platform so .NET Framework shows in custom-code dropdown#9367
lambrianmsft merged 1 commit into
Azure:mainfrom
lambrianmsft:net-framework-custom-code-fix-main

Conversation

@lambrianmsft

@lambrianmsft lambrianmsft commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Commit Type

  • feature - New functionality
  • fix - Bug fix
  • refactor - Code restructuring without behavior change
  • perf - Performance improvement
  • docs - Documentation update
  • test - Test-related changes
  • chore - Maintenance/tooling

Risk Level

  • Low - Minor changes, limited scope
  • Medium - Moderate changes, some user impact
  • High - Major changes, significant user/system impact

What & Why

TL;DR: On Windows, the custom-code .NET Version dropdown stopped offering the Windows-only .NET Framework (net472) option in both the createWorkspace and createProject VS Code webview wizards. Only .NET 8 and .NET 10 showed.

The option is gated on redux createWorkspace.platform === 'win32', but platform ended up null, so the option was hidden. The extension host was already correct — it always sends platform: os.platform() and separator in the initialize_frame payload for every create flow. Two reducer bugs dropped that value:

  • createWorkspace flow: initializeWorkspace set platform, but the flow wrappers' mount-time resetState(undefined) wiped it back to null.
  • createProject flow: the webview dispatches only initializeProject, which never read platform/separator from its payload, so platform stayed null.

Fix (both in createWorkspaceSlice.ts):

  • resetState now always preserves the host-environment values platform and separator (regardless of preserveLogicAppData), via a single-merge Object.assign(state, initialState, preserved).
  • initializeProject now also captures platform and separator from its payload.

No changes to webviewCommunication.tsx, the flow wrappers, or the host handler — the createProject and createWorkspace flows are kept separate.

Impact of Change

  • Users: On Windows, the .NET Framework option is restored in the custom-code .NET Version dropdown for both the create-workspace and create-project wizards. No change on macOS/Linux (still .NET 8 / .NET 10).
  • Developers: resetState no longer wipes host-environment fields (platform, separator); initializeProject now reads them from its payload. Redux reducer contract clarified and locked by new tests.
  • System: No architecture, performance, or dependency changes. Purely a redux state-preservation fix in the VS Code webview.

Test Plan

  • Unit tests added/updated
  • E2E tests added/updated
  • Manual testing completed
  • Tested in:

New state/__test__/createWorkspaceSlice.test.ts locks the preservation behavior and positive Windows sequences for both flows. Strengthened dotNetFrameworkStep.test.tsx asserts the exact per-platform option set (win32 -> Framework/8/10; darwin/linux/null -> 8/10). All tests pass locally; biome clean.

Contributors

Screenshots/Videos

The only user-visible change is the .NET Framework entry reappearing in the .NET Version dropdown on Windows; behavior is covered by the per-platform option-set unit assertions in dotNetFrameworkStep.test.tsx.

Copilot AI review requested due to automatic review settings July 2, 2026 22:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a VS Code webview wizard regression where the Windows-only .NET Framework (net472) option disappeared from the custom-code .NET Version dropdown because createWorkspace.platform was being reset to null (or never captured in the createProject flow).

Changes:

  • Preserve host-environment fields (platform, separator) across resetState() so mount-time resets don’t wipe Windows platform detection.
  • Capture platform/separator in initializeProject() for the createProject (createLogicApp) flow.
  • Add/strengthen reducer + UI tests to lock in the per-platform framework option behavior.

Reviewed changes

Copilot reviewed 9 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
libs/vscode-extension/src/graphify-out/GRAPH_REPORT.md Regenerated Graphify report metadata/content (freshness, nodes/communities).
libs/logic-apps-shared/src/graphify-out/GRAPH_REPORT.md Regenerated Graphify report metadata/content (freshness, nodes/communities).
libs/data-mapper-v2/src/graphify-out/GRAPH_REPORT.md Regenerated Graphify report metadata/content (freshness, nodes/communities).
libs/chatbot/src/graphify-out/graph.json Regenerated Graphify graph JSON output.
libs/chatbot/src/graphify-out/GRAPH_REPORT.md Regenerated Graphify report metadata/content (freshness, nodes/communities).
libs/a2a-core/src/graphify-out/GRAPH_REPORT.md Regenerated Graphify report metadata/content (freshness, nodes/communities).
apps/vs-code-react/src/state/createWorkspaceSlice.ts Preserve platform/separator on resets; capture them in initializeProject().
apps/vs-code-react/src/state/test/createWorkspaceSlice.test.ts New reducer tests validating preservation + init/reset sequences for both flows.
apps/vs-code-react/src/app/createWorkspace/steps/test/dotNetFrameworkStep.test.tsx Strengthened dropdown option assertions for Windows vs non-Windows (incl. null platform).

@lambrianmsft lambrianmsft added the risk:low Low risk change with minimal impact label Jul 2, 2026
… dropdown

The custom-code ".NET Version" dropdown (DotNetFrameworkStep) hid the
Windows-only .NET Framework (net472) option because redux
createWorkspace.platform ended up null in both the createWorkspace and
createProject webview wizards.

Two bugs, both in createWorkspaceSlice.ts:

- createWorkspace flow: initializeWorkspace set platform, but the flow
  wrappers' mount-time resetState(undefined) wiped it back to null.
  Fix: resetState now always preserves the host-environment values
  platform and separator, regardless of preserveLogicAppData.

- createProject flow: the webview dispatches only initializeProject,
  which never read platform/separator from its payload, so platform
  stayed null. Fix: initializeProject now also captures platform and
  separator (the host already sends them in initialize_frame).

Adds reducer-level tests (createWorkspaceSlice.test.ts) locking the
preservation behavior and positive Windows sequences for both flows,
and strengthens dotNetFrameworkStep.test.tsx to assert the exact
per-platform option set (win32 -> Framework/8/10; others -> 8/10).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@lambrianmsft lambrianmsft force-pushed the net-framework-custom-code-fix-main branch from 823fe71 to 77b7710 Compare July 2, 2026 23:05
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🤖 AI PR Validation Report

PR Review Results

Thank you for your submission! Here's detailed feedback on your PR title and body compliance:

PR Title

  • Current: fix(vscode): preserve platform so .NET Framework shows in custom-code dropdown
  • Issue: No blocking issue found. This is specific and clearly describes the user-facing fix.
  • Recommendation: None required.

Commit Type

  • Properly selected (fix).
  • Only one commit type is selected, which is correct.

Risk Level

  • The selected risk level (Low) matches the scope of the diff. The change is localized to Redux state handling and tests, with limited user impact.

What & Why

  • Current: Clear and detailed summary of the bug, root cause, and fix.
  • Issue: None blocking.
  • Recommendation: None required.

Impact of Change

  • The section is sufficiently populated and explains user, developer, and system impact.
  • Recommendation:
    • Users: Good as written.
    • Developers: Good as written.
    • System: Good as written.

Test Plan

  • Unit tests are added/updated in the diff, which satisfies the test plan requirement.
  • Manual testing is also checked and explained appropriately.

Contributors

  • Contributors are listed. No issue found.

⚠️ Screenshots/Videos

  • This is a UI-related change, so screenshots could be helpful for reviewers.
  • Not required to pass, but consider adding a screenshot or short video showing the .NET Framework option restored on Windows.

Summary Table

Section Status Recommendation
Title None
Commit Type None
Risk Level None
What & Why None
Impact of Change None
Test Plan None
Contributors None
Screenshots/Videos ⚠️ Optional: add a screenshot/video for the UI dropdown change

This PR passes review for title/body compliance. The advised risk level is low, which matches the submitter’s assessment.


Last updated: Thu, 02 Jul 2026 23:05:44 GMT

@lambrianmsft lambrianmsft merged commit 7f1b868 into Azure:main Jul 3, 2026
67 of 74 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-validated risk:low Low risk change with minimal impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants