Repository navigation
Give cloned menus their application library - #11285
sfk8815-create wants to merge 1 commit into
Conversation
Panel, overlay, and menu plugins are instantiated from panelEntries through an Instantiator model. Nested arrays come back from that model as QV4 sequence wrappers rather than JS arrays, so the Array.isArray() check in manifestHasKind() rejected every manifest that arrived that way. A cloned menu failed the "menu" check, was handed no application library, and its Apps submenu came up empty with nothing in the log to explain it. First-party menus never reach the check because pluginShellFor() early-returns the host shell for manifest.__isFirstParty. Accept any array-like kinds list instead.
|
Reviewed at 48ddb62 and run on a disposable Omarchy ISO worker with a real Hyprland session. The bug was real, and this change fixes it on the tree it was written against. Current How I checked. On the worker I ran
Why it is gone. #13439 (merged 2026-09-27) changed the panel Related. #11079, which is still open, also rewrites Not run. I didn't run the shell suite, since the result does not depend on it. The second opinion did not run either: the configured reviewer (Codex Medium) answered a ping, but today's review budget was already spent. This review is mine alone. Nothing was pushed. This is waiting on the maintainer, who may want to close it as fixed by #13439. Thanks for the precise diagnosis and the minimal reproduction in #11282. They made this quick to confirm. |
|
Thank you for this, @sfk8815-create. Closing because #13439 already fixes this on Closed at the maintainer's request. The review comment above has the details; it was done by Claude Opus 5.5 with Codex Medium as a second opinion, whose agreement is not independent. |
Closes #11282.
manifestHasKind()required a real JS array:Array.isArray(manifest.kinds). Panel, overlay, and menu plugins are instantiated frompanelEntriesthrough anInstantiatormodel, and nested arrays come back from that model as QV4 sequence wrappers instead of JS arrays —Array.isArray()is false for them whileString(kinds)andkinds.indexOf("menu")still work.A cloned menu therefore failed the
menucheck increateScopedPluginShell(), was handedappLibrary: null, andMenu.qml'smergeAppRows()returned atif (!root.appLibrary) return, leaving the Apps submenu empty with nothing in the log to explain it. First-party menus never reach the check becausepluginShellFor()early-returns the host shell formanifest.__isFirstParty, which is why this only shows up once the menu is cloned (or shipped by a third party).The fix accepts any array-like
kindslist.Verification
Instantiatormodel reports[object V4Sequence]forkinds,Array.isArray(...) === false,kinds.indexOf("menu") !== -1. With this change the kind check returns true for it; a manifest read straight frominstalledPluginsstill returns true, and"service"/nullstill return false.sfk.menu,omarchy.menudisabled):omarchy-shell shell call sfk.menu mergeAppRowsleftchildCount("apps")at 0 before the change; loading the sameMenu.qmlin an isolated Quickshell with a workingappLibraryinjected gives 73 rows, so the menu code itself is fine once the library is handed over../test/allon this machine: 3349 assertions pass. The two failures I see locally (bar-icon-geometry-test.sh,launch-about-test.sh) fail identically on the unmodified tree here, so they are environment-specific rather than caused by this change.I checked the other
Array.isArray(manifest.kinds)call sites inshell.qml(isBarOptionManifest,isBarWidgetPanelPlugin,ensureService,_syncServices,computePanelEntries,listPlugins); they all read manifests straight frominstalledPluginsor the live config, so this was the only one reached with a model-delivered manifest.Before/after captures of the Apps submenu are attached to #11282. Happy to fold this into a different shape (for example a helper that also normalizes the manifest at the loader) if you prefer.