fix(tui/animation): ensure intro logo visibly completes without perf cost

- Remove per-frame debug log in intro renderer
- Delay internal fade to last ~2% and force final frame vivid
- Defer any fade-out to AnimatedWelcomeCell alpha blending

Keeps animation smooth and visually complete on all terminals.
This commit is contained in:
James Peter
2025-09-05 08:17:03 +10:00
parent 7577fe4b60
commit 7fb2815445
+11 -3
View File
@@ -5,7 +5,8 @@ use ratatui::widgets::Widget;
// Render the outline-fill animation
pub fn render_intro_animation(area: Rect, buf: &mut Buffer, t: f32) {
tracing::debug!("render_intro_animation called: area={:?}, t={}", area, t);
// Avoid per-frame debug logging here to keep animation smooth.
// (Heavy logging can starve the render loop on slower terminals.)
render_intro_outline_fill(area, buf, t)
}
@@ -31,7 +32,10 @@ pub fn render_intro_outline_fill(area: Rect, buf: &mut Buffer, t: f32) {
let t = t.clamp(0.0, 1.0);
let outline_p = smoothstep(0.00, 0.60, t); // outline draws L->R
let fill_p = smoothstep(0.35, 0.95, t); // interior fills L->R
let fade = smoothstep(0.90, 1.00, t); // vibrant -> muted gray
// Keep the animation vivid until the very end. Only begin a subtle fade in
// the last ~2% of progress, and render the final frame fully bright.
let mut fade = smoothstep(0.98, 1.00, t);
if (t - 1.0).abs() < 1e-6 { fade = 0.0; }
let scan_p = smoothstep(0.55, 0.85, t); // scanline sweep
let frame = (t * 60.0) as u32;
@@ -91,7 +95,11 @@ pub fn render_intro_outline_fill_with_alpha(area: Rect, buf: &mut Buffer, t: f32
let alpha = alpha.clamp(0.0, 1.0);
let outline_p = smoothstep(0.00, 0.60, t); // outline draws L->R
let fill_p = smoothstep(0.35, 0.95, t); // interior fills L->R
let fade = smoothstep(0.90, 1.00, t); // vibrant -> muted gray
// Match the non-alpha path: keep vivid until the end and avoid dimming the
// terminal-stable final frame. Any longer fade-out is handled by the caller
// (AnimatedWelcomeCell) using alpha blending.
let mut fade = smoothstep(0.98, 1.00, t);
if (t - 1.0).abs() < 1e-6 { fade = 0.0; }
let scan_p = smoothstep(0.55, 0.85, t); // scanline sweep
let frame = (t * 60.0) as u32;