[PR #823] [MERGED] Fix: Move fuzzy_search_items to utils to resolve #820 #891

Closed
opened 2026-03-03 00:01:19 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/aome510/spotify-player/pull/823
Author: @Dragonfly911117
Created: 9/1/2025
Status: Merged
Merged: 9/1/2025
Merged by: @aome510

Base: masterHead: fix-fzf


📝 Commits (3)

  • 1945616 Fix: Move fuzzy_search_items to utils to resolve #820
  • 05117be add fzf to ci build
  • f1522b8 Misc: Remove a redundant newline in utils.rs

📊 Changes

3 files changed (+20 additions, -19 deletions)

View changed files

📝 .github/workflows/ci.yml (+1 -1)
📝 spotify_player/src/state/ui/mod.rs (+0 -18)
📝 spotify_player/src/utils.rs (+19 -0)

📄 Description

  • Relocated fuzzy_search_items from ui::mod.rs to utils.rs for the caller has been moved.

  • Decoupled ratatui::layout::Rect import (state/ui/mod.rs:100) from the fzf feature gate since the dependent code(UIState::default()) does not rely on fzf.

  • Fixes #820

  • Fixes #822

Beside the issues mentioned, this patch also fixes building without fzf feature would fail due to ratatui::layout::Rect requiring fzf to be imported and UIState::default() was using it. The failing build log would look like

> cargo run --bin spotify_player --no-default-features --features pulseaudio-backend,streaming,sixel,notify,daemon,media-control

=== bunch of log ===

error[E0433]: failed to resolve: use of undeclared type `Rect`
   --> spotify_player/src/state/ui/mod.rs:121:41
    |
121 |             playback_progress_bar_rect: Rect::default(),
    |                                         ^^^^ use of undeclared type `Rect`
    |
    = note: struct `crate::ui::utils::Rect` exists but is inaccessible
help: consider importing one of these structs
    |
1   + use image::math::Rect;
    |
1   + use ratatui::prelude::Rect;
    |

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/aome510/spotify-player/pull/823 **Author:** [@Dragonfly911117](https://github.com/Dragonfly911117) **Created:** 9/1/2025 **Status:** ✅ Merged **Merged:** 9/1/2025 **Merged by:** [@aome510](https://github.com/aome510) **Base:** `master` ← **Head:** `fix-fzf` --- ### 📝 Commits (3) - [`1945616`](https://github.com/aome510/spotify-player/commit/1945616b88059bc2b934731e12aa5c86d8fe7ef8) Fix: Move `fuzzy_search_items` to `utils` to resolve #820 - [`05117be`](https://github.com/aome510/spotify-player/commit/05117be889b97d38ae10794d4bfccd2091bfdfe3) add fzf to ci build - [`f1522b8`](https://github.com/aome510/spotify-player/commit/f1522b82f57cc9c544c5581f108dcc35da146d30) Misc: Remove a redundant newline in `utils.rs` ### 📊 Changes **3 files changed** (+20 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+1 -1) 📝 `spotify_player/src/state/ui/mod.rs` (+0 -18) 📝 `spotify_player/src/utils.rs` (+19 -0) </details> ### 📄 Description - Relocated `fuzzy_search_items` from `ui::mod.rs` to `utils.rs` for the caller has been moved. - Decoupled `ratatui::layout::Rect` import (`state/ui/mod.rs:100`) from the `fzf` feature gate since the dependent code(UIState::default()) does not rely on `fzf`. - Fixes #820 - Fixes #822 Beside the issues mentioned, this patch also fixes building without `fzf` feature would fail due to `ratatui::layout::Rect` requiring `fzf` to be imported and `UIState::default()` was using it. The failing build log would look like ```text > cargo run --bin spotify_player --no-default-features --features pulseaudio-backend,streaming,sixel,notify,daemon,media-control === bunch of log === error[E0433]: failed to resolve: use of undeclared type `Rect` --> spotify_player/src/state/ui/mod.rs:121:41 | 121 | playback_progress_bar_rect: Rect::default(), | ^^^^ use of undeclared type `Rect` | = note: struct `crate::ui::utils::Rect` exists but is inaccessible help: consider importing one of these structs | 1 + use image::math::Rect; | 1 + use ratatui::prelude::Rect; | ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 00:01:19 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-player#891
No description provided.