Track user-selected results for ranking purposes

Added logic to record user-selected results in `_userSelectedRecord`
before executing both synchronous and asynchronous actions. This
enables tracking of user interactions for result ranking or analytics.
Comments were added to clarify the purpose of the new logic.
This commit is contained in:
Jack251970 2025-10-15 12:23:52 +08:00
parent 4b6ee4ea98
commit 1298b76b77

View file

@ -1357,12 +1357,18 @@ namespace Flow.Launcher.ViewModel
{
if (reflectResult.Action != null)
{
// Record the user selected record for result ranking
_userSelectedRecord.Add(reflectResult);
// Since some actions may need to hide the Flow window to execute
// So let us populate the results of them
return reflectResult.Action(c);
}
if (reflectResult.AsyncAction != null)
{
// Record the user selected record for result ranking
_userSelectedRecord.Add(reflectResult);
// Since some actions may need to hide the Flow window to execute
// So let us populate the results of them
return await reflectResult.AsyncAction(c);