From 6c4df8813cd563174e6075a1cba0cf999ddee2cd Mon Sep 17 00:00:00 2001 From: Breadway Date: Tue, 25 Aug 2026 12:04:43 +0800 Subject: [PATCH] capsule: accept the open event breadbox can actually emit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An app may only publish inside its own bread..* namespace, so breadbox (app id 'box') cannot emit bread.command.box.open — bread-client refuses it and the redirect did nothing but log a warning. The capsule now also subscribes to bread.box.open_requested, which is what breadbox emits. bread.command.box.open is kept as well: that is the addressed-to-an-app command form an external trigger (the bread CLI, a keybind, another app) would legitimately send, so the capsule opens whether it was asked directly or told by breadbox. --- src/launcher_command.rs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/launcher_command.rs b/src/launcher_command.rs index 4d47560..798f5ec 100644 --- a/src/launcher_command.rs +++ b/src/launcher_command.rs @@ -32,8 +32,22 @@ pub fn spawn(sender: ComponentSender) { return; } let client = BreadClient::connect(crate::widgets::client::APP_ID); - let subscription = client.subscribe("bread.command.box.open", move |_event| { - sender.input(AppInput::OpenLauncher); - }); - std::mem::forget(subscription); + // Two verbs, deliberately. + // + // `bread.box.open_requested` is what breadbox actually emits when the + // active theme is embedded: an app may only publish inside its own + // `bread..*` namespace, so breadbox (app id `box`) cannot emit a + // `bread.command.*` event at all — bread-client refuses it outright. + // + // `bread.command.box.open` is kept because it is the addressed-TO-an-app + // command form, which is what an external trigger (the `bread` CLI, a + // keybind, another app) would legitimately send. Honouring both means the + // capsule opens whether it was asked directly or told by breadbox. + for verb in ["bread.box.open_requested", "bread.command.box.open"] { + let sender = sender.clone(); + let subscription = client.subscribe(verb, move |_event| { + sender.input(AppInput::OpenLauncher); + }); + std::mem::forget(subscription); + } }