-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
Summary of the new feature / enhancement
Description
When thinking about having the Feedback Provider of PowerShell be able to trigger on success, per #19372, there is a concern around if this will be very noisy and annoying to users. The basic scenario being that a user runs a command successfully but there is potentially a better way or suggested way to enhance their experience, like the JSON adapter proposition in #19372. This could also be a good way to expose capabilities of PowerShell and nuances to help inform the user about potential ramifications.
Example
Reallocation of array each time for addition:
>$a = @()
>$a += 1
>$a += 2This works and is successful but a more memory conscious approach would be:
>$a = [System.Collections.ArrayList]::new()
or
>$a = [System.Collections.Generic.List[object]]::new()The feedback provider could suggestion something like
>$a = @()
>$a += 1
[suggestion]
$a is being reallocated each time you append to it, consider defining it as a list:
-> $a = [System.Collections.ArrayList]::new() Proposed technical implementation details (optional)
Questions
The scenarios outlined above begs a lot of questions about the experience of Feedback Providers and if its something the PowerShell engine should step in to ensure "non noisy" behavior or let the feedback providers themselves be responsible for. For contexts feedback providers are developed as extensible PowerShell modules that can be imported.
- Should the feedback providers be left responsible for not being "noisy" to the users?
If left up to the engine:
- How do we classify if something is noisy or not?
- If, after shown at least once after successful, a feedback suggestion is NOT used by the user, then should it be disabled?
- Is there a better way to manage feedback providers besides importing the modules?
- How can we get an indication from the user that feedback is no longer needed on a topic? (i.e dismissal of suggestion)
I am sure I am missing some questions or scenarios but want to open an issue to track these and have a discussion around this concept, any and all feedback is appreciated!
Other related PRs/issues with Feedback Providers
- Update the
FeedbackProviderinterface to return structured data #19133 - IFeedbackProvider should be able to be called when there is not an error #19372
- IFeedbackProvider needs a registration system on when it should be called #19364
- IFeedbackProvider can't work against native commands on non-zero exit code #18852
- Feedback provider for legacy usage #19524
- https://github.com/PowerShell/command-not-found
Metadata
Metadata
Assignees
Labels
Type
Projects
Status