Repository navigation
Open a menu route summoned during startup once the menu files load - #15519
omarchybot wants to merge 4 commits into
Conversation
A summon that arrives while the shell starts reaches the menu before either JSONC file has loaded, so its route can't resolve and the menu falls back to root. Nothing opens the route when the files land, so Super+Escape right after login or a shell restart shows the main menu, and an action alias like reminder-set never runs. openRoute already records the route in pendingInitialMenu, which nothing has read since the bash menu's replay went away. Keep it only when the menu fell back to root, and open it once a load makes it resolve, while the menu still shows root and nothing has been typed into it.
The route was opened as soon as it resolved, which could be against the default file alone: an early summon of about ran the default command even when the user file overrides it. It also stayed pending after the user had opened another menu and gone back to root, so a later load, or a live edit that adds a route that was missing, could still open it. Give the route one try, once the default file has loaded and the user file has loaded or failed, and drop it as soon as the user types or opens another menu. A route summoned after both files have answered does not wait at all.
Menu.qml on quattro now tracks defaultMenuSettled and userMenuSettled for the guard batch (#15048), which already answer whether both menu files have loaded or failed. menuFilesAnswered() reads those instead of the branch's own userMenuFailed flag, and the startup route test seeds them and the new menu catalog from Menu.qml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
menuFilesAnswered() reads the settled flags quattro keeps for the guard batch, but a default file that failed set defaultMenuSettled without rebuilding, so a route pending at that moment was left for a later catalog load, language change or a default file that reappeared to replay. The default file's failure handler now rebuilds, as the user file's already does: the route gets its try the moment both have answered, whatever the answer, and is cleared. rebuildItemsFromSources() still evaluates the guards only once both have settled, so the guard batch runs exactly when it did, and menu-test.sh's check of the handler follows the new text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
[Medium impact] Menu startup route handling during file load. The PR appears safe to merge, with a non-blocking issue that repeats startup guard checks. Findings
SummaryRetries a menu route requested before the menu files finish loading.
Acknowledged intent: omarchybot explicitly limits waiting to routes that fell back to root. Routes that already resolve continue to open immediately.
|
| var pending = root.pendingInitialMenu | ||
| if (pending && root.menuFilesAnswered()) { | ||
| root.pendingInitialMenu = "" | ||
| if (root.opened && !root.dmenuActive && root.item(root.resolveRoute(pending))) root.openRoute(pending) |
There was a problem hiding this comment.
Replaying a pending submenu runs the guard batch twice. rebuildItemsFromSources() already calls evaluateGuards() before this line. Calling openRoute(pending) then reaches openExistingMenu(), which calls it again. The first batch is still running, so the second call sets guardsPending and queues another full batch.
This adds avoidable work during startup. Skip the second evaluation when replaying a route from this rebuild.
|
Not reviewed yet: its classification is unsettled, so it carries no class label. Claude Opus 5.5 read the diff and #14053 and takes it for a bug fix. Every class needs a second model's agreement, though, and the configured reviewer (Codex Medium) did not run because today's review budget was already used up. Nothing has been run on a worker, and it has no No other open pull request fixes #14053; #14055 is closed and this one carries it forward. It waits on the classification being settled, either by a later pass once a second opinion is available or by the maintainer. |
A menu route summoned while the shell is starting (Super+Escape or the power key right after login, or just after
omarchy-restart-shell, whichomarchy updateruns) reachesMenu.qml'sopen()before either JSONCFileViewhas loaded.openRoute()cannot resolve the route against an empty item set,openExistingMenu()falls back to root, and nothing opens the route once the files land:openRoute()still writespendingInitialMenu, but nothing has read it since the bash menu went away. An action alias summoned in that window (Super+Ctrl+R, Super+Ctrl+Space, Super+Shift+Ctrl+Space) never runs. Fixes #14053.This reads
pendingInitialMenuagain.openExistingMenu()keeps the route only when it fell back to root before both menu files had answered. At the end ofrebuildItemsFromSources(), once both have answered, the pending route gets one try throughopenRoute(), so aliases, links, action aliases and the user's overrides behave as they do after startup, and is cleared whatever happens. Typing (setFilter()) or opening another menu (setActiveMenu(), whichgoBack()goes through) drops it, so a late load never pulls the user out of where they went. A summon after startup never waits."Both have answered" is
defaultMenuSettled && userMenuSettled, the flagsquattroalready keeps so the guard batch runs once at startup (#15048). The default file'sonLoadFailednow rebuilds, as the user file's already does, so a pending route gets its try the moment the second file answers, loaded or failed, and nothing later (a catalog load, a language change, a default file that reappears) can replay it.rebuildItemsFromSources()still evaluates guards only once both have settled, so the guard batch runs when it did;menu-test.sh's text check of that handler follows the new line.test/shell.d/menu-startup-route-test.shrunsMenu.qml's ownopen,openRoute,openExistingMenu,openDmenu,cancel,rebuildItemsFromSources,setFilter,setActiveMenuandgoBackbodies and theFileViewhandlers in a nodevmcontext against the shipped JSONC files, in each load order, including a default file that fails after the user file.Supersedes #14055 by @buger, whose commits this carries unchanged, with the fixes above on top.