ommp.git

ommp

~ Oh My Music Player — a standalone terminal music player built with Rust and ratatui
git clone https://github.com/debuman/ommp.git
commit 25db58e89789322ca2be5a7e91aecc5573e4e7a0
parent 9e51afb3605b901755bcad54865dded790170e76
Author: sqzer-x <110329244+sqzer-x@users.noreply.github.com>
Date: Sat, 1 Aug 2026 17:20:26 +0900

Let the splash always play its full timeline

Cutting the hold short when the scan finished saved about a second of
startup, but the animation is there to be watched, not to fill time. The
timeline is fixed again at half a second of fade-in, a hold, and half a
second of fade-out.

A keypress still skips ahead to the fade-out, which it always did.

Starting the scan before the terminal query and the audio device open is
kept: it costs nothing and only means the library is ready sooner behind the
animation.

Diffstat:
Msrc/main.rs | 5-----
Msrc/ui/mod.rs | 11+++++------
2 files changed, 5 insertion(+), 11 deletion(-)

diff --git a/src/main.rs b/src/main.rs
@@ -175,11 +175,6 @@ fn run_app(terminal: &mut Terminal<CrosstermBackend<io::Stdout>>) -> Result<()>
                                 scan_done = true;
                                 app.initial_scan_complete = true;
                                 dirty = true;
-                                // The splash exists to cover the scan. With the
-                                // cache that takes tens of milliseconds, so
-                                // sitting through the rest of a fixed two-second
-                                // timeline is the whole startup wait.
-                                ui.begin_splash_fade_out();
                                 _watcher = library::watcher::spawn_watcher(&music_dir, event_tx.clone());
                             }
                             Err(_) => {
diff --git a/src/ui/mod.rs b/src/ui/mod.rs
@@ -20,7 +20,7 @@ use panes::track_info_pane::TrackInfoPane;
 use panes::queue_pane::QueuePane;
 
 /// Splash timeline, in seconds: fade in, hold, then fade out until the end.
-/// The hold is skipped as soon as the library is ready.
+/// Always played in full — the scan runs behind it and does not cut it short.
 pub const SPLASH_FADE_IN: f32 = 0.5;
 pub const SPLASH_FADE_OUT_AT: f32 = 1.5;
 pub const SPLASH_END: f32 = 2.0;
@@ -136,8 +136,8 @@ impl Ui {
     }
 
     /// Skip the splash forward to the start of its fade-out, if it has not got
-    /// there already. Used when the scan finishes and when a key is pressed —
-    /// the animation still completes, it just stops holding.
+    /// there already. Only a keypress does this: the timeline is otherwise
+    /// fixed, and the fade-out still plays so the skip is not a hard cut.
     pub fn begin_splash_fade_out(&mut self) {
         if !self.show_splash {
             return;
@@ -319,15 +319,14 @@ mod tests {
     }
 
     #[test]
-    fn finishing_the_scan_skips_the_splash_hold() {
+    fn a_keypress_skips_the_splash_hold() {
         let mut ui = ui();
         assert!(ui.show_splash);
         assert!(elapsed(&ui) < SPLASH_FADE_OUT_AT);
 
         ui.begin_splash_fade_out();
 
-        // Straight to the fade-out rather than sitting through the hold, which
-        // with a warm cache is the entire startup wait.
+        // Straight to the fade-out rather than sitting through the hold.
         assert!(elapsed(&ui) >= SPLASH_FADE_OUT_AT);
         assert!(elapsed(&ui) < SPLASH_END, "the fade-out still plays");
     }