Repository: aome510/spotify-player (language: rust)

Issue:
Glitchy image album cover image behavior in kitty Mac OS
**Describe the bug**
Album cover image rendering is glitchy in kitty (the terminal app) running on Mac OS:
- image is stretched
- image dupes and stacks at bottom left of the screen when you navigate to help screen `?`

Of note is that this works fine in iterm2 (and maybe most terminal emulators?) 
I suppose this might be a bug in kitty? difference in how images are cleaned up between screens?

**To Reproduce**
Open any song with album art and notice image is stretched. Press `?` to open help screen and 

**Expected behaviour**
Image should appear and disappear as expected and should be scaled appropriately. 

**Screenshots**
<img width="174" alt="image" src="https://github.com/aome510/spotify-player/assets/848652/7051d7fc-d791-469e-817e-e879737c70f9">


**Environment**

- OS: MacOS 14.3.1
- Application version: 0.17.1
- Kitty version: 0.33.1



Discussion / hints:
@fuzetsu thanks for reporting. Can confirm this issue also happens to me with `image` on `iterm2`. I didn't notice this issue as I don't really use `?` for help page nowadays 😅 .

Fix patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0b4d1932..41151b6a 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -19,9 +19,6 @@ jobs:
       matrix:
         os: [macOS-latest, windows-latest, ubuntu-latest]
         toolchain: [stable]
-        include:
-          - os: ubuntu-latest
-            toolchain: beta
 
     runs-on: ${{ matrix.os }}
 
@@ -61,4 +58,3 @@ jobs:
 
       - name: Cargo clippy without features
         run: cargo clippy --no-default-features -- -D warnings
-
diff --git a/spotify_player/src/ui/mod.rs b/spotify_player/src/ui/mod.rs
index 66b9ca45..9e2e8ccc 100644
--- a/spotify_player/src/ui/mod.rs
+++ b/spotify_player/src/ui/mod.rs
@@ -88,15 +88,17 @@ fn render_application(
     ui: &mut UIStateGuard,
     rect: Rect,
 ) -> Result<()> {
-    // rendering order: help popup -> other popups -> playback window -> main layout
+    // rendering order: shortcut help popup -> playback window -> other popups -> main layout
 
     let rect = popup::render_shortcut_help_popup(frame, state, ui, rect);
 
-    let (rect, is_active) = popup::render_popup(frame, state, ui, rect);
-
+    // render playback window before other popups to ensure no popup is rendered on top
+    // of the playback window
     let (playback_rect, rect) = playback::split_rect_for_playback_window(rect, state);
     playback::render_playback_window(frame, state, ui, playback_rect)?;
 
+    let (rect, is_active) = popup::render_popup(frame, state, ui, rect);
+
     render_main_layout(is_active, frame, state, ui, rect)?;
     Ok(())
 }
diff --git a/spotify_player/src/ui/popup.rs b/spotify_player/src/ui/popup.rs
index 4ce88887..898db69d 100644
--- a/spotify_player/src/ui/popup.rs
+++ b/spotify_player/src/ui/popup.rs
@@ -82,20 +82,12 @@ pub fn render_popup(
                 (chunks[0], true)
             }
             PopupState::CommandHelp { .. } => {
-                // the command help popup will cover the entire main layout
-                let chunks =
-                    Layout::vertical([Constraint::Fill(0), Constraint::Length(0)]).split(rect);
-
-                render_commands_help_popup(frame, state, ui, chunks[0]);
-                (chunks[1], false)
+                render_commands_help_popup(frame, state, ui, rect);
+                (Rect::default(), false)
             }
             PopupState::Queue { .. } => {
-                // the queue popup will cover the entire main layout
-                let chunks =
-                    Layout::vertical([Constraint::Fill(0), Constraint::Length(0)]).split(rect);
-
-                render_queue_popup(frame, state, ui, chunks[0]);
-                (chunks[1], false)
+                render_queue_popup(frame, state, ui, rect);
+                (Rect::default(), false)
             }
             PopupState::ActionList(item, _) => {
                 let rect = render_list_popup(


Test patch: