CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 658
DYN-9089: autofocus search box #16336
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-9089
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 adds autofocus behavior and improved dropdown handling to the node autocomplete bar, makes the search box sticky at the top, and prevents duplicate cluster insertions.
- Auto-focuses and auto-selects the first filtered item when the search input or dropdown state changes
- Binds dropdown open state to the viewmodel and refactors view events to trigger focus
- Updates theme XAML to keep the search box visible at the top and adjust scroll margins
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
src/NodeAutoCompleteViewExtension/Views/NodeAutoCompleteBarView.xaml.cs | Adds OnRefocusSearchBox handler and wires ViewModel event |
src/NodeAutoCompleteViewExtension/Views/NodeAutoCompleteBarView.xaml | Binds IsDropDownOpen to viewmodel |
src/NodeAutoCompleteViewExtension/ViewModels/NodeAutoCompleteBarViewModel.cs | Implements IsDropDownOpen property and RefocusSearchBox event; sets first item on search change; prevents duplicate clusters |
src/DynamoCoreWpf/UI/Themes/Modern/DynamoModern.xaml | Moves scroll viewer margin to keep search slot sticky |
Comments suppressed due to low confidence (1)
src/NodeAutoCompleteViewExtension/Views/NodeAutoCompleteBarView.xaml.cs:38
- [nitpick] The method name
OnRefocusSearchbox
doesn't follow PascalCase for 'Box'. Rename it toOnRefocusSearchBox
to match .NET naming conventions and the event name.
private void OnRefocusSearchbox()
src/NodeAutoCompleteViewExtension/Views/NodeAutoCompleteBarView.xaml
Outdated
Show resolved
Hide resolved
src/NodeAutoCompleteViewExtension/ViewModels/NodeAutoCompleteBarViewModel.cs
Outdated
Show resolved
Hide resolved
…arViewModel.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…w.xaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
src/NodeAutoCompleteViewExtension/ViewModels/NodeAutoCompleteBarViewModel.cs
Outdated
Show resolved
Hide resolved
@@ -413,7 +440,8 @@ internal void ResetAutoCompleteSearchViewState() | |||
FilteredResults = new List<NodeSearchElementViewModel>(); | |||
FilteredHighConfidenceResults = new List<NodeSearchElementViewModel>(); | |||
FilteredLowConfidenceResults = new List<NodeSearchElementViewModel>(); | |||
SearchInput = string.Empty; | |||
SearchInput = string.Empty; | |||
lastAddedCluster = null; |
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.
Perhaps set this to null when we are closing the flyout.
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.
Not entirely sure if we should clean up some set of variables on close and some (possibly overlapping) set of variables on open. Ideally we should call the whole function on open and close but for the moment i think its ok to move the least code now that we're close to release.
This works really nice! Some minor comments , feel free to address as you see fit. LGTM! |
This reverts commit 7fb748b.
Purpose
Autofocus search box, make search box sticky on top and autoselect first filtered element on search box change.
2025-07-01.20-23-25.mp4
Declarations
Check these if you believe they are true
*.resx
filesRelease Notes
Autofocus search box, make search box sticky on top and autoselect first filtered element on search box change.
Reviewers
@johnpierson
@BogdanZavu
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of