-
Notifications
You must be signed in to change notification settings - Fork 636
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
Pm searchbar improvements #14553
Pm searchbar improvements #14553
Conversation
- disables the search bar functionality while the results are being loaded
- removed the double-binding through textchanged AND property binding - simplified code for timed trigger of search via the DispatcherTimer - added value difference check to stop reapplying the same one over and over - removed unnecessary un-subscriptions (to explain in PR)
src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerSearchViewModel.cs
Outdated
Show resolved
Hide resolved
- now only does the initial (slow) search when loading the model for the first time - since we are not destroying the model when closing the window, we should not have to refreshandsearch again and again. We are using the cached results we have loaded the first time - timed-out timer fix - removed reset events on windows close as no longer needed
src/DynamoCoreWpf/Views/PackageManager/Controls/PackageManagerSearchControl.xaml.cs
Show resolved
Hide resolved
src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerSearchViewModel.cs
Show resolved
Hide resolved
src/DynamoCoreWpf/Views/PackageManager/Controls/PackageManagerSearchControl.xaml.cs
Outdated
Show resolved
Hide resolved
src/DynamoCoreWpf/Views/PackageManager/Controls/SearchBoxControl.xaml.cs
Outdated
Show resolved
Hide resolved
- RefreshAndSearchAsync will be repeated every time you open the PM window
src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerSearchViewModel.cs
Outdated
Show resolved
Hide resolved
missed space
src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerSearchViewModel.cs
Outdated
Show resolved
Hide resolved
src/DynamoCoreWpf/Views/PackageManager/Controls/SearchBoxControl.xaml.cs
Outdated
Show resolved
Hide resolved
- replaced delay timer with wpf native delay property (thank you!) - removed old code
src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerSearchViewModel.cs
Show resolved
Hide resolved
{ | ||
TimedOut = false; // reset the timedout screen | ||
InitialResultsLoaded = false; // reset the loading screen settings | ||
RequestShowFileDialog -= OnRequestShowFileDialog; |
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.
Is this still unsubscribed somewhere?
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.
Actually, no. This line
never made sense in a way, because the RequestShowFileDialog
is null here.
We are subscribing each individual PackageManagerSearchElementViewModel
to OnRequestShowFileDialog
here
Dynamo/src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerSearchViewModel.cs
Line 1363 in c64fe07
foreach (var x in list) |
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.
@QilongTang OnRequestShowFileDialog is subscribed to the elements in the packages list which should be disposed when the window is closed. So want to confirm if we still need to unsubscribe it.
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.
LGTM with a few questions
src/DynamoCoreWpf/ViewModels/PackageManager/PackageManagerSearchViewModel.cs
Show resolved
Hide resolved
{ | ||
TimedOut = false; // reset the timedout screen | ||
InitialResultsLoaded = false; // reset the loading screen settings | ||
RequestShowFileDialog -= OnRequestShowFileDialog; |
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.
@QilongTang OnRequestShowFileDialog is subscribed to the elements in the packages list which should be disposed when the window is closed. So want to confirm if we still need to unsubscribe it.
Purpose
PR addressing outstanding issues with the Search of the Package Manager.
RefreshAndSearchAsync()
once when loading the ViewModel for the first time. This makes subsequent views loads instantaneousThis PR cherry-picks and updates on some of the issues in #14553. The old PR will be split into separate PRs for clarity.
Loading search results
Removing
RequestShowFileDialog -= OnRequestShowFileDialog;
Removing
nonHostFilter.ForEach(f => f.PropertyChanged -= filter_PropertyChanged);
The
nonHostFilter
are only initialized once and are part of the ViewModel. Since we are not distroying the ViewModel manually, we should not be removing these handlers when the View closes, we want them to remain.Declarations
Check these if you believe they are true
*.resx
filesRelease Notes
Reviewers
@mjkkirschner
@reddyashish
FYIs
@Amoursol