Skip to content

Treat app word prefixes as label prefixes in menu search - #10457

Open
benwillems wants to merge 2 commits into
omacom:quattrofrom
benwillems:fix/menu-app-word-prefix-rank
Open

benwillems wants to merge 2 commits into
omacom:quattrofrom
benwillems:fix/menu-app-word-prefix-rank

Conversation

@benwillems

@benwillems benwillems commented Sep 6, 2026 •

Copy link
Copy Markdown

Problem

chro is a prefix of Setup › Browser › Chrome (score 10) but only a contains-match inside "Google Chrome" (score 30). Enter changes the default browser instead of launching the app.

Fix

Score a prefix of any word in an app name as a label prefix. The existing app tiebreak (score -= 5) then wins the equal-prefix case. Exact menu matches stay put — Font still beats FontForge.

Fixes #10340

Before

First hit is Setup › Defaults › Browser. Enter changes the default.

before

After

First hit is Google Chrome. Enter launches the app.

after

Tests

test/shell.d/menu-test.sh — chro on Google Chrome now outranks Setup/Install/Remove › Chrome. Brave, Zen, and FontForge ranking assertions still pass.

Fixes #11614

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 2, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 7290119. The change is correct and fixes what it says: with a Google Chrome entry installed, chro puts Google Chrome above Setup › Defaults › Browser › Chrome, Install › Browser › Chrome and Remove › Browser › Chrome, where on quattro it came sixth, below all of them. I checked that in the running menu on an Omarchy ISO worker, base against head. On the same worker test/shell.d/menu-test.sh passes (122) and ./test/cli passes (112), and the new assertion fails with MenuModel.js reverted to quattro. I've added verified. One thing to know: on a stock install, which still has the Chromium app, chro was already led by Chromium and still is. Google Chrome moves from sixth to second.

It is not marked ready, because the new tier reaches well beyond Chrome. Any app whose later name-word the query prefixes now nets 5 and beats a menu entry whose whole label starts with the query. On the same stock worker, that changes what Enter picks for:

  • vi: Document Viewer, where it was Setup › Defaults › Editor › Vim
  • co, con: Google Contacts, where it was Setup › Config
  • us: Disk Usage, where it was Update › Password › User

ba (LibreOffice Base over Learn › Bash) and dr (LibreOffice Draw over Install › Service › Dropbox) go the same way wherever those apps are installed. Some of these are arguably better: launching an app is safer than changing the default editor. But it is a ranking policy, and it is a different one from the bug report.

#11730 fixes the same report the narrow way. It leaves searchScore() alone and sorts an action directly behind an installed app whose name contains that action's whole label as a word. It changes none of the queries above. It also does not fix chro on a machine without Chromium, because Setup › Defaults › Browser › Chromium still leads. #11614 has measurements for both. Choosing between the two, or deciding these reorderings are acceptable, is the maintainer's call, so this waits on them. Nothing is needed from you. I've linked #11614, which this also fixes, alongside #10340.

Second opinion: Codex Medium compared this PR with #11730. It found no defect in either change. It preferred this one, because #11730 leaves the Chromium row first, It confirmed the reorderings #11614 reports, and it found the co and us cases on its own. It could read this session's notes, so treat that as agreement rather than an independent result. Reviewed by Claude Opus 5.5 and Codex Medium.

@McoreD

McoreD commented Oct 15, 2026

Copy link
Copy Markdown

This is the search I hit on Omarchy 4.0.4-1. Query chr, Google Chrome installed, no Chromium app. Today the first row is Setup › Defaults › Browser › Chrome, then Install › Service › Chromium Account, then Remove › Browser › Chrome. Google Chrome is fourth, so Enter does not launch it.

A prefix of the app's own name should put that app first, ahead of those actions. This change does that for chr and chro, including against the Chromium action rows, which is what this search needs.

I also asked on #11614 for the broader rule in #12223, any matching app above menu entries. Either way the top hit here has to be the app.

#11614 (comment)

@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review and removed verified Omarchy Triage has verified that this issue is ready for final review labels Oct 20, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This stopped merging cleanly once quattro moved Style › Font to Appearance › Font (#15973), so I merged quattro into the branch (b13e204). The only conflict was the FontForge assertion in test/shell.d/menu-test.sh, which now names appearance.font.

While re-checking it on quattro I found a regression in the new tier and pushed a fix (fb3d73e). A word prefix scored the same as a label prefix, so two apps tied and alphabetical order decided. On a stock install, typing vi put Document Viewer and Image Viewer above Vim, and Enter opened Document Viewer. On quattro it opens Vim. The word-prefix tier now scores 12 instead of 10. That keeps such an app above every menu entry starting with the query, which is what fixes chro, and an app whose name starts with the query comes first again. There is a new assertion for vi.

Checked on an Omarchy ISO worker running the shell from this branch, at fb3d73e against quattro 087f73d:

  • In the running menu, vi leads with Vim. With a Google Chrome entry installed, chro puts Google Chrome above Setup › Defaults › Browser › Chrome, Install › Browser › Chrome and every other Chrome or Chromium action. Only the Chromium app outranks it. Without the Chromium app, Google Chrome leads for both chr and chro, which is the case @McoreD describes.
  • test/shell.d/menu-test.sh passes (200) and ./test/cli passes (125). With MenuModel.js from quattro, the Chrome assertion fails. With the tier put back to 10, the vi assertion fails.

verified is back on. It is still not ready, for the same reason as before: the tier lets an app's later word beat a menu entry whose label starts with the query, which is a ranking policy beyond the report. co and con still open Google Contacts instead of Setup › Config on a stock install. The us case no longer reproduces on current quattro. #11730 (narrower) and #12223 (broader: any matching app above menu entries) fix the same reports. Which rule the menu should follow is the maintainer's decision, so this is waiting on them. Nothing is needed from you.

Second opinion: Codex Medium reviewed the merge and the fix and found no defect in either. It confirmed the vi and chro orderings and the tier table behind them. It raised the co/con reordering again and preferred #11730's narrower rule. It could read this session's notes, so its agreement is not guaranteed to be independent. Reviewed by Claude Opus 5.5 and Codex Medium.

@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues were found.

Summary

App searches now give later-word prefixes a better score, so chro ranks Google Chrome above Chrome settings.

  • App search finds matches at the starts of later name words.

Reviews (2) · Last reviewed commit: "Keep an app's own name prefix above a la..." · Reviewed by Greptile

benwillems and others added 2 commits November 10, 2026 08:53
Typing chro scored Setup > Chrome as a label prefix and Google Chrome as a contains-match, so Enter changed the default browser instead of launching the app.
A word prefix scored the same as a label prefix, so two apps met on equal terms and the alphabetical order decided: typing vi put Document Viewer and Image Viewer above Vim. Scoring the word prefix just under a label prefix keeps it above every menu entry with that prefix, which is what fixes chro for Google Chrome, while an app whose name starts with the query still comes first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@benwillems
benwillems force-pushed the fix/menu-app-word-prefix-rank branch from fb3d73e to be6ef29 Compare November 10, 2026 13:53
@benwillems

Copy link
Copy Markdown
Author

Rebased onto current quattro (cherry-picked the two ranking commits; kept quattro's appearance.font assertion). test/shell.d/menu-test.sh passed.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Nov 11, 2026
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Nov 16, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Re-checked after the rebase onto quattro. Both commits came across unchanged, and searchScore has not changed on quattro since, so the fix works the same as before. I checked it again on an Omarchy ISO worker running the shell from this branch at be6ef29, against quattro 3b36b9e. Google Chrome was added as an app and the Chromium app hidden, which is the case @McoreD described.

  • In the running menu, chro on quattro puts Setup › Defaults › Browser › Chromium first, so Enter changes the default browser, and Google Chrome is fifth. On this branch, Google Chrome is first.
  • test/shell.d/menu-test.sh passes (112) and ./test/cli passes. With MenuModel.js reverted, the Chrome assertion fails.
  • vi still opens Vim. con still opens Google Contacts instead of Setup › Config, as in my last comment. That follows from the rule this adds: a prefix of any word in an app's name beats a menu entry whose label starts with the query.

Before: on quattro, typing chro puts Setup › Defaults › Browser › Chromium first and Google Chrome fifth
After: on this branch, typing chro puts the Google Chrome app first

Several open pull requests fix the same reports, so I compared them: #7661, #11730, #12223, #15171 and #17253. This one is the one to take. #7661 is older and now also covers the Chrome rows, but Setup › Defaults › Browser › Chromium has no guard and its label is not a word of "Google Chrome", so chr and chro still select it first there. #11730 and #15171 leave that same row first. #12223 also fixes Chrome, but with a broader rule that puts any matching app above exact menu matches, so FontForge beats Appearance › Font. #17253 makes the same fix as this one, later. #7661's RustDesk fix is for #7630, a separate bug, and stays there.

I've added ready. It is waiting on the maintainer, who decides whether the menu should follow this rule, con included. Nothing is needed from you.

Second opinion: Codex Medium and muse-wonder (pi, high thinking) reviewed the diff at this head and found no defect. Both called it the smallest fix for the cause, and both called the con and vi reordering a choice about ranking rather than a bug. Codex Medium also picked this pull request from the competing ones, for the Chromium row above. Both could read this session's notes, so treat their agreement as agreement, not an independent result. Reviewed by Claude Opus 5.5, Codex Medium and muse-wonder (pi, high thinking).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

3 participants