Emit bread.help.opened when the main window is shown
All checks were successful
dev release / build (push) Successful in 2m4s

Fail-silent via bread-utils BreadClient (ecosystem v0.7.1, bread-client).
No command verbs. Silent autostart and screenshot mode do not emit.
This commit is contained in:
Breadway 2026-08-15 22:16:30 +08:00
parent 3634edef0d
commit c9445fadcc
6 changed files with 90 additions and 6 deletions

View file

@ -63,7 +63,7 @@ pub fn present(app: &Application, action: Action) {
// (i.e. breadhelp wasn't already running) — a background daemon
// event shouldn't steal focus from whatever the user is doing.
if just_built {
handle.window.present();
show_window(&handle.window, action.autostart);
}
return;
}
@ -77,11 +77,19 @@ pub fn present(app: &Application, action: Action) {
}
let silent_autostart = action.autostart && State::load().onboarding_completed();
if !silent_autostart {
handle.window.present();
show_window(&handle.window, action.autostart);
}
});
}
/// Present the help window and publish `bread.help.opened`. Screenshot
/// mode calls `window.present()` itself and must not go through here —
/// that is capture, not a user-visible open.
fn show_window(window: &ApplicationWindow, autostart: bool) {
window.present();
crate::services::breadd::emit_opened(autostart);
}
fn build(app: &Application) -> Handle {
// First thing on every cold start: revert any keybind a previous,
// crashed run may have left temporarily rebound mid tour-step (see