[PR #31] [MERGED] Rewrite UI codes #588

Closed
opened 2026-03-02 23:48:56 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/aome510/spotify-player/pull/31
Author: @aome510
Created: 2/26/2022
Status: Merged
Merged: 2/27/2022
Merged by: @aome510

Base: masterHead: rewrite-UI-codes


📝 Commits (10+)

  • 4ee5fc7 improve documentation for UI state structs/functions
  • f10a770 rename PageState::Searching to PageState::Search, wip remove window state
  • 1665dcb update the ui states as-in ui/mod.rs
  • e48dc74 add page ui state struct/enum for each page
  • 982fb1d wip refactor, render only search page
  • 6adad74 wip, rewrite UI states
  • 8efb7ce render the library page
  • 1e002e1 add back event global handler
  • 4099e25 request data for library page on startup
  • 27ddc66 add back event handler for library page

📊 Changes

18 files changed (+1525 additions, -1612 deletions)

View changed files

📝 spotify_player/src/client/handlers.rs (+41 -6)
📝 spotify_player/src/client/mod.rs (+11 -19)
📝 spotify_player/src/event/mod.rs (+38 -46)
spotify_player/src/event/page.rs (+286 -0)
📝 spotify_player/src/event/popup.rs (+133 -154)
📝 spotify_player/src/event/window.rs (+74 -392)
📝 spotify_player/src/main.rs (+10 -2)
📝 spotify_player/src/state/data.rs (+2 -2)
📝 spotify_player/src/state/mod.rs (+0 -22)
📝 spotify_player/src/state/model.rs (+1 -2)
spotify_player/src/state/ui.rs (+0 -395)
spotify_player/src/state/ui/mod.rs (+84 -0)
spotify_player/src/state/ui/page.rs (+338 -0)
spotify_player/src/state/ui/popup.rs (+68 -0)
spotify_player/src/ui/help.rs (+0 -125)
📝 spotify_player/src/ui/mod.rs (+92 -187)
📝 spotify_player/src/ui/page.rs (+210 -231)
📝 spotify_player/src/ui/popup.rs (+137 -29)

📄 Description

Brief description of changes

  • removed state::ui::WindowState and made it a component of state::ui::PageState
  • split state::ui module (initially a single file) into multiple smaller modules (page, popup)
  • added event::page module for handling page-scale events, made event::window for handling window-scale events
  • moved the context state update (based on page change event) logic to client::handlers::start_player_event_watchers
  • removed ui::help module and moved its help render functions to ui::popup module
  • renamed ui::window module to ui::page module
  • changed Caches::recommendations to Caches::tracks to make it more reusable
  • refactored function's signatures and logics to reduce the use of drop(ui) and redundant UI state locking

🔄 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/31 **Author:** [@aome510](https://github.com/aome510) **Created:** 2/26/2022 **Status:** ✅ Merged **Merged:** 2/27/2022 **Merged by:** [@aome510](https://github.com/aome510) **Base:** `master` ← **Head:** `rewrite-UI-codes` --- ### 📝 Commits (10+) - [`4ee5fc7`](https://github.com/aome510/spotify-player/commit/4ee5fc7f2daba397f74953b0006170ee7a656d5a) improve documentation for UI state structs/functions - [`f10a770`](https://github.com/aome510/spotify-player/commit/f10a77077ff29e04cbcf9b3cd42a12190429d928) rename `PageState::Searching` to `PageState::Search`, wip remove window state - [`1665dcb`](https://github.com/aome510/spotify-player/commit/1665dcba6414ccbe53671098a541c9888fe44200) update the ui states as-in `ui/mod.rs` - [`e48dc74`](https://github.com/aome510/spotify-player/commit/e48dc746bb15769512559751053460e3886ce34a) add page ui state struct/enum for each page - [`982fb1d`](https://github.com/aome510/spotify-player/commit/982fb1ddeb6cecb545fbc54bc0e7b8180bec90d4) wip refactor, render only search page - [`6adad74`](https://github.com/aome510/spotify-player/commit/6adad74a37ea0827b8d2891dc73e55be28402aa3) wip, rewrite UI states - [`8efb7ce`](https://github.com/aome510/spotify-player/commit/8efb7ce7b0683f469320f4ae4b4634d375f00707) render the library page - [`1e002e1`](https://github.com/aome510/spotify-player/commit/1e002e1c383412f5a5bcdb6373abf6b04bbf7db8) add back event global handler - [`4099e25`](https://github.com/aome510/spotify-player/commit/4099e2532b387b6359806a6ae560322af0efe830) request data for library page on startup - [`27ddc66`](https://github.com/aome510/spotify-player/commit/27ddc660e16cb8ff46508c557a1fdec770514782) add back event handler for library page ### 📊 Changes **18 files changed** (+1525 additions, -1612 deletions) <details> <summary>View changed files</summary> 📝 `spotify_player/src/client/handlers.rs` (+41 -6) 📝 `spotify_player/src/client/mod.rs` (+11 -19) 📝 `spotify_player/src/event/mod.rs` (+38 -46) ➕ `spotify_player/src/event/page.rs` (+286 -0) 📝 `spotify_player/src/event/popup.rs` (+133 -154) 📝 `spotify_player/src/event/window.rs` (+74 -392) 📝 `spotify_player/src/main.rs` (+10 -2) 📝 `spotify_player/src/state/data.rs` (+2 -2) 📝 `spotify_player/src/state/mod.rs` (+0 -22) 📝 `spotify_player/src/state/model.rs` (+1 -2) ➖ `spotify_player/src/state/ui.rs` (+0 -395) ➕ `spotify_player/src/state/ui/mod.rs` (+84 -0) ➕ `spotify_player/src/state/ui/page.rs` (+338 -0) ➕ `spotify_player/src/state/ui/popup.rs` (+68 -0) ➖ `spotify_player/src/ui/help.rs` (+0 -125) 📝 `spotify_player/src/ui/mod.rs` (+92 -187) 📝 `spotify_player/src/ui/page.rs` (+210 -231) 📝 `spotify_player/src/ui/popup.rs` (+137 -29) </details> ### 📄 Description ## Brief description of changes - removed `state::ui::WindowState` and made it a component of `state::ui::PageState` - split `state::ui` module (initially a single file) into multiple smaller modules (`page`, `popup`) - added `event::page` module for handling page-scale events, made `event::window` for handling window-scale events - moved the context state update (based on page change event) logic to `client::handlers::start_player_event_watchers` - removed `ui::help` module and moved its help render functions to `ui::popup` module - renamed `ui::window` module to `ui::page` module - changed `Caches::recommendations` to `Caches::tracks` to make it more reusable - refactored function's signatures and logics to reduce the use of `drop(ui)` and redundant UI state locking --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:48:56 +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#588
No description provided.