Skip to content

Accept array-like manifest kinds so cloned/third-party menus get an app library - #15692

Closed
AnPod wants to merge 1 commit into
omacom:quattrofrom
AnPod:plugin-kinds-arraylike
Closed

AnPod wants to merge 1 commit into
omacom:quattrofrom
AnPod:plugin-kinds-arraylike

Conversation

@AnPod

@AnPod AnPod commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Fixes #15617, fixes #15483, fixes #15595

Problem

A plugin manifest that passes through a QML model exposes kinds as an array-like sequence rather than a real Array, so Array.isArray(manifest.kinds) is false. Every host-side kind gate used that check, so for third-party and cloned plugins shell.manifestHasKind(manifest, "menu") returned false and createScopedPluginShell handed the plugin appLibrary: null — a cloned omarchy.menu opens with an empty Apps list ("Nothing here yet") even though its manifest declares "kinds": ["menu", "bar-widget"], and third-party menu plugins never receive shell.appLibrary. First-party plugins were unaffected because their manifests stay plain JSON objects.

Fix

  • Util.kindsContain(kinds, kind) searches both real arrays and array-like sequences (length + indexed access); Util.manifestHasKind delegates to it.
  • Every Array.isArray(...kinds) gate in shell/shell.qml (manifestHasKind, isBarOptionManifest, service lookup/sync, isBarWidgetPanelPlugin, computePanelEntries, listPlugins) and shell/services/PluginRegistry.qml (isEnabled, activeCloneFor, restoreCloneSource, setEnabled) now routes through the helper. The strict Array.isArray validation of raw manifest JSON at scan time is unchanged, and the array fast-path in the helper keeps plain arrays on indexOf.

Test

New test/shell.d/plugin-kinds-sequence-test.sh:

  • extracts kindsContain from Util.qml and runs it under node against a simulated QML sequence (Array.isArray === false), verifying sequence and plain-array lookup plus null/empty/non-array-like rejection;
  • asserts Util.manifestHasKind delegates to it and that no host file gates a kind check on Array.isArray(...kinds) outside the two intentional sites (raw-JSON validation and the array fast-path), so the pattern cannot silently return.

Verified the test fails on clean quattro and passes with the fix. Related suites (plugin-clone-test, plugin-enable-test, plugin-registry-contract-test, bar-widget-contract-test, plugin-manifest-scan-test) pass; menu-plugin-test fails identically (exit 127) on clean quattro, a pre-existing environment issue.

A manifest that passes through a QML model exposes kinds as an
array-like sequence, not an Array. Every host-side gate built on
Array.isArray(manifest.kinds) then fails, so third-party (and cloned)
plugins get shell.appLibrary === null and their menus show an empty
Apps list. Route all kind checks through Util.kindsContain, which
searches plain arrays and array-like sequences alike.

Fixes omacom#15617
Fixes omacom#15483
Fixes omacom#15595
@greptile-apps

greptile-apps Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

Makes plugin kind checks accept both arrays and array-like QML sequences.

  • Plugin kind checks now recognize QML array-like sequences.

No actionable issues found. Tests were inspected but not run during this review.

Reviews (1) · Last reviewed commit: "shell: accept array-like manifest kinds ..." · Reviewed by Greptile

@omarchybot

Copy link
Copy Markdown
Collaborator

I read this change at 73e7a61 against quattro: the new Util.kindsContain and Util.manifestHasKind in shell/Commons/Util.qml, the kind checks it replaces in shell/shell.qml and shell/services/PluginRegistry.qml, and test/shell.d/plugin-kinds-sequence-test.sh. Nothing has been run on a worker and no labels have been added.

It has not been classified yet. Every item gets two separate classifications, one from Claude Opus 5.5 and one from the configured reviewer, Codex Medium. Claude read it as a bug fix. Codex Medium could not be asked, because omabot's daily limit on second-opinion reviews was already used up. One model's answer does not count as a classification, so this stays unlabelled and unverified.

Two things the maintainer will need when it comes round again, both checked against the source:

Next: it waits for the second classification. You don't need to do anything for now.

AnPod commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Closing since the linked issues were closed.

@AnPod AnPod closed this Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants