Skip to content

Conversation

@ivaylo-matov
Copy link
Contributor

Purpose

This PR aims to address DYN-8893.

  • Double-clicking on empty space within a group now creates a code block node inside that group.
  • Fixed an issue where if two groups overlap, selecting the upper groups adds it to the other.

Adding the search bar to the group context menu will be handled in a separate PR.

Before:

DYN-8893-Old

After:

DYN-8893-New

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

Improvements to group behavior:

  • Double-clicking on empty space within a group now creates a code block node inside that group.
  • Fixed an issue where if two groups overlap, selecting the upper groups adds it to the other.

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

@zeusongit zeusongit requested review from a team and Copilot July 1, 2025 16:03
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 improves group behavior by addressing double-click handling and accidental group selection issues.

  • Adds a double-click event handler in annotation views to create a code block node when clicking within a group's model area.
  • Introduces a new method in WorkspaceViewModel to handle annotation double clicks by creating a new code block node and updating associated groups.
  • Adds tracking of original annotation group positions to prevent unintentional grouping when groups overlap.

Reviewed Changes

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

File Description
src/DynamoCoreWpf/Views/Core/AnnotationView.xaml.cs Adds double-click event handling to trigger code block creation within groups.
src/DynamoCoreWpf/ViewModels/Core/WorkspaceViewModel.cs Implements HandleAnnotationDoubleClick to create and add a new code block node to a group.
src/DynamoCoreWpf/ViewModels/Core/StateMachine.cs Introduces tracking for original positions of dragged annotation groups and prevents accidental grouping on click.
src/DynamoCoreWpf/PublicAPI.Unshipped.txt Updates public API list to expose the new HandleAnnotationDoubleClick method.
Comments suppressed due to low confidence (1)

src/DynamoCoreWpf/ViewModels/Core/StateMachine.cs:788

  • The variable 'dragedGroups' appears to be misspelled; consider renaming it to 'draggedGroups' for improved clarity and consistency with naming conventions.
                        });

Comment on lines +1243 to +1245
var updated = annotation.Nodes.ToList();
updated.Add(newNode);
annotation.Nodes = updated;
Copy link

Copilot AI Jul 1, 2025

Choose a reason for hiding this comment

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

[nitpick] If annotation.Nodes is a mutable collection, consider adding the new node directly instead of creating a new list to avoid unnecessary memory allocation. If immutability is required by design, this approach is acceptable.

Suggested change
var updated = annotation.Nodes.ToList();
updated.Add(newNode);
annotation.Nodes = updated;
annotation.Nodes.Add(newNode);

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

annotation.Nodes is IEnumerable, not a mutable collection

Copy link
Contributor

@RobertGlobant20 RobertGlobant20 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 two comments

@zeusongit zeusongit requested a review from a team July 2, 2025 16:51
@zeusongit zeusongit merged commit 00cab14 into DynamoDS:master Jul 7, 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