From 23aeb4c6703032bf32cd470567722069bd1fb427 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Sun, 6 Sep 2026 22:18:52 -0400 Subject: [PATCH] Preserve clone summons in replacement bars Co-Authored-By: GPT-5.6-Sol --- shell/shell.qml | 10 ++++++++-- test/shell.d/plugin-auth-boundary-test.sh | 7 +++++++ test/shell.d/runtime-smoke-test.sh | 18 ++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/shell/shell.qml b/shell/shell.qml index c211180f..c6b7643a 100644 --- a/shell/shell.qml +++ b/shell/shell.qml @@ -683,12 +683,18 @@ ShellRoot { === shell.pluginRegistry.resolveEnabledId(target) } + function currentManifest() { + var id = shell.pluginRegistry.resolveEnabledId(target) + return shell.pluginRegistry.installedPlugins[id] || null + } + var api = pluginShellApiComponent.createObject(null, { pluginId: target, barConfig: shell.publicBarConfig(), _summon: function(requestedId, payloadJson) { - return owns(requestedId) - ? shell.summon(shell.pluginRegistry.resolveEnabledId(target), payloadJson) : false + if (!owns(requestedId) + && !shell.pluginCloneMaySummon(currentManifest(), requestedId)) return false + return shell.summon(shell.pluginRegistry.resolveEnabledId(requestedId), payloadJson) }, _hide: function(requestedId) { return owns(requestedId) diff --git a/test/shell.d/plugin-auth-boundary-test.sh b/test/shell.d/plugin-auth-boundary-test.sh index b96d7d2f..92832f03 100755 --- a/test/shell.d/plugin-auth-boundary-test.sh +++ b/test/shell.d/plugin-auth-boundary-test.sh @@ -130,6 +130,13 @@ qml_matches "$shell_qml" 'shellApi\.idleConfig *= *shell\.publicIdleConfigFor\( fail "cloned idle service configuration does not refresh" qml_matches "$idle_service" 'shell *&& *shell\.idleConfig *\? *shell\.idleConfig *: *\(\{\}\)' || fail "the idle service does not consume its scoped configuration" +bar_entry_shell=$(sed -n '/^ function pluginShellForBarEntry(/,/^ function pluginShellFor(/p' "$shell_qml") +tr '\n\r\t' ' ' <<<"$bar_entry_shell" | + grep -Eq 'var id *= *shell\.pluginRegistry\.resolveEnabledId\( *target *\)[^}]*return shell\.pluginRegistry\.installedPlugins\[id\] *\|\| *null' || + fail "replacement-bar clone authorization does not follow the enabled implementation" +tr '\n\r\t' ' ' <<<"$bar_entry_shell" | + grep -Eq 'shell\.pluginCloneMaySummon\( *currentManifest\( *\), *requestedId *\)' || + fail "built-in clones in replacement bars cannot summon their existing auxiliary UI" qml_matches "$shell_qml" 'shell\.pluginCloneMaySummon\( *currentManifest\( *\), *requestedId *\)' || fail "built-in clones cannot summon their existing auxiliary UI" qml_matches "$shell_qml" '"omarchy\.media": *\["omarchy\.osd"\]' || diff --git a/test/shell.d/runtime-smoke-test.sh b/test/shell.d/runtime-smoke-test.sh index b44075d4..41d3b321 100755 --- a/test/shell.d/runtime-smoke-test.sh +++ b/test/shell.d/runtime-smoke-test.sh @@ -253,6 +253,17 @@ Item { return JSON.stringify({ reachable: !!service, enabled: service ? service.enabled === true : false }) } + function probeMediaWidgetSummon(): string { + var entryFacade = root.shell + && typeof root.shell.pluginShellForBarEntry === "function" + ? root.shell.pluginShellForBarEntry("probe-media", "acme.media-clone") : null + return JSON.stringify({ + entryFacade: !!entryFacade, + osdSummoned: entryFacade ? entryFacade.summon("omarchy.osd", "{}") : false, + foreignSummoned: entryFacade ? entryFacade.summon("omarchy.lock", "{}") : false + }) + } + function mutateSnapshot(): string { if (root.barConfig && root.barConfig.layout && root.barConfig.layout.left && root.barConfig.layout.left.length > 0) @@ -672,6 +683,13 @@ jq -e '.reachable == true and .enabled == true' <<<"$media_proxy_probe" >/dev/nu fail_with_log "replacement-bar service proxies resolve enabled clones" } +media_summon_probe=$(shell_ipc acme-review-bar probeMediaWidgetSummon) +jq -e '.entryFacade == true and .osdSummoned == true and .foreignSummoned == false' \ + <<<"$media_summon_probe" >/dev/null || { + printf 'Replacement-bar media summon probe: %s\n' "$media_summon_probe" >&2 + fail_with_log "replacement-bar clone facades retain only their auxiliary UI integration" +} + bar_config_before=$(shell_ipc shell listShellConfig | jq -c '.bar') shell_ipc acme-review-bar mutateSnapshot >/dev/null bar_config_after=$(shell_ipc shell listShellConfig | jq -c '.bar')