Rank an app above the menu actions that manage it - #11730
Open
ivorycrayon wants to merge 1 commit into
Open
ivorycrayon wants to merge 1 commit into
ivorycrayon wants to merge 1 commit into
Conversation
A short prefix of an app's later word ("chr" for Google Chrome) starts
the whole label of the Chrome rows under Setup, Install and Remove, so
searchScore puts all three ahead of the app. Only the full word "chrome"
reaches the whole-word tier that lets the app win.
No per-row tier fixes this. "chr" against Chrome and "vi" against Vim
are the same shape to a scorer that sees one row, so any tier that
lifts Google Chrome over its Chrome rows lifts Document Viewer over Vim
by the same amount. What separates them is that "Chrome" is a word of
the app's own label and "Vim" is not, which is only visible across the
result set.
Add a pass over the matched rows in rebuildDisplay: an action whose
whole label is a word of a matching app sorts directly behind that app.
Menus and links are left alone, since "Browser" is a word of every
browser. Swept over every 2-6 letter word prefix of the shipped menu
with 114 apps, the pass changes 7 of 1046 top-5 lists: the Chrome and
Edge cases it is for, and two one-slot moves where an unrelated action
shares a word with an installed app (Update > Channel > Edge behind
Microsoft Edge, Trigger > Capture > Text behind Sublime Text).
Fixes omacom#11614
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #11614.
Typing
chrin the menu ranks every Chrome row under Setup, Install and Remove above the installed Google Chrome app. Only the full wordchromereaches the whole-word tier that lets the app win.searchScore()cannot fix this on its own. It sees one row at a time, andchragainst the Chrome rows has the same shape asviagainstSetup › Defaults › Editor › Vim: the query starts the whole label of the action and prefixes the second word of an app (Google Chrome, Document Viewer). Any tier that lifts Chrome lifts Document Viewer over Vim by the same amount. That was #11615, closed for exactly this reason.What separates the two is that "Chrome" is a word of the app's own label and "Vim" is no word of "Document Viewer". That is only visible across the result set, so this adds one pass in
rebuildDisplay()over the matched rows: an action whose whole label is a word of a matching app sorts directly behind that app. Menus and links keep their place, since "Browser" is a word of every browser and a group is not a manager of one.On this machine (Google Chrome installed, no Chromium),
chrbefore and after:The two Chromium rows stay ahead: the query starts their whole label and they share no word with the app, which is the Vim shape, and nothing text-based should touch it. Whether
Setup › Defaults › Browser › *should show for browsers that are not installed is a separate question; every row in that group is unguarded today.Sweep: every 2 to 6 letter prefix of every word in every visible label, ranked with the real menu, real guards, the font and power-profile provider rows, and the installed apps here plus 68 synthetic ones covering every browser, editor and service the menu manages. 1046 queries, 7 changed top-5 lists:
ch,chr,chro,chrom: Google Chrome above its Chrome rows (this issue)edg: Microsoft Edge above its Edge rows (same shape)ed: Menu Editor enters at 5, since the Edge rows moved downtex: Sublime Text swaps withTrigger › Capture › TextThe last one is the cost of the heuristic: an action that shares a word with an installed app but does not manage it moves one slot, to directly behind that app.
Update › Channel › Edgedoes the same behind Microsoft Edge. Both stay in the top five.Tests cover the Chrome case, the Vim non-case, the Browser group non-case, and that
Menu.qmlruns the pass over every search row through the shared model.test/shell.d/menu-test.shpasses.