From c8d5ca548df81f6b3fe09cc69acaac99809fe338 Mon Sep 17 00:00:00 2001 From: forkless Date: Sun, 31 May 2026 20:27:00 +0200 Subject: [PATCH] Whale always patrols bottom row, not just during scans --- src/tui.rs | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/src/tui.rs b/src/tui.rs index 4b3baf1..5e9c4a3 100644 --- a/src/tui.rs +++ b/src/tui.rs @@ -38,6 +38,7 @@ pub struct AppState { /// Spinner state pub spinner_active: bool, pub spinner_start: Option, + pub whale_start: Instant, } #[derive(Clone, Copy, PartialEq)] @@ -63,6 +64,7 @@ impl Default for AppState { status_style: StatusStyle::Neutral, spinner_active: false, spinner_start: None, + whale_start: Instant::now(), } } } @@ -123,12 +125,8 @@ pub fn draw_main_menu(f: &mut Frame, state: &mut ListState, app: &AppState, save let prompt = "↑/↓ navigate Enter select"; draw_select_list(f, chunks[2], &items, &descs, prompt, state); - // Whale patrols the status bar when spinner is active - if app.spinner_active { - draw_whale_separator(f, chunks[3], app); - } else { - draw_status_bar(f, chunks[3], app); - } + // Whale always patrols the bottom row + draw_whale_separator(f, chunks[3], app); } /// Draw the disclaimer popup with full warning text. @@ -616,25 +614,21 @@ fn draw_whale_separator(f: &mut Frame, area: Rect, app: &AppState) { Paragraph::new(Span::styled(sep, Style::default().fg(Color::DarkGray))), area, ); - if app.spinner_active { - if let Some(start) = app.spinner_start { - let elapsed = start.elapsed().as_millis() as u64; - let bar_w = area.width as u64; - let speed_ms: u64 = 60; - let cooldown_ticks: u64 = 166; - let total = bar_w + cooldown_ticks; - let t = (elapsed / speed_ms) % total; - if t < bar_w { - let x = bar_w - t - 1; - let switch = ((elapsed / 400) * 7 + (elapsed / 600) * 13) % 2; - let variants: &[&str] = &["🐋", "🐳"]; - let whale = variants[(switch % variants.len() as u64) as usize]; - f.render_widget( - Paragraph::new(Span::styled(whale, Style::default().fg(Color::Cyan))), - Rect { x: area.x + (x as u16), y: area.y, width: 4, height: 1 }, - ); - } - } + let elapsed = app.whale_start.elapsed().as_millis() as u64; + let bar_w = area.width as u64; + let speed_ms: u64 = 60; + let cooldown_ticks: u64 = 166; + let total = bar_w + cooldown_ticks; + let t = (elapsed / speed_ms) % total; + if t < bar_w { + let x = bar_w - t - 1; + let switch = ((elapsed / 400) * 7 + (elapsed / 600) * 13) % 2; + let variants: &[&str] = &["🐋", "🐳"]; + let whale = variants[(switch % variants.len() as u64) as usize]; + f.render_widget( + Paragraph::new(Span::styled(whale, Style::default().fg(Color::Cyan))), + Rect { x: area.x + (x as u16), y: area.y, width: 4, height: 1 }, + ); } }