Skip to content

Support QML sequence kinds in manifestHasKind for cloned menu plugins (#14761) - #14767

Open
Sebo1411 wants to merge 1 commit into
omacom:quattrofrom
Sebo1411:fix/issue-14761-cloned-menu-app-library
Open

Sebo1411 wants to merge 1 commit into
omacom:quattrofrom
Sebo1411:fix/issue-14761-cloned-menu-app-library

Conversation

@Sebo1411

@Sebo1411 Sebo1411 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #14761

Description

When plugins (such as a cloned omarchy.menu like jr.menu) are instantiated via the panel loader's Instantiator, accessing panelEntry.manifest in QML exposes nested JS Arrays as QML V4Sequence (QVariantList) objects rather than native JS Arrays.

As a result, manifestHasKind() returning Array.isArray(manifest.kinds) returned false. This caused createScopedPluginShell to set appLibrary: null, rendering the Apps submenu in cloned menu plugins completely empty ("Nothing here yet").

Changes

  • Updated manifestHasKind() in shell/shell.qml to accept any sequence-like object implementing indexOf() (typeof kinds === "object" && typeof kinds.indexOf === "function"), while still rejecting non-objects and primitive types like strings to prevent substring matching.
  • Reused shell.manifestHasKind(manifest, "bar") in isBarOptionManifest() for consistency.
  • Added test/shell.d/cloned-menu-app-library-test.sh covering native JS arrays, sequence-like objects, invalid manifests, and scoped plugin shell wiring.

@greptile-apps

greptile-apps Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] No new blocking defects were found in the changes reviewed.

Summary

Updates manifestHasKind() to accept QML sequences with indexOf(), so cloned menu plugins can receive appLibrary.

  • Cloned menus with QML kind lists can receive their app library.

Reviews (7) · Last reviewed commit: "Support QML sequence kinds in manifestHa..." · Reviewed by Greptile

@jandrusk

Copy link
Copy Markdown

This matches the cloned-menu failure mode in #14761 — Instantiator-exposed manifest.kinds is a QML sequence, so Array.isArray fails and appLibrary stays null. Accepting any object with indexOf while still rejecting strings (no substring match) is the right shape, and the fixture coverage helps. Ready for review. Related history: #10661 / #14462 / #13439.

@Sebo1411
Sebo1411 force-pushed the fix/issue-14761-cloned-menu-app-library branch from 5008ac5 to 8f479e4 Compare October 12, 2026 21:42
@Sebo1411

Copy link
Copy Markdown
Contributor Author

@greptile review

1 similar comment
@Sebo1411

Copy link
Copy Markdown
Contributor Author

@greptile review

@omarchybot

Copy link
Copy Markdown
Collaborator

I read this pull request against #14761. I take it as a bug fix: manifestHasKind() rejects the V4Sequence that kinds turns into when it comes through the panel Instantiator's modelData, so a cloned menu gets appLibrary: null. Checking for an indexOf method while still rejecting strings matches the cause the issue describes.

Its classification is not settled yet, so it has no label and has not been run on a worker. Every item here is classified by two models separately, and the second, Codex Medium, could not run today because its daily review allowance is used up. Only my reading (Claude Opus 5.5) stands so far, and that is not enough to label it or to verify it.

One thing to look at when it is verified: the QML fixture in test/shell.d/fixtures/cloned-menu-app-library/shell.qml has its own copy of manifestHasKind() and does not load shell/shell.qml. So the runtime test passes or fails on that copy, not on the shipped function, and it would still pass if the fix in shell.qml were reverted. Only the Node test reads the real function.

Next: the item will be classified again once a second opinion is available. Nothing is needed from you before then.

@Sebo1411
Sebo1411 force-pushed the fix/issue-14761-cloned-menu-app-library branch from 32753d9 to b9f9621 Compare October 30, 2026 18:02
@omarchybot omarchybot added the bug Something isn't working label Nov 2, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at b9f9621 against quattro, on a worker built from the Omarchy ISO with a real Hyprland session, with second opinions from Codex Medium and muse-wonder (pi, thinking high).

The bug does not happen on quattro. I cloned omarchy.menu on the worker as a third-party tester.menu (kinds ["menu","bar-widget"]) and logged its shell and appLibrary from inside its Menu.qml. On this pull request's base (717175d), without the change, it got a scoped PluginShellApi with a live PluginAppLibraryApi listing 44 apps. Since #13439 the panel delegate reads its manifest from shell.pluginRegistry.installedPlugins[pluginId] instead of modelData, so kinds stays a JS array. Every caller of manifestHasKind() on quattro gets a registry manifest. The empty Apps list in #14761 is real on 4.0.x, which still has the old delegate. Both reviewers reached the same conclusion from the source. They agreed with a finding already written down, so treat that as agreement rather than an independent check.

The change itself is correct. ./test/cli passed on the head, and so did menu-plugin-test.sh and plugin-registry-contract-test.sh. The cloned menu still got its app library on the head. Neither reviewer found a production defect. The isBarOptionManifest() change is safe because its one caller only checks whether the result is truthy.

The QML half of the new test does not test the shipped code. test/shell.d/fixtures/cloned-menu-app-library/shell.qml carries its own copy of manifestHasKind() and a stub createScopedPluginShell(), and never loads shell/shell.qml. On the worker the fixture returned ok: true as shipped and ok: false with the old predicate pasted into it, so it shows that Array.isArray rejects a modelData sequence. But it would still pass if the fix in shell/shell.qml were reverted. Only the two Node sequence assertions at lines 34–35 of cloned-menu-app-library-test.sh check the real function. The test also never checks isSequence, and nothing covers isBarOptionManifest(). The Node half could not run on the worker, which has no node. CI ran it and it passed.

Competing pull requests. #15053 and #15400 change the same predicate for the same report. This one is the oldest, and neither newer one fixes a case that is reachable here. muse-wonder preferred #15053 because it also accepts a list with no indexOf method of its own. On the worker, the sequence the Instantiator actually delivers had a working indexOf, so I didn't count that as a gap. Codex Medium kept this one ahead.

Next: this waits on the maintainer. They need to decide whether quattro wants a defensive change for a path nothing reaches today, and whether the 4.0.x line needs this or a backport of #13439. Nothing is needed from you before then. No labels beyond bug were added, because verified needs the bug to fail on the base first.

@aholbreich

Copy link
Copy Markdown
Contributor

Thanks @Sebo1411. The V4Sequence modelData.manifest path this fixed no longer exists: 0066ea216 (#13439) made the panel loader read manifests from pluginRegistry.installedPlugins[pluginId] instead of the Instantiator modelData, so manifestHasKind now always sees a real JS array. The bug does not reproduce on current quattro. Recommend closing as already-fixed, crediting your indexOf-shape diagnosis.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cloned menu plugins get appLibrary: null, so the Apps submenu is empty (4.0.4)

4 participants