Skip to content

Conversation

@ivaylo-matov
Copy link
Contributor

@ivaylo-matov ivaylo-matov commented Jul 7, 2025

Purpose

This PR partially addresses DYN-8893.

  • The group context menu now includes a search bar, similar to the one used in the workspace context menu.
  • The group context menu it is now built in the code-behind using Popup controls.
  • Menu items are regenerated each time the popup is opened, to allowing dynamic state to be reflected if needed.
  • The search bar hides other menu items while typing.
  • When a node is created via the search bar, it is automatically added to the group the context menu was opened from.

DYN-8893-ContextMenu

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

Added a new search bar to the group context menu similar to the one in the workspace menu. Nodes created from it are now added directly to the group.

Reviewers

@DynamoDS/eidos
@jasonstratton

FYIs

@dnenov
@achintyabhat

@github-actions github-actions bot changed the title Dyn 8893 added search bar in group context menu DYN-: Dyn 8893 added search bar in group context menu Jul 7, 2025
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-8893

@ivaylo-matov ivaylo-matov changed the title DYN-: Dyn 8893 added search bar in group context menu [DYN-8893] Added search bar in group context menu Jul 7, 2025
@QilongTang QilongTang requested a review from Copilot July 7, 2025 16:02
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

Adds a search bar to the group context menu by rebuilding it with a Popup, regenerating items on open, hiding items during search, and auto-adding created nodes to the opened group.

  • Updated tests to exercise the new Popup-based ungroup action.
  • Exposed OuterCanvas in WorkspaceView for overlay placement.
  • Refactored AnnotationView to use a dynamically built Popup with search, style, and event-handling logic.
  • Fixed a typo in the "Ungroup" resource strings.

Reviewed Changes

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

Show a summary per file
File Description
test/DynamoCoreWpfTests/AnnotationViewTests.cs Adapted test to raise click on new Popup child instead of ContextMenu
src/DynamoCoreWpf/Views/Core/WorkspaceView.xaml.cs Exposed OuterCanvas property for absolute UI placements
src/DynamoCoreWpf/Views/Core/AnnotationView.xaml.cs Replaced ContextMenu with Popup, added search bar logic, event wiring
src/DynamoCoreWpf/Views/Core/AnnotationView.xaml Hooked MouseRightButtonUp to open the new Popup
src/DynamoCoreWpf/ViewModels/Core/AnnotationViewModel.cs Changed accessors on CanAddGroupToGroup and CanUngroupGroup
src/DynamoCoreWpf/Utilities/WpfUtilities.cs Added FindParent<T> helper
src/DynamoCoreWpf/PublicAPI.Unshipped.txt Registered OuterCanvas getter in public API
src/DynamoCoreWpf/Properties/Resources.resx & *.en-US.resx Corrected the “Ungroup” spelling in resource files
Files not reviewed (1)
  • src/DynamoCoreWpf/Properties/Resources.Designer.cs: Language not supported
Comments suppressed due to low confidence (1)

src/DynamoCoreWpf/Views/Core/AnnotationView.xaml.cs:669

  • [nitpick] The search bar visibility toggle logic in OnSearchViewModelPropertyChanged isn’t covered by existing tests—consider adding unit tests to verify that other menu items hide and show correctly when typing.
            if (e.PropertyName != nameof(SearchViewModel.SearchText)) return;

Loaded -= AnnotationView_Loaded;
DataContextChanged -= AnnotationView_DataContextChanged;
ViewModel.WorkspaceViewModel.InCanvasSearchViewModel.PropertyChanged -= OnSearchViewModelPropertyChanged;
ViewModel.WorkspaceViewModel.Nodes.CollectionChanged -= OnWorkspaceNodesChanged;
Copy link

Copilot AI Jul 7, 2025

Choose a reason for hiding this comment

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

Unsubscribe from GroupContextMenuPopup.Closed in the Unloaded handler as well to avoid potential memory leaks from lingering event subscriptions.

Copilot uses AI. Check for mistakes.
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 an issue?

Copy link
Contributor

Choose a reason for hiding this comment

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

@zeusongit zeusongit requested a review from a team July 7, 2025 22:33
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

Copy link
Contributor

@jasonstratton jasonstratton left a comment

Choose a reason for hiding this comment

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

I think there is just one Copilot comment about Unsubscribe from GroupContextMenuPopup.Closed, which might need to be considered. Aside from that, I think it looks good.

@ivaylo-matov
Copy link
Contributor Author

I think there is just one Copilot comment about Unsubscribe from GroupContextMenuPopup.Closed, which might need to be considered. Aside from that, I think it looks good.

@jasonstratton , that's already in

ViewModel.WorkspaceViewModel.InCanvasSearchViewModel.PropertyChanged -= OnSearchViewModelPropertyChanged; ViewModel.WorkspaceViewModel.Nodes.CollectionChanged -= OnWorkspaceNodesChanged; if (_groupContextMenuClosedHandler != null) GroupContextMenuPopup.Closed -= _groupContextMenuClosedHandler;

@zeusongit
Copy link
Contributor

@ivaylo-matov
Copy link
Contributor Author

@zeusongit
Copy link
Contributor

@zeusongit zeusongit merged commit eadff55 into DynamoDS:master Jul 10, 2025
23 of 24 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.

4 participants