From 1cdfdad757c9cabf7b962901224865cfbab54f88 Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 17 Nov 2026 06:13:28 +0000 Subject: [PATCH] NoticeCenter posts and tracks nothing in a measuring run --- crates/ui-widgets/src/notices/center.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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());