Skip to content
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

[PT run] Initial selection is not consistent and sometimes even incorrect #13310

Open
1 task done
CombeeMike opened this issue Sep 20, 2021 · 15 comments
Open
1 task done
Labels
Issue-Bug Something isn't working Needs-Team-Response An issue author responded so the team needs to follow up Product-PowerToys Run Improved app launch PT Run (Win+R) Window

Comments

@CombeeMike
Copy link

CombeeMike commented Sep 20, 2021

Microsoft PowerToys version

0.45.0

Running as admin

  • Yes

Area(s) with issue?

PowerToys Run

Steps to reproduce

Inconsistent selection highlighting

I have no 1:1 reproduction steps as this behavior is most probably highly dependant on the indexed files & search history but I can explain what happens:

When typing something, most of the time the first entry in the result list is highlighted so that I know at one glance that this will be executed when pressing enter without moving the selection at all. However, sometimes nothing is selected:

2021-09-20_08h25_12.mp4

As you can see in this video:

  • ✅ When searching for fire, the first entry is selected.
  • ❌ When searching for finan, the first entry is not selected as expected.
    However, when pressing enter in this state, the first entry is still executed.

Incorrect selection highlighting

Sometimes it even happens, that the wrong entry is selected:

2021-09-20_08h32_24.mp4

Here, I only typed fin and did not move the selection, however, it is still the second entry which is highlighted. What is even more confusing then: When I press enter in the shown state, the first entry FinanceControl gets executed, not the highlighted one 🤷‍♂️

✔️ Expected Behavior

  • Always highlight the first entry after typing
  • Always execute the item which is highlighted when pressing enter

❌ Actual Behavior

  • Sometimes no entry is highlighted at all
  • Sometimes incorrect entry is highlighted

Other Software

No response

@CombeeMike CombeeMike added Issue-Bug Something isn't working Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Sep 20, 2021
@htcfreek
Copy link
Collaborator

Thank you for reporting that!
Could you please send us a bug report?


How to generate the report:
1. Right-click on the PowerToys icon in the tray menu and select Report Bug.
image
2. The report is saved as .zip file on your desktop. Please drag and drop the report into a GitHub comment.

@CombeeMike
Copy link
Author

CombeeMike commented Sep 20, 2021

@htcfreek

Sure, here's the bug report:
PowerToysReport_2021-09-20-13-13-00.zip

@htcfreek
Copy link
Collaborator

@CombeeMike
Can you please try if it helps to disable calculator plugin. I found two types of exceptions and one is from calculator plugin.

[2021-09-20 12:50:11.8309] [ERROR] [S:\src\modules\launcher\Plugins\Microsoft.PowerToys.Run.Plugin.Calculator\Main.cs::63]
-------------------------- Begin exception --------------------------
Message: Exception when query for <{query}>

Exception full name  : Mages.Core.ParseException
Exception message    : The given source code contains errors.
Exception stack trace:
   at Mages.Core.Ast.Walkers.OperationTreeWalker.Mages.Core.Ast.IValidationContext.Report(ParseError error)
   at Mages.Core.Ast.Expressions.InvalidExpression.Validate(IValidationContext context)
   at Mages.Core.Ast.Walkers.OperationTreeWalker.Mages.Core.Ast.ITreeWalker.Visit(InvalidExpression expression)
   at Mages.Core.Ast.Expressions.InvalidExpression.Accept(ITreeWalker visitor)
   at Mages.Core.Ast.Walkers.OperationTreeWalker.Handle(BinaryExpression expression, Function function)
   at Mages.Core.Ast.Walkers.OperationTreeWalker.<>c.<.cctor>b__57_20(OperationTreeWalker walker, BinaryExpression expr)
   at Mages.Core.Ast.Walkers.OperationTreeWalker.Mages.Core.Ast.ITreeWalker.Visit(BinaryExpression expression)
   at Mages.Core.Ast.Expressions.BinaryExpression.Accept(ITreeWalker visitor)
   at Mages.Core.Ast.Walkers.OperationTreeWalker.Handle(BinaryExpression expression, Function function)
   at Mages.Core.Ast.Walkers.OperationTreeWalker.<>c.<.cctor>b__57_21(OperationTreeWalker walker, BinaryExpression expr)
   at Mages.Core.Ast.Walkers.OperationTreeWalker.Mages.Core.Ast.ITreeWalker.Visit(BinaryExpression expression)
   at Mages.Core.Ast.Expressions.BinaryExpression.Accept(ITreeWalker visitor)
   at Mages.Core.Ast.Walkers.OperationTreeWalker.Mages.Core.Ast.ITreeWalker.Visit(SimpleStatement statement)
   at Mages.Core.Ast.Statements.SimpleStatement.Accept(ITreeWalker visitor)
   at Mages.Core.Ast.Walkers.OperationTreeWalker.Mages.Core.Ast.ITreeWalker.Visit(BlockStatement block)
   at Mages.Core.Ast.Statements.BlockStatement.Accept(ITreeWalker visitor)
   at Mages.Core.Ast.StatementExtensions.MakeRunnable(IEnumerable`1 statements)
   at Mages.Core.Engine.Interpret(String source)
   at Microsoft.PowerToys.Run.Plugin.Calculator.CalculateEngine.Interpret(String input, CultureInfo cultureInfo)
   at Microsoft.PowerToys.Run.Plugin.Calculator.Main.Query(Query query)
Exception source     : Mages.Core
Exception target site: Void Mages.Core.Ast.IValidationContext.Report(Mages.Core.ParseError)
Exception HResult    : -2146233088
-------------------------- End exception --------------------------

(The other type is because the config of various built-in apps are not found. I think you have removed them.)

@CombeeMike
Copy link
Author

@htcfreek Sure, just disabled the calc plugin & tested -> Same behavior

@htcfreek
Copy link
Collaborator

@CombeeMike
Can you please try if it helps to disable calculator plugin. I found two types of exceptions and one is from calculator plugin.

[2021-09-20 12:50:11.8309] [ERROR] [S:\src\modules\launcher\Plugins\Microsoft.PowerToys.Run.Plugin.Calculator\Main.cs::63]
-------------------------- Begin exception --------------------------
Message: Exception when query for <{query}>

Exception full name  : Mages.Core.ParseException
Exception message    : The given source code contains errors.
Exception stack trace:
   at Mages.Core.Ast.Walkers.OperationTreeWalker.Mages.Core.Ast.IValidationContext.Report(ParseError error)
   at Mages.Core.Ast.Expressions.InvalidExpression.Validate(IValidationContext context)
   at Mages.Core.Ast.Walkers.OperationTreeWalker.Mages.Core.Ast.ITreeWalker.Visit(InvalidExpression expression)
   at Mages.Core.Ast.Expressions.InvalidExpression.Accept(ITreeWalker visitor)
   at Mages.Core.Ast.Walkers.OperationTreeWalker.Handle(BinaryExpression expression, Function function)
   at Mages.Core.Ast.Walkers.OperationTreeWalker.<>c.<.cctor>b__57_20(OperationTreeWalker walker, BinaryExpression expr)
   at Mages.Core.Ast.Walkers.OperationTreeWalker.Mages.Core.Ast.ITreeWalker.Visit(BinaryExpression expression)
   at Mages.Core.Ast.Expressions.BinaryExpression.Accept(ITreeWalker visitor)
   at Mages.Core.Ast.Walkers.OperationTreeWalker.Handle(BinaryExpression expression, Function function)
   at Mages.Core.Ast.Walkers.OperationTreeWalker.<>c.<.cctor>b__57_21(OperationTreeWalker walker, BinaryExpression expr)
   at Mages.Core.Ast.Walkers.OperationTreeWalker.Mages.Core.Ast.ITreeWalker.Visit(BinaryExpression expression)
   at Mages.Core.Ast.Expressions.BinaryExpression.Accept(ITreeWalker visitor)
   at Mages.Core.Ast.Walkers.OperationTreeWalker.Mages.Core.Ast.ITreeWalker.Visit(SimpleStatement statement)
   at Mages.Core.Ast.Statements.SimpleStatement.Accept(ITreeWalker visitor)
   at Mages.Core.Ast.Walkers.OperationTreeWalker.Mages.Core.Ast.ITreeWalker.Visit(BlockStatement block)
   at Mages.Core.Ast.Statements.BlockStatement.Accept(ITreeWalker visitor)
   at Mages.Core.Ast.StatementExtensions.MakeRunnable(IEnumerable`1 statements)
   at Mages.Core.Engine.Interpret(String source)
   at Microsoft.PowerToys.Run.Plugin.Calculator.CalculateEngine.Interpret(String input, CultureInfo cultureInfo)
   at Microsoft.PowerToys.Run.Plugin.Calculator.Main.Query(Query query)
Exception source     : Mages.Core
Exception target site: Void Mages.Core.Ast.IValidationContext.Report(Mages.Core.ParseError)
Exception HResult    : -2146233088
-------------------------- End exception --------------------------

(The other type is because the config of various built-in apps are not found. I think you have removed them.)

@jaimecbernardo

  1. Do we need a separate issue for this exception?
  2. Do we need an issue because of the incorrect query command ({query}) in logged exception?
  3. Do we need an issue for the program plugin exceptions because of the uninstalled store apps (see bug report)?

@jaimecbernardo
Copy link
Collaborator

@htcfreek,
I believe this is because of the addition of calculator in global results in the settings.
The calculator engine throws an exception so we catch and log it, but I assume it's an expected exception in this case.
I don't think issues are needed for these, we're mostly just logging everything.

@dedavis6797 dedavis6797 added Product-PowerToys Run Improved app launch PT Run (Win+R) Window and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Sep 22, 2021
@dedavis6797 dedavis6797 added this to the Stability Release milestone Sep 22, 2021
@yuru7
Copy link

yuru7 commented Sep 22, 2021

The same behavior in my environment. It seems that the results from the Windows Search plugin are not highlighted. Can see this by searching with direct activation command ?.

@dedavis6797
Copy link
Contributor

This is an interesting bug. I can't reproduce either the inconsistent highlighting or incorrect selection highlighting from a normal search. How often does it occur for you @CombeeMike?

Using the ? activation phrase, no highlighting occurs at all on my device. The other activation phrases seem to work though.

@yuru7
Copy link

yuru7 commented Sep 22, 2021

This is an interesting bug. I can't reproduce either the inconsistent highlighting or incorrect selection highlighting from a normal search. How often does it occur for you @CombeeMike?

@dedavis6797
This happens when the first result is the output from the Windows Search plugin and the second result is something else.

@CombeeMike
Copy link
Author

This is an interesting bug. I can't reproduce either the inconsistent highlighting or incorrect selection highlighting from a normal search. How often does it occur for you @CombeeMike?

Using the ? activation phrase, no highlighting occurs at all on my device. The other activation phrases seem to work though.

@dedavis6797

Not sure how to properly quantify this but both issues (missing & incorrect highlighting) happen on a very regular basis for me. I think @yuru7 is right in assuming that this only happens for search plugin results so I'd guess the following (only a wild guess):

  • Highlighting is missing if all shown search results are form windows search plugin
  • Highlighting is incorrect if first result is from windows search plugin and the 2nd one from applications plugins.
    As this situation only arises for a very limited "subset" of results (see [PT run] Make "selection history" stronger in scoring system then applications #12856), this doesn't happen as often as the first one and is most probably harder to reproduce on a different system with different search history & index.

@aaronbieber
Copy link

aaronbieber commented Jan 11, 2022

I am also experiencing this exact bug, and the above summaries appear to be consistent with my observations (the first result must be from the search plugin to observe the issue).

I've attached a bug report zip of my own in case it helps to diff the two:
PowerToysReport_2022-01-11-11-33-33.zip

This is what I see, which looks like the same behavior as OP's second screen recording (pressing enter will open the search result, not the URL):
image

@CombeeMike
Copy link
Author

CombeeMike commented Oct 20, 2022

I'm still having this problem which is really annoying in combination with stuff like this TBH.

However, I think this is now easier to reproduce with the "Global sort order score modifier":

  • Set Global sort order score modifier of Windows Search plugin to some very large number.
    E.g. 200 did the trick for me.
  • Search for something which yields results from both plugins Windows Search & Program
  • The result from the Windows Search plugin is shown first in list ✅, but the first one from Program is actually selected 🔥
2022-10-20_10h23_59.mp4

FYI, like I also stated in #12856 multiple times:
I literally never started the Groove Music app from PT run, whilst I run Show Music Tab.exe on an almost daily basis which makes it really annoying that the Groove Music app is always selected first when searching for music...

@Jay-o-Way
Copy link
Collaborator

Is this still an issue with the latest version? /needinfo

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jan 23, 2024
@CombeeMike
Copy link
Author

@Jay-o-Way Yes, this is still happening to me but slightly different:

2024-01-23_12h38_45.mp4
  • ❌ Selection is still not the first item, when the first item is a result from Windows Search plugin.
    I haven't opened Postman in more than a year, whilst I open FinanceControl almost daily -> FinanceControl should be initially selected
  • ✔ Pressing enter in this state, seems to be opening the correct thing (Postman in this screencast).

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams Needs-Team-Response An issue author responded so the team needs to follow up and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Jan 23, 2024
@Jay-o-Way Jay-o-Way removed the Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams label Jan 23, 2024
@Jay-o-Way
Copy link
Collaborator

Pinging @htcfreek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug Something isn't working Needs-Team-Response An issue author responded so the team needs to follow up Product-PowerToys Run Improved app launch PT Run (Win+R) Window
Projects
None yet
Development

No branches or pull requests

7 participants