-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
[PTRun] Allow preventing usage based ordering results #37491
base: main
Are you sure you want to change the base?
[PTRun] Allow preventing usage based ordering results #37491
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.
Wrote some feedback on the property naming.
But I am wondering about the use case and feature implementation.
- If you like to enforce a fixed oder, wouldn't you need to disable all types of automatic sorting (weighting boost, selecten based sorting, scoring)?
- Have you tested that your implementation doesn't breaks the history (plugin)?
…roperty name to better reflect purpose
@htcfreek Thanks for the feedback! I have tested this manually with one of my own plugins and it does have the desired result when enabled whilst also not causing any affect on results that do not make use of the feature. |
@CoreyHayward I wrote a small suggestion for renaming the new method. |
Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>
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.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
LGTM. I'm not familiar with the sort part implementation. But at least in my view it will not break anything and just add a useful setting for plugin author. |
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.
The code does not break anything indeed. However, this setting should be on a plugin level, not a result level. That change probably needs a bit more work, but overall it will make more sense
I don't necessarily disagree with your point as it makes sense for my plugin (though I don't know if any other plugin dev's may have a weird use case for this where they want only certain results to be affected by selection weight), however I don't believe there is currently a mechanism for this in Plugin system to set dynamic configuration at a plugin level which can then be applied to the result. The only mechanism I am aware of for this currently is the Please do let me know if I am missing something that would help with this. |
Summary of the Pull Request
Implement an additional functionality on the Result model allowing the prevention of selected count retrieval.
PR Checklist
Detailed Description of the Pull Request / Additional comments
This PR adds an additional property to the
Result.cs
model which allows for disabling the functionality which fetches theSelectedCount
data from PowerToys. This enables the ability for plugins to prevent theSelectedCount
property from being populated for individual results meaning that the sort order can be manipulated as desired by the Plugin giving more control back to the plugin developers.Validation Steps Performed