Skip to content

Revert "DYN-9702 templates to home screen (#16932)"#17013

Merged
zeusongit merged 2 commits intoDynamoDS:RC4.1.0_masterfrom
zeusongit:revert-4.1
Apr 6, 2026
Merged

Revert "DYN-9702 templates to home screen (#16932)"#17013
zeusongit merged 2 commits intoDynamoDS:RC4.1.0_masterfrom
zeusongit:revert-4.1

Conversation

@zeusongit
Copy link
Copy Markdown
Contributor

Purpose

Reverts #16932

The work is incomplete. We will be following up with Jira tasks to round out this work.
We’ll regroup and reintroduce the changes once the work is ready in 4.2.

Declarations

Check these if you believe they are true

Release Notes

Reverts #16932

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Reverts the incomplete backend support for exposing/opening Dynamo template files on the Home Page (introduced in #16932).

Changes:

  • Removes template-file collection/loading from StartPageViewModel.
  • Removes template data plumbing from HomePage initialization and WebView script dispatch.
  • Removes the unshipped public API entry for StartPageViewModel.TemplateFiles.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/DynamoCoreWpf/Views/HomePage/HomePage.xaml.cs Removes template-data sending and adjusts recent/sample graph dispatch to the Home Page WebView.
src/DynamoCoreWpf/PublicAPI.Unshipped.txt Removes the unshipped TemplateFiles getter API entry.
src/DynamoCoreWpf/DynamoCoreWpf.csproj Updates compile item list (currently introduces duplicate <Compile Include=...> entries).
src/DynamoCoreWpf/Controls/StartPage.xaml.cs Removes template file list/state and associated initialization logic from the start page VM.
Comments suppressed due to low confidence (1)

src/DynamoCoreWpf/Views/HomePage/HomePage.xaml.cs:329

  • SendRecentGraphsData was changed to async void even though it’s not an event handler. This can crash the UI thread on exceptions from ExecuteScriptAsync, and the caller can’t observe completion/failure. Prefer restoring async Task SendRecentGraphsData() and either await it from an async call chain or add explicit fault logging when firing-and-forgetting.
        private async void SendRecentGraphsData()
        {
            // Send user preferences
            if (dynWebView?.CoreWebView2 != null)
            {
                if (startPage.DynamoViewModel.PreferenceSettings.HomePageSettings != null)
                {
                    var dict = GetDictFromListStrings(startPage.DynamoViewModel.PreferenceSettings.HomePageSettings);
                    var settingsJson = Newtonsoft.Json.JsonConvert.SerializeObject(dict);
                    settingsJson = System.Web.HttpUtility.JavaScriptStringEncode(settingsJson);

                    await dynWebView.CoreWebView2.ExecuteScriptAsync(@$"window.setHomePageSettings('{settingsJson}');");

Comment on lines 292 to 300
@@ -302,26 +300,10 @@ private async Task LoadGraphs(List<StartPageListItem> data)
}
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

LoadGraphs was changed from async Task to async void. Since this isn’t an event handler, async void exceptions propagate to the WPF synchronization context and can crash the process (e.g., if ExecuteScriptAsync faults). Prefer restoring a Task return type and either await it from an async caller or keep fire-and-forget with explicit exception handling/logging.

Copilot uses AI. Check for mistakes.
Comment on lines 306 to 315
@@ -333,21 +315,9 @@ private async Task SendSamplesData()
}
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

SendSamplesData was changed to async void but it’s not an event handler. Exceptions from ExecuteScriptAsync will be raised on the WPF sync context (potentially crashing the app) and can’t be observed/handled by the caller. Prefer restoring async Task and either await it from an async caller or keep fire-and-forget with explicit exception handling/logging.

Copilot uses AI. Check for mistakes.
Comment on lines +802 to +804
<Compile Include="Views\HomePage\HomePage.xaml.cs" />
<Compile Include="Views\Input\ParameterEditor.cs" />
<Compile Include="Views\PackageManager\Components\PackageManagerWizard\PackageManagerWizard.xaml.cs" />
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

HomePage.xaml.cs and PackageManagerWizard.xaml.cs are now included twice in the project (also present later with <DependentUpon>). Duplicate <Compile Include=...> items typically cause MSBuild errors (duplicate items) and should be removed—keep only the existing entries that include DependentUpon.

Suggested change
<Compile Include="Views\HomePage\HomePage.xaml.cs" />
<Compile Include="Views\Input\ParameterEditor.cs" />
<Compile Include="Views\PackageManager\Components\PackageManagerWizard\PackageManagerWizard.xaml.cs" />
<Compile Include="Views\Input\ParameterEditor.cs" />

Copilot uses AI. Check for mistakes.
@QilongTang
Copy link
Copy Markdown
Contributor

QilongTang commented Apr 2, 2026

@zeusongit @johnpierson Please also consider if there is any PR in DynamoHome repo need to be reverted, or if better, revert the js package version as part of this PR

@zeusongit
Copy link
Copy Markdown
Contributor Author

zeusongit commented Apr 2, 2026

@zeusongit @johnpierson Please also consider if there is any PR in DynamoHome repo need to be reverted, or if better, revert the js package version as part of this PR

yes here is the PR for DynamoHome: DynamoDS/DynamoHome#79
But I think reverting the version makes more sense for now

Reverted DynamoHome to v26

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 2, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@QilongTang
Copy link
Copy Markdown
Contributor

LGTM

@zeusongit zeusongit merged commit a34397f into DynamoDS:RC4.1.0_master Apr 6, 2026
21 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants