-
Notifications
You must be signed in to change notification settings - Fork 511
Refresh on visible #1690
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
Merged
TylerLeonhardt
merged 2 commits into
PowerShell:master
from
TylerLeonhardt:refresh-on-visible
Jan 11, 2019
Merged
Refresh on visible #1690
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What fires this
onDidChangeVisibility
callback? If it fires every time you switch away from the PS tree view and then back to it, that seems like we'd be refreshing too often. Maybe the "initial" population of the tree is just that - initial and one-time. There is a Refresh button so the user can refresh whenever they want.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.
Do you think that that would really be that often? I would think people expect that when you click on it, it would refresh.
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.
I guess as long as the perf of getting all the commands, sorting them and removing duplicates stays fast - it's probably not a big deal to auto-refresh. But I'm a little PSES perf-paranoid these days. :-)
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.
I think it will be fine. PowerShell will cache the results after the first
Get-Command
.Plus users that don't use the command explorer will not see any perf hit
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.
Will it? It takes over a full second for every invocation of
Get-Command
on my machine. I'm also not particularly fond of sending messages that big unnecessarily (nor the giant log messages, but that's not a great reason 😉)I don't feel all that strongly about it though.
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.
I personally think that we should ship this since it's only run for users of the command explorer - and requires human interaction to be run (rather than just randomly running).
If it does become a problem for perf for those users, aka after feedback, we can take out the auto refreshing and rely solely on the refresh button.
Would that be alright with you guys?
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.
maybe @rjmholt can also give his thoughts?
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.
My main concern is a message storm DoS-ing PSES because of a callbacks from this piling up, plus creating the expectation with users that we can magically keep the command list perfectly up to date without them needing to think about it.
If a "refresh" button is too much work, we could maybe add a minimum time delay between refreshes (like 10s)?
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.
Ok @TylerLeonhardt has explained this to me and I didn't understand what this PR changes. Here's my understanding:
So, I think the current PR is the best approach.
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.
yep - I should have added that bullet list to the issue. Thanks for clarifying that, @rjmholt.
I'd like to get @rkeithhill's closure on this before merging.