DYN-: Dyn 9702 templates to home screen#17107
Conversation
- initial changes to the Dynamo backend to consume and show Dynamo Template files on HomePage - created StartPage container for Template files - added backend infrastructure to send Template files data to frontend on load
Add NewWorkspaceWithTemplate method to HomePage that creates a new workspace and inserts a template file, enabling the sidebar to open templates in a new editable workspace.
…m/Chloepeg/Dynamo into DYN-9702-templates-to-home-screen
- initial changes to the Dynamo backend to consume and show Dynamo Template files on HomePage - created StartPage container for Template files - added backend infrastructure to send Template files data to frontend on load
Add NewWorkspaceWithTemplate method to HomePage that creates a new workspace and inserts a template file, enabling the sidebar to open templates in a new editable workspace.
Add root folder bundle file to embedded resources
…m/Chloepeg/Dynamo into DYN-9702-templates-to-home-screen
Adds the missing TemplateFiles property to StartPageViewModel
Fixes build error
…workspace" This reverts commit e8ecae4.
remove merge conflict marker
…mpiles Fix DynamoCoreWpf.csproj DynamoHome embed and duplicate compiles
StartPage - Pulled “build one StartPageListItem from a path” into AddTemplateListItemFromPath so LoadTemplates() stays simpler - Made the templateFiles ObservableCollection readonly (only assigned in the constructor). - Renamed the local List<string> to rootDynPaths so it doesn’t shadow the templateFiles field. - Removed “&& this != null” on the non-empty check (always true in an instance method). Homepage - Replaced async void with async Task on LoadGraphs, LoadTemplates, SendSamplesData, SendTemplateData, and SendRecentGraphsData (Sonar S3168). - LoadingDone and RecentFiles_CollectionChanged use _ = Method() where the caller must stay void; SendTemplateData awaits LoadTemplates, SendRecentGraphsData awaits LoadGraphs. - Renamed the local in SendTemplateData to items for clarity.
Remove unused dirPaths in LoadTemplates() (StartPage.xaml.cs).
Use StartsWith('.') instead of StartsWith(".") for extension checks
Replace TODO comment in SendRecentGraphsData() with a neutral comment
adds a TemplateFiles item and a Copy to $(OutputPath)templates\%(RecursiveDir), so local and CI builds lay out templates the same way as samples.
- initial changes to the Dynamo backend to consume and show Dynamo Template files on HomePage - created StartPage container for Template files - added backend infrastructure to send Template files data to frontend on load
Add NewWorkspaceWithTemplate method to HomePage that creates a new workspace and inserts a template file, enabling the sidebar to open templates in a new editable workspace.
Add root folder bundle file to embedded resources
- initial changes to the Dynamo backend to consume and show Dynamo Template files on HomePage - created StartPage container for Template files - added backend infrastructure to send Template files data to frontend on load
Adds the missing TemplateFiles property to StartPageViewModel
Fixes build error
…workspace" This reverts commit e8ecae4.
remove merge conflict marker
…mpiles Fix DynamoCoreWpf.csproj DynamoHome embed and duplicate compiles
StartPage - Pulled “build one StartPageListItem from a path” into AddTemplateListItemFromPath so LoadTemplates() stays simpler - Made the templateFiles ObservableCollection readonly (only assigned in the constructor). - Renamed the local List<string> to rootDynPaths so it doesn’t shadow the templateFiles field. - Removed “&& this != null” on the non-empty check (always true in an instance method). Homepage - Replaced async void with async Task on LoadGraphs, LoadTemplates, SendSamplesData, SendTemplateData, and SendRecentGraphsData (Sonar S3168). - LoadingDone and RecentFiles_CollectionChanged use _ = Method() where the caller must stay void; SendTemplateData awaits LoadTemplates, SendRecentGraphsData awaits LoadGraphs. - Renamed the local in SendTemplateData to items for clarity.
Remove unused dirPaths in LoadTemplates() (StartPage.xaml.cs).
Use StartsWith('.') instead of StartsWith(".") for extension checks
Replace TODO comment in SendRecentGraphsData() with a neutral comment
adds a TemplateFiles item and a Copy to $(OutputPath)templates\%(RecursiveDir), so local and CI builds lay out templates the same way as samples.
…m/Chloepeg/Dynamo into DYN-9702-templates-to-home-screen
When selecting listed template files, open them as new graphs from their contents instead of treating the saved template path as a normal open. StartPage and HomePage now package the open argument as a tuple (path, false, true) for templates and pass that to DynamoViewModel.OpenCommand. DynamoViewModel.CanOpen was updated to extract the file path from either string, Tuple<string,bool>, or Tuple<string,bool,bool> so command validation works with the new packed arguments. A small helper IsListedHomePageTemplate was added to HomePage to detect listed templates.
Bump the embedded Dynamo Home package to 1.0.30 so Dynamo consumes the Home UI with template support
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9702
There was a problem hiding this comment.
Pull request overview
Adds Dynamo host-side support for “Templates” in the Dynamo Home experience by shipping template assets, sending template metadata to the embedded Home UI, and ensuring template selections open as template-derived workspaces (instead of opening the template file directly).
Changes:
- Route template opens from HomePage/StartPage through
OpenCommandusing the existing template-open tuple contract (Tuple<string,bool,bool>), and updateCanOpento accept that parameter type. - Ship template assets by copying
doc/distrib/Templates/**into the build output (templates/**). - Update embedded DynamoHome package consumption to
1.0.30to enable the template-enabled Home UI in production builds.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/DynamoCoreWpf/Views/HomePage/HomePage.xaml.cs | Sends template data to the Home UI and opens clicked templates via OpenCommand using template semantics. |
| src/DynamoCoreWpf/Controls/StartPage.xaml.cs | Opens listed templates via OpenCommand using template semantics (tuple parameter). |
| src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs | Extends CanOpen to extract paths from Tuple<string,bool,bool> so command gating works for template opens. |
| src/DynamoCoreWpf/DynamoCoreWpf.csproj | Bumps embedded DynamoHome package version from 1.0.28 to 1.0.30. |
| src/DynamoCore/DynamoCore.csproj | Copies distributed templates into the build output under templates/**. |
| var path = item.ContextData; | ||
| this.DynamoViewModel.OpenCommand.Execute(path); | ||
| // Listed templates: use the same open path as the template file-picker (ShowOpenTemplateDialog), | ||
| // i.e. open as a new graph from the file contents, not as the saved template path on disk. | ||
| object openArg = TemplateFiles.Contains(item) | ||
| ? Tuple.Create(path, false, true) | ||
| : path; | ||
| if (this.DynamoViewModel.OpenCommand.CanExecute(openArg)) | ||
| { | ||
| this.DynamoViewModel.OpenCommand.Execute(openArg); |
There was a problem hiding this comment.
I changed this to compare template paths instead of relying on StartPageListItem reference equality. I used a case-insensitive comparison since these are Windows file paths.
| string filePath = parameters as string; | ||
| if (filePath == null && parameters is Tuple<string, bool> packedTwo) | ||
| { | ||
| filePath = packedTwo.Item1; | ||
| } | ||
| else if (filePath == null && parameters is Tuple<string, bool, bool> packedThree) | ||
| { | ||
| filePath = packedThree.Item1; | ||
| } |
There was a problem hiding this comment.
I Added a focused test for OpenCommand.CanExecute with the Tuple<string, bool, bool> template parameter shape.
Compare listed templates by file path instead of item reference so template files open through the template flow consistently, and add a focused test for the template tuple parameter.
|



Purpose
This PR addresses DYN-9702 https://jira.autodesk.com/browse/DYN-9702 The changes in the code aim to add host-side support for Dynamo Home template files, enabling Dynamo to supply template data to Dynamo Home and ensure selected templates open as new editable workspaces.
This PR works with : DynamoDS/DynamoHome#89
Changes :
Added support for passing template metadata from Dynamo to Dynamo Home.
Declarations
Check these if you believe they are true
Release Notes
Added Dynamo-side support for template files in Dynamo Home. Dynamo now copies shipped templates into the build output, passes template metadata to the Home UI, and opens selected templates as new editable workspaces instead of opening the template file directly.
Updated the Dynamo/Home integration to consume @dynamods/dynamo-home 1.0.30, so the production embedded Home page uses the template-enabled UI rather than relying only on local development mode.
Reviewers
@zeusongit
@DynamoDS/eidos
FYIs
@dnenov
@johnpierson
@jnealb