CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 658
DYN-8302: Optimizing loading of icons and preview bubble. #16285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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
There was a problem hiding this 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) andViewModel
(property) can be confusing. Consider standardizing on theViewModel
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 checkinge.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 theviewModel.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);
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
*.resx
filesRelease Notes
Optimizing loading of icons and preview bubble.
Reviewers
@DynamoDS/eidos