Skip to content

Conversation

@reddyashish
Copy link
Contributor

@reddyashish reddyashish commented Jun 10, 2025

Purpose

https://jira.autodesk.com/browse/DYN-8302
https://jira.autodesk.com/browse/DYN-8306

Based out of changes from #15763 and #15823.

Icon freezing was already implemented in Node to Code PR. For some generic icons, bitmap-scalingmode has been set to low quality.
For preview bubble, we will be initializing the preview control only if the mouse stays on the node for a short time. It also helps when users are navigating large graphs, preview control won't be initialized for the passing nodes.

All tests passing now.

Open workspace timings
Entry Christmas : before 16-17 secs, after this change around 15 secs.
500 List nodes: noticing a difference of around 3 secs differential.
Autodesk-Mars : before 30-35 secs, after this change around 30 secs.

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

Optimizing loading of icons and preview bubble.

Reviewers

@DynamoDS/eidos

@github-actions github-actions bot changed the title [Draft] Optimizing loading of icons and preview bubble. DYN-8302: [Draft] Optimizing loading of icons and preview bubble. Jun 10, 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-8302

@reddyashish reddyashish requested a review from a team June 18, 2025 14:44
@reddyashish reddyashish changed the title DYN-8302: [Draft] Optimizing loading of icons and preview bubble. DYN-8302: Optimizing loading of icons and preview bubble. Jun 18, 2025
@QilongTang QilongTang requested a review from Copilot June 24, 2025 15:16
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 optimizes icon rendering by setting bitmap scaling to low quality for node visuals and improves performance of preview bubbles by debouncing their initialization on mouse events. It also introduces toggling of panning mode via the middle mouse button in the workspace view.

  • Apply low-quality bitmap scaling to default and dynamic node icons to reduce rendering overhead.
  • Debounce preview bubble creation on mouse enter and cancel on leave to minimize unnecessary UI instantiation.
  • Add middle-button handlers in WorkspaceView to toggle pan mode on press and release.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/DynamoCoreWpf/Views/Core/WorkspaceView.xaml.cs Added middle-button pan toggling logic in mouse down and release handlers.
src/DynamoCoreWpf/Views/Core/NodeView.xaml.cs Set low-quality bitmap scaling on multiple icons and implemented debounced preview bubble logic with initialization and cancellation methods.
src/DynamoCoreWpf/ViewModels/Core/WorkspaceViewModel.cs Introduced DelayNodePreviewControl debouncer utility and wired up disposal.
Comments suppressed due to low confidence (5)

src/DynamoCoreWpf/Views/Core/NodeView.xaml.cs:1561

  • [nitpick] Inconsistent use of viewModel (field) and ViewModel (property) can be confusing. Consider standardizing on the ViewModel property throughout.
            viewModel.WorkspaceViewModel.DelayNodePreviewControl.Debounce(300, DelayPreviewControlAction);

src/DynamoCoreWpf/Views/Core/NodeView.xaml.cs:1561

  • The new debouncing logic for preview bubbles isn't covered by existing tests. Consider adding unit or integration tests to verify timing, invocation, and cancellation behaviors.
            viewModel.WorkspaceViewModel.DelayNodePreviewControl.Debounce(300, DelayPreviewControlAction);

src/DynamoCoreWpf/Views/Core/WorkspaceView.xaml.cs:905

  • Using e.MiddleButton to detect which button was pressed may not reliably capture the middle-button click; consider checking e.ChangedButton == MouseButton.Middle for clarity and correctness.
            if (!ViewModel.IsPanning && e.MiddleButton == MouseButtonState.Pressed)

src/DynamoCoreWpf/Views/Core/NodeView.xaml.cs:2144

  • The previous check for viewModel.IsTransient was removed, so transient nodes may now show a preview unexpectedly. Re-add the viewModel.IsTransient condition to disable preview during transient state.
                ViewModel.WorkspaceViewModel.IsPanning;

src/DynamoCoreWpf/ViewModels/Core/WorkspaceViewModel.cs:592

  • Initializing ActionDebouncer with a null callback may lead to null-reference errors if used before assigning a valid action. Consider providing a no-op default or delaying the instantiation until a callback is known.
            = new Wpf.Utilities.ActionDebouncer(null);

@zeusongit zeusongit merged commit 15ded24 into DynamoDS:master Jun 30, 2025
31 of 32 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