You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by Or1g3n September 24, 2024
Plugin developer question - is there a way to disable flow launchers auto rank system when result order matters
I maintain a plugin where order matters (e.g., help feature shows available commands that should be ordered alphabetically, there is a sort feature where user can specify sort order, etc.). The issue I have found is that flow launcher appears to keep a ranking of results in a UserSelectedRecord.json file and that this ranking takes precedence over all; I tried hard coding a sort order in the c# list object but the ranking by Flow still took precedence; clearing the data stored in the UserSelectedRecord.json resulted in expected sort order.
I can see why this auto ranking system can be very useful in most use cases given it avoids the user having to manually search multiple matches to select the most common result record, however, in for my use case where sort order matters, this is not the desired behavior.
Is there a way to turn this off using the plugin api?
Suggestion
Either via Flow.Launcher.Plugin API or other mechanism, enable way for auto rank process to ignore plugins based on a flag property. So if theoretical property is set, Flow Launcher will ignore that plugin and not add result to UserSelectedRecord.json file. If we want to allow for more flexibility then this property could be part of the Result class so that the plugin developer can specify for a given List to enable auto rank or disable auto when user interacts with result set. I am new to Flow Launcher plugin dev so tried my best to find the mechanism for this.
Yes, add the flag to Result class, default to allow ranking, and plugin can optionally disable when they create the results. In the code where it does the rank sorting, check for this flag.
Discussed in #2993
Originally posted by Or1g3n September 24, 2024
Plugin developer question - is there a way to disable flow launchers auto rank system when result order matters
I maintain a plugin where order matters (e.g., help feature shows available commands that should be ordered alphabetically, there is a sort feature where user can specify sort order, etc.). The issue I have found is that flow launcher appears to keep a ranking of results in a UserSelectedRecord.json file and that this ranking takes precedence over all; I tried hard coding a sort order in the c# list object but the ranking by Flow still took precedence; clearing the data stored in the UserSelectedRecord.json resulted in expected sort order.
I can see why this auto ranking system can be very useful in most use cases given it avoids the user having to manually search multiple matches to select the most common result record, however, in for my use case where sort order matters, this is not the desired behavior.
Is there a way to turn this off using the plugin api?
Suggestion
Either via Flow.Launcher.Plugin API or other mechanism, enable way for auto rank process to ignore plugins based on a flag property. So if theoretical property is set, Flow Launcher will ignore that plugin and not add result to UserSelectedRecord.json file. If we want to allow for more flexibility then this property could be part of the Result class so that the plugin developer can specify for a given List to enable auto rank or disable auto when user interacts with result set. I am new to Flow Launcher plugin dev so tried my best to find the mechanism for this.
It appears to be here:
Flow.Launcher/Flow.Launcher/ViewModel/ResultsViewModel.cs
Lines 231 to 240 in 67cf6b6
The text was updated successfully, but these errors were encountered: