From a14902dcb0760ab64aaedab714e4525ffbe70206 Mon Sep 17 00:00:00 2001 From: oiupoyt Date: Sun, 4 Oct 2026 12:12:29 +0530 Subject: [PATCH] feat(ui): implement in-overlay toast animation engine and overhaul standalone toasts --- src/overlay_egui.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/overlay_egui.rs b/src/overlay_egui.rs index ce06b03..3c8828d 100644 --- a/src/overlay_egui.rs +++ b/src/overlay_egui.rs @@ -1270,6 +1270,13 @@ impl ScytheOverlayApp { } pub fn show_hud_notification(&mut self, title: &str, subtitle: &str, icon: crate::overlay::ToastIcon) { + self.in_overlay_toast = Some(InOverlayToast { + title: title.to_string(), + subtitle: subtitle.to_string(), + icon, + created_at: Instant::now(), + duration: Duration::from_millis(2800), + }); self.hud_notification = Some(HudNotification { title: title.to_string(), subtitle: subtitle.to_string(), @@ -3671,4 +3678,15 @@ mod tests { assert!(pos_y + modal_h <= screen_h); } } + + #[test] + fn test_cubic_ease_out_progress() { + let ease_out = |t: f32| -> f32 { + let inv = 1.0 - t.clamp(0.0, 1.0); + 1.0 - inv * inv * inv + }; + assert_eq!(ease_out(0.0), 0.0); + assert_eq!(ease_out(1.0), 1.0); + assert!(ease_out(0.5) > 0.5); // Fast start, gentle deceleration + } }