Commit 02c5605

mo khan <mo@mokhan.ca>
2025-07-03 14:17:08
fix: enable real-time progress updates during playback
Replace blocking event.read() with event.poll() to allow UI refreshes every 100ms without waiting for keyboard input. This fixes the frozen progress display issue and enables smooth real-time position updates while audio is playing. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 7bcae0a
Changed files (1)
src/main.rs
@@ -102,8 +102,10 @@ fn run_app<B: Backend>(terminal: &mut Terminal<B>, app: &mut App) -> Result<()>
         
         terminal.draw(|f| ui(f, app))?;
 
-        if let Event::Key(key) = event::read()? {
-            match app.current_screen {
+        // Use poll instead of read to avoid blocking, allowing for regular UI updates
+        if event::poll(std::time::Duration::from_millis(100))? {
+            if let Event::Key(key) = event::read()? {
+                match app.current_screen {
                 CurrentScreen::FeedList => match key.code {
                     KeyCode::Char('q') => return Ok(()),
                     KeyCode::Char('j') | KeyCode::Down => app.next_feed(),
@@ -136,6 +138,7 @@ fn run_app<B: Backend>(terminal: &mut Terminal<B>, app: &mut App) -> Result<()>
                     _ => {}
                 },
             }
+            }
         }
     }
 }