DYN-9089: autofocus search box#16336
Conversation
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9089
There was a problem hiding this comment.
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
OnRefocusSearchboxdoesn't follow PascalCase for 'Box'. Rename it toOnRefocusSearchBoxto 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 <[email protected]>
…w.xaml Co-authored-by: Copilot <[email protected]>
src/NodeAutoCompleteViewExtension/ViewModels/NodeAutoCompleteBarViewModel.cs
Outdated
Show resolved
Hide resolved
| FilteredLowConfidenceResults = new List<NodeSearchElementViewModel>(); | ||
| SearchInput = string.Empty; | ||
| SearchInput = string.Empty; | ||
| lastAddedCluster = null; |
There was a problem hiding this comment.
Perhaps set this to null when we are closing the flyout.
There was a problem hiding this comment.
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
*.resxfilesRelease 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