Merge branch 'red/p2fw' into fw/mac1

This commit is contained in:
aiongg
2026-11-17 06:17:59 +00:00
+5 -1
View File
@@ -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<ToastId> {
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());