[PR #12] [MERGED] [#10] Refactor terminal event handling codes #574

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

📋 Pull Request Information

Original PR: https://github.com/aome510/spotify-player/pull/12
Author: @aome510
Created: 10/9/2021
Status: Merged
Merged: 10/9/2021
Merged by: @aome510

Base: masterHead: event-codes-cleanup


📝 Commits (10+)

  • 26a2a40 create a event folder module
  • 5f54c74 clean up the imports inside the event module
  • d51bb99 move popup shortcut handling codes to event/popup.rs
  • d3858e2 small clean up popup.rs code
  • bd82b03 move shortcut handling codes for windows to event/window.rs
  • dee0a20 clean up window.rs
  • 4763e8a small clean up
  • 51094d9 fix errors in ui/popup.rs
  • 5502107 fix the incorrect order of handling select next/previous commands
  • f9f2973 cleanup

📊 Changes

9 files changed (+1253 additions, -1167 deletions)

View changed files

spotify_player/src/event.rs (+0 -1038)
spotify_player/src/event/mod.rs (+268 -0)
spotify_player/src/event/popup.rs (+332 -0)
spotify_player/src/event/window.rs (+485 -0)
📝 spotify_player/src/key.rs (+13 -1)
📝 spotify_player/src/state/ui.rs (+5 -6)
📝 spotify_player/src/ui/help.rs (+1 -1)
📝 spotify_player/src/ui/popup.rs (+147 -119)
📝 spotify_player/src/utils.rs (+2 -2)

📄 Description

Part 2 of #10

Brief description of changes

  • separate the event handling logics into multiple files event/mod.rs, event/popup.rs, event/window.rs
    • event/mod.rs to parse/handle the terminal event in general
    • event/popup.rs to handle event for popups
    • event/window.rs to handle event for windows
  • refactor handling codes, rename functions, etc
  • add more documentations and comments

🔄 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/12 **Author:** [@aome510](https://github.com/aome510) **Created:** 10/9/2021 **Status:** ✅ Merged **Merged:** 10/9/2021 **Merged by:** [@aome510](https://github.com/aome510) **Base:** `master` ← **Head:** `event-codes-cleanup` --- ### 📝 Commits (10+) - [`26a2a40`](https://github.com/aome510/spotify-player/commit/26a2a40a7a0a7d481aaff9cd75a280c16a325315) create a `event` folder module - [`5f54c74`](https://github.com/aome510/spotify-player/commit/5f54c7429405ce4c82dcf25d2ac571be8d5ab411) clean up the imports inside the event module - [`d51bb99`](https://github.com/aome510/spotify-player/commit/d51bb99ecbd9b10829fc06e74b1f2371e4fcf8f4) move popup shortcut handling codes to `event/popup.rs` - [`d3858e2`](https://github.com/aome510/spotify-player/commit/d3858e28f9ce5a6e20bb817fc548424fe875376b) small clean up `popup.rs` code - [`bd82b03`](https://github.com/aome510/spotify-player/commit/bd82b0371489b3b048cf5c0b1ecca8babc59a8b7) move shortcut handling codes for windows to `event/window.rs` - [`dee0a20`](https://github.com/aome510/spotify-player/commit/dee0a204e3d4be0f16a4c1c1c6cc1b2c5ba94e6e) clean up `window.rs` - [`4763e8a`](https://github.com/aome510/spotify-player/commit/4763e8a5b1872fc23b83f2fb03d40cebb17fd608) small clean up - [`51094d9`](https://github.com/aome510/spotify-player/commit/51094d9d239b89e3b1ed0755919c1ed6382175b1) fix errors in `ui/popup.rs` - [`5502107`](https://github.com/aome510/spotify-player/commit/5502107d2d2d95aeb3c00b7ded5570cc90a4b266) fix the incorrect order of handling select next/previous commands - [`f9f2973`](https://github.com/aome510/spotify-player/commit/f9f29733b0368a097821438d630362edd019b866) cleanup ### 📊 Changes **9 files changed** (+1253 additions, -1167 deletions) <details> <summary>View changed files</summary> ➖ `spotify_player/src/event.rs` (+0 -1038) ➕ `spotify_player/src/event/mod.rs` (+268 -0) ➕ `spotify_player/src/event/popup.rs` (+332 -0) ➕ `spotify_player/src/event/window.rs` (+485 -0) 📝 `spotify_player/src/key.rs` (+13 -1) 📝 `spotify_player/src/state/ui.rs` (+5 -6) 📝 `spotify_player/src/ui/help.rs` (+1 -1) 📝 `spotify_player/src/ui/popup.rs` (+147 -119) 📝 `spotify_player/src/utils.rs` (+2 -2) </details> ### 📄 Description Part 2 of #10 **Brief description of changes** - separate the event handling logics into multiple files `event/mod.rs`, `event/popup.rs`, `event/window.rs` - `event/mod.rs` to parse/handle the terminal event in general - `event/popup.rs` to handle event for popups - `event/window.rs` to handle event for windows - refactor handling codes, rename functions, etc - add more documentations and comments --- <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:52 +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#574
No description provided.