Preserve clone summons in replacement bars
Co-Authored-By: GPT-5.6-Sol <noreply@openai.com>
This commit is contained in:
1 parent
3292c19fef
commit
23aeb4c670
3 files changed
+33
-2
No files matched your search
+8
-2
@@ -683,12 +683,18 @@ ShellRoot {
|
|||||||
=== shell.pluginRegistry.resolveEnabledId(target)
|
=== shell.pluginRegistry.resolveEnabledId(target)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function currentManifest() {
|
||||||
|
var id = shell.pluginRegistry.resolveEnabledId(target)
|
||||||
|
return shell.pluginRegistry.installedPlugins[id] || null
|
||||||
|
}
|
||||||
|
|
||||||
var api = pluginShellApiComponent.createObject(null, {
|
var api = pluginShellApiComponent.createObject(null, {
|
||||||
pluginId: target,
|
pluginId: target,
|
||||||
barConfig: shell.publicBarConfig(),
|
barConfig: shell.publicBarConfig(),
|
||||||
_summon: function(requestedId, payloadJson) {
|
_summon: function(requestedId, payloadJson) {
|
||||||
return owns(requestedId)
|
if (!owns(requestedId)
|
||||||
? shell.summon(shell.pluginRegistry.resolveEnabledId(target), payloadJson) : false
|
&& !shell.pluginCloneMaySummon(currentManifest(), requestedId)) return false
|
||||||
|
return shell.summon(shell.pluginRegistry.resolveEnabledId(requestedId), payloadJson)
|
||||||
},
|
},
|
||||||
_hide: function(requestedId) {
|
_hide: function(requestedId) {
|
||||||
return owns(requestedId)
|
return owns(requestedId)
|
||||||
|
|||||||
@@ -130,6 +130,13 @@ qml_matches "$shell_qml" 'shellApi\.idleConfig *= *shell\.publicIdleConfigFor\(
|
|||||||
fail "cloned idle service configuration does not refresh"
|
fail "cloned idle service configuration does not refresh"
|
||||||
qml_matches "$idle_service" 'shell *&& *shell\.idleConfig *\? *shell\.idleConfig *: *\(\{\}\)' ||
|
qml_matches "$idle_service" 'shell *&& *shell\.idleConfig *\? *shell\.idleConfig *: *\(\{\}\)' ||
|
||||||
fail "the idle service does not consume its scoped configuration"
|
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 *\)' ||
|
qml_matches "$shell_qml" 'shell\.pluginCloneMaySummon\( *currentManifest\( *\), *requestedId *\)' ||
|
||||||
fail "built-in clones cannot summon their existing auxiliary UI"
|
fail "built-in clones cannot summon their existing auxiliary UI"
|
||||||
qml_matches "$shell_qml" '"omarchy\.media": *\["omarchy\.osd"\]' ||
|
qml_matches "$shell_qml" '"omarchy\.media": *\["omarchy\.osd"\]' ||
|
||||||
|
|||||||
@@ -253,6 +253,17 @@ Item {
|
|||||||
return JSON.stringify({ reachable: !!service, enabled: service ? service.enabled === true : false })
|
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 {
|
function mutateSnapshot(): string {
|
||||||
if (root.barConfig && root.barConfig.layout
|
if (root.barConfig && root.barConfig.layout
|
||||||
&& root.barConfig.layout.left && root.barConfig.layout.left.length > 0)
|
&& 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"
|
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')
|
bar_config_before=$(shell_ipc shell listShellConfig | jq -c '.bar')
|
||||||
shell_ipc acme-review-bar mutateSnapshot >/dev/null
|
shell_ipc acme-review-bar mutateSnapshot >/dev/null
|
||||||
bar_config_after=$(shell_ipc shell listShellConfig | jq -c '.bar')
|
bar_config_after=$(shell_ipc shell listShellConfig | jq -c '.bar')
|
||||||
|
|||||||
Reference in new issue
Block a user