diff --git a/crates/ui-widgets/src/notices/center.rs b/crates/ui-widgets/src/notices/center.rs index 3c87aa6ad..015e4cdb7 100644 --- a/crates/ui-widgets/src/notices/center.rs +++ b/crates/ui-widgets/src/notices/center.rs @@ -117,11 +117,15 @@ impl NoticeCenter { NoticeCenter { window: WindowKey::main(), timeout: Some(toast::TIMEOUT) } } - /// Posts `notice` to the center's window in the running viewport; `None` when its dismiss key is in `silenced`. + /// Posts `notice` to the center's window in the running viewport; `None` when its dismiss key is in `silenced`, and + /// in a measuring run, which posts nothing and tracks nothing (the real run posts it). pub fn post(&self, ctx: &Context, notice: &PostedNotice, silenced: &[String]) -> Option { if notice.dismiss_key.as_ref().is_some_and(|key| silenced.contains(key)) { return None; } + if !crate::runtime::measure::effect(ctx, "notices::post") { + return None; + } let politeness = if notice.tone == Tone::Bad { Politeness::Assertive } else { Politeness::Polite }; let timeout = if notice.sticky { None } else { self.timeout }; let mut card = Toast::new(Label::Empty).title(notice.title.clone()).lines(notice.lines.clone());