Skip to content

Conversation

@ivaylo-matov
Copy link
Contributor

@ivaylo-matov ivaylo-matov commented Jun 17, 2025

Purpose

This PR aims to address DYN-7845.

New Preference Settings:

  • added options to hide optional input ports and unconnected output ports by default when a group is collapsed
  • added a preference to automatically apply minimum width and height to collapsed groups

Port Toggles:

  • collapsed groups now display toggle buttons that let users manually expand or collapse optional input ports and unconnected output ports per group. Optional input ports are the disconnected input ports that use default values,
    unconnected output ports are output ports with no outgoing connections.

Manual Overrides:

  • once a group’s ports have been manually toggled via the UI, the group will no longer respond to changes in the corresponding global preferences

Please note that to calculate the minimal width of a collapsed group, the view waits until the ports have been rendered once, then reads their measured DesiredSize to compute the smallest area needed to fit all visible ports and toggles. This causes a second render pass for the group .

DYN-7845-DemoGIF

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

New preferences and group UI controls let users hide optional input and unconnected output ports by default when a group is collapsed. Users can also manually toggle port visibility and keep custom collapsed group sizes, overriding the default settings.

Reviewers

@DynamoDS/eidos
@jasonstratton

FYIs

@achintyabhat
@dnenov

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-7845

@zeusongit zeusongit requested review from a team and Copilot June 18, 2025 01:59

This comment was marked as outdated.

ivaylo-matov and others added 2 commits June 18, 2025 05:33
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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 enhances the collapsed group functionality by adding new preferences and UI controls to hide optional input ports and unconnected output ports, and to automatically apply minimal dimensions when groups are collapsed.

  • New toggle buttons and layout rows in the preferences UI allow manual control over port visibility per group.
  • Annotation views and view models now recalculate group boundaries and proxy port positions based on these new settings.
  • Relevant configuration, public API, and resource entries have been updated to support this new functionality.

Reviewed Changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/DynamoCoreWpf/Views/Menu/PreferencesView.xaml Added new rows and controls for managing port visibility and collapsed group size.
src/DynamoCoreWpf/Views/Core/AnnotationView.xaml.cs Updated event handling and boundary recalculation logic for collapsed groups.
src/DynamoCoreWpf/Views/Core/AnnotationView.xaml Added a new toggle button template and layout updates for port controls.
src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs Introduced new preference properties and updated property change notifications.
src/DynamoCoreWpf/ViewModels/Core/AnnotationViewModel.cs Refactored proxy port creation and port repositioning logic for collapsed scenarios.
src/DynamoCore/Graph/Annotations/AnnotationModel.cs Updated boundary calculations and added new properties for port collapse settings.
src/DynamoCore/Configuration/PreferenceSettings.cs & IPreferences.cs Included new settings to persist port collapse and minimal size preferences.
Others (Resources, PublicAPI, WorkspaceModel, etc.) Extended API and resource strings to accommodate the new functionality.
Files not reviewed (1)
  • src/DynamoCoreWpf/Properties/Resources.Designer.cs: Language not supported
Comments suppressed due to low confidence (2)

src/DynamoCore/Graph/Workspaces/WorkspaceModel.cs:148

  • [nitpick] The field 'hasToggledOptionalInPorts' uses lower-case naming which is inconsistent with standard PascalCase conventions. Consider renaming it to 'HasToggledOptionalInPorts' for consistency.
        public bool hasToggledOptionalInPorts;

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.

Lots of file changes. Most of them appear straight forward. There is some complexity in the AnnotationModel and AnnotationView, which is probably expected. :D

I believe I was able to follow the changes in the view. If I could do that, it's probably good. :D

So I think it LGTM, thanks.

@ivaylo-matov
Copy link
Contributor Author

Thanks for the feedback! I've refactored UpdateBoundaryFromSelection() and added clearer comments as suggested. Let me know if anything still looks off.

@ivaylo-matov
Copy link
Contributor Author

ivaylo-matov commented Jun 25, 2025

Sorry, I made a mess. Will correct first thing tomorrow.
should be okay now

@ivaylo-matov
Copy link
Contributor Author

logic refactored following changes in #16252

@zeusongit
Copy link
Contributor

@ivaylo-matov can you take a look at the failing tests?
Test Result (2 failures / +2)
Dynamo.Tests.Configuration.PreferenceSettingsTests.TestImportCopySettings
DynamoCoreWpfTests.AnnotationViewModelTests.CollapsingGroupWillCreateInportAndOuportCollections

@ivaylo-matov
Copy link
Contributor Author

ivaylo-matov commented Jul 8, 2025

@zeusongit , the tests should pass now.
I'll post update on #16300 this afternoon

@jasonstratton
Copy link
Contributor

I think the comments were addressed and if the tests are passing now (Although Dynamo DelfServe failed), I think my approval still stands.

@ivaylo-matov , do you merge? Or do I?

Copy link
Contributor

@zeusongit zeusongit left a comment

Choose a reason for hiding this comment

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

Resolved conflict between CodeBlockCollapsedPortVisualHeight and CBNProxyPortVisualHeight
CodeBlockCollapsedPortVisualHeight was introduced in #16300 but was not used anywhere, so I assume CBNProxyPortVisualHeight is the correct variable name.

@zeusongit
Copy link
Contributor

@zeusongit zeusongit merged commit bac3902 into DynamoDS:master Jul 10, 2025
26 of 28 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