Skip to content

DYN-10464 Fix orbit wheel persisting after releasing ESC key mid-orbit in 3D preview#17096

Merged
jasonstratton merged 4 commits into
masterfrom
copilot/fix-orbit-wheel-issue
May 19, 2026
Merged

DYN-10464 Fix orbit wheel persisting after releasing ESC key mid-orbit in 3D preview#17096
jasonstratton merged 4 commits into
masterfrom
copilot/fix-orbit-wheel-issue

Conversation

Copilot AI commented May 5, 2026

Copy link
Copy Markdown
Contributor

Purpose

DYN-10464: When holding ESC to enter 3D navigation mode and starting a right-click orbit gesture, releasing ESC mid-orbit left the HelixToolkit orbit wheel indicator visible until the right mouse button was physically released.

Root cause: DynamoView_KeyUp called Mouse.Capture(null) to release WPF mouse capture, but HelixToolkit's MouseGestureHandler has no LostMouseCapture handler. Its cleanup path (Completed()HideTargetAdorner()) is only reachable via OnMouseUp. Releasing capture alone therefore never dismissed the orbit indicator.

20260505-dyn10464

Key changes:

  • Watch3DView.xaml.csReleaseViewportMouseCapture() now raises a synthetic right-button MouseUp event on the viewport after releasing capture. This triggers HelixToolkit's OnMouseUp subscriber (registered in Execute() when the gesture started), which calls Completed()HideTargetAdorner() and properly ends the gesture.
  • DynamoView.xaml.cs — unchanged from prior commit; DynamoView_KeyUp calls BackgroundPreview?.ReleaseViewportMouseCapture() when ESC is released while CanNavigateBackground is true.

The synthetic MouseButton.Right event is safe: NodeManipulator.MouseUp (the only other ViewMouseUp subscriber) guards with if (e.ChangedButton != MouseButton.Left) return.

Declarations

Check these if you believe they are true

Release Notes

Fixed: orbit wheel indicator no longer persists in the 3D preview after releasing ESC mid-orbit.

Reviewers

@DynamoDS/eidos

FYIs

(FILL ME IN, Optional)

Copilot AI linked an issue May 5, 2026 that may be closed by this pull request
@github-actions github-actions Bot changed the title [WIP] Fix orbit wheel not disappearing when exiting 3D preview DYN-10464: [WIP] Fix orbit wheel not disappearing when exiting 3D preview May 5, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

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

Copilot AI changed the title DYN-10464: [WIP] Fix orbit wheel not disappearing when exiting 3D preview DYN-10464 Fix orbit wheel persisting after releasing ESC key mid-orbit in 3D preview May 5, 2026
Copilot AI requested a review from johnpierson May 5, 2026 17:12
Comment thread src/DynamoCoreWpf/Views/Preview/Watch3DView.xaml.cs Fixed
… expression'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
@johnpierson johnpierson marked this pull request as ready for review May 5, 2026 18:02
Copilot AI review requested due to automatic review settings May 5, 2026 18:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 addresses a UI input-edge-case in Dynamo’s WPF 3D background preview: when the user enters background navigation via holding ESC, starts an orbit gesture, and then releases ESC mid-gesture, HelixToolkit’s mouse capture can persist and leave the orbit wheel indicator visible. The fix explicitly releases mouse capture from the viewport during the ESC key-up transition back to graph view.

Changes:

  • Added Watch3DView.ReleaseViewportMouseCapture() to release HelixToolkit/WPF mouse capture when the 3D viewport (or its children) currently holds it.
  • Updated DynamoView_KeyUp to call BackgroundPreview?.ReleaseViewportMouseCapture() when ESC is released while background navigation is active.

Reviewed changes

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

File Description
src/DynamoCoreWpf/Views/Preview/Watch3DView.xaml.cs Adds a small helper to release viewport mouse capture to terminate ongoing camera gestures.
src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs Invokes the helper on ESC key release during background navigation to ensure the orbit indicator is dismissed.

HelixToolkit's MouseGestureHandler subscribes to MouseUp (in Execute())
to call Completed() -> HideTargetAdorner(), but has no LostMouseCapture
handler. Releasing WPF mouse capture alone therefore never cleans up the
gesture state or hides the orbit wheel indicator.

Fix: after Mouse.Capture(null), raise a synthetic right-button MouseUp on
the viewport so HelixToolkit's OnMouseUp fires, completing the gesture and
dismissing the orbit indicator immediately when the user releases ESC.

The synthetic MouseButton.Right event is safe for NodeManipulator.MouseUp,
which guards early on non-left-button events.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented May 5, 2026

Copy link
Copy Markdown

@johnpierson

Copy link
Copy Markdown
Member

The smoke test that is failing is ExitDynamo 🤔

@avidit

avidit commented May 6, 2026

Copy link
Copy Markdown
Contributor

The smoke test that is failing is ExitDynamo 🤔

That one is flaky.

@johnpierson johnpierson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

right off hand, this all seems innocent enough to me and is working well in my testing.

@jasonstratton jasonstratton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry for the delay. LGTM

@jasonstratton

Copy link
Copy Markdown
Contributor

Aabi noted that the failing test is flaky. I'll go ahead and merge

@jasonstratton jasonstratton merged commit 97ec8d9 into master May 19, 2026
32 of 33 checks passed
@jasonstratton jasonstratton deleted the copilot/fix-orbit-wheel-issue branch May 19, 2026 19:19
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.

Bug report from Dynamo 4.0.2.3852 - Orbit Wheel Issue

5 participants