Skip to content

Conversation

@ivaylo-matov
Copy link
Contributor

Purpose

This PR addresses DYN-8879.

Adds support for view extensions to inject their own menu items into Dynamo’s File menu. It also updates the Graph Metadata extension to use this new system.

Changes:

  • New shared Interface for Menu Items - IExtensionMenuProvider. Extensions that implement this can return a MenuItem to be shown in the main Dynamo UI.
  • Updated Graph Metadata Extension to use the new interface to provide its menu item. The menu item no longer sets its header text directly. Instead, it uses a localized resource from DynamoCoreWpf.
  • Changes to the File Menu UI to have a new section called "Show Graph Properties" which has two submenu items: "General" (connected to the Graph Metadata panel) and "Advanced Sharing" (placeholder for future use).
  • Added new ShowGraphPropertiesCommand in DynamoViewModel. When the "General" menu item is clicked, this command fires an event which toggles the visibility of the extension panel.
  • Removed the hardcoded "MenuItemText" string from the extension’s own resources. Instead, the menu uses a string defined in the shared Resources.resx file in DynamoCoreWpf.

DYN-8879-Proposal

Declarations

Check these if you believe they are true

  • Is documented according to the standards
  • The level of testing this PR includes is appropriate
  • User facing strings, if any, are extracted into *.resx files
  • Snapshot of UI changes, if any.
  • Changes to the API follow Semantic Versioning and are documented in the API Changes document.
  • This PR modifies some build requirements and the readme is updated
  • This PR contains no files larger than 50 MB
  • This PR introduces new feature code involve network connecting and is tested with no-network mode.

Release Notes

Adds support for view extensions to inject their own menu items into Dynamo’s File menu. It also updates the Graph Metadata extension to use this new system.

Reviewers

@DynamoDS/eidos
@jasonstratton

FYIs

@dnenov
@achintyabhat

- header resources in DynamoCoreWpf.Properties
- using command in DynamoViewModel instead of injecting the whole menu item in the code-behind
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-8879

@jasonstratton jasonstratton requested a review from Copilot August 27, 2025 17:54
@jasonstratton jasonstratton self-assigned this Aug 27, 2025
Copy link
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

This PR implements a new extensible menu system that allows view extensions to inject custom menu items into Dynamo's File menu. The Graph Metadata extension is updated to use this new system, replacing its previous direct menu integration approach.

Key changes:

  • Introduces a new IExtensionMenuProvider interface for extensions to provide menu items
  • Updates the Graph Metadata extension to implement this interface and removes its hardcoded menu text
  • Adds a new "Show Graph Properties" submenu structure in the File menu with "General" and placeholder "Advanced Sharing" options

Reviewed Changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
IExtensionMenuProvider.cs New interface defining the contract for extensions that provide menu items
GraphMetadataViewExtension.cs Updated to implement IExtensionMenuProvider and removed direct menu text setting
DynamoView.xaml Added new "Show Graph Properties" submenu structure to File menu
DynamoView.xaml.cs Added event handler for ShowGraphPropertiesRequested to toggle extension visibility
DynamoViewModel.cs Added ShowGraphProperties command and event handling
DynamoViewModelDelegateCommands.cs Added ShowGraphPropertiesCommand delegate
Resources files Moved menu text from extension-specific to shared resources and added new localized strings
PublicAPI.Unshipped.txt Added new public API entries for the command and interface
DynamoCoreWpf.csproj Added the new interface file to the project
Files not reviewed (2)
  • src/DynamoCoreWpf/Properties/Resources.Designer.cs: Language not supported
  • src/GraphMetadataViewExtension/Properties/Resources.Designer.cs: Language not supported

jasonstratton and others added 3 commits August 27, 2025 18:51
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…he-menu' of https://github.com/ivaylo-matov/Dynamo into DYN-8879-Update-graph-properties-from-one-location-on-the-menu
@zeusongit
Copy link
Contributor

@ivaylo-matov I think it would be nice if you could add some tests for this change

@ivaylo-matov
Copy link
Contributor Author

@zeusongit, I've added GetFileMenuItemReturnsCheckableMenuItem to GraphMetadataViewExtensionTests (verifies the extension exposes a non-null, checkable MenuItem).

I also created a new GraphMetadataFileMenuIntegrationTests class with three additional tests focused on the File menu integration. This class can be expanded further once the D4C work begins.

@zeusongit zeusongit requested a review from a team September 22, 2025 21:32
<data name="ImageSelector_Title_SelectImage" xml:space="preserve">
<value>Select Image</value>
</data>
<data name="MenuItemText" xml:space="preserve">
Copy link
Contributor

Choose a reason for hiding this comment

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

is this already removed in the default resources?

// in AssemblyVersionInfo.cs so that it can be easily incremented by the
// automated build process.
[assembly: AssemblyVersion("4.0.0.2016")]
[assembly: AssemblyVersion("4.0.0.2403")]
Copy link
Contributor

Choose a reason for hiding this comment

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

undo this file commit.

Copy link
Contributor

@reddyashish reddyashish left a comment

Choose a reason for hiding this comment

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

LGTM with couple comments.

@zeusongit zeusongit merged commit c311128 into DynamoDS:master Oct 10, 2025
26 of 27 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.

5 participants