[PR #635] WIP: Improve results paging #943

Open
opened 2026-02-28 14:53:54 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Rigellute/spotify-tui/pull/635
Author: @sputnick1124
Created: 10/26/2020
Status: 🔄 Open

Base: masterHead: improve-results-paging


📝 Commits (10+)

  • e56b5b6 stub out paging types
  • 471aa9c Merge branch 'master' into improve-results-paging
  • a3fb7f3 Merge branch 'master' into improve-results-paging
  • 9850c96 WIP: paging experiment, really ugly still
  • 3f1ef60 Move paging to its own module (massive commit)
  • a9876b9 Minor fixup to new paging interface
  • 896edb3 wire in channel for ui updates
  • b93fa86 make app.dispatch immutable
  • 5474521 make app.dispatch immutable
  • 59182b2 send more ui window info

📊 Changes

16 files changed (+951 additions, -942 deletions)

View changed files

📝 src/app.rs (+85 -185)
📝 src/handlers/album_list.rs (+14 -44)
📝 src/handlers/album_tracks.rs (+11 -13)
📝 src/handlers/artist.rs (+1 -1)
📝 src/handlers/artists.rs (+8 -43)
📝 src/handlers/common_key_events.rs (+32 -11)
📝 src/handlers/episode_table.rs (+19 -46)
📝 src/handlers/input.rs (+1 -1)
📝 src/handlers/made_for_you.rs (+12 -45)
📝 src/handlers/mod.rs (+3 -2)
📝 src/handlers/search_results.rs (+2 -2)
📝 src/handlers/track_table.rs (+167 -375)
📝 src/main.rs (+1 -0)
📝 src/network.rs (+189 -121)
src/paging.rs (+237 -0)
📝 src/ui/mod.rs (+169 -53)

📄 Description

I've been doing quite bit of work on trying to unify the paging interface and behavior the past couple of weekends. This is still very much a work in progress, but I would love to get some feedback from other developers if you think the current path might make things better.

Three are a few things that are a little more complicated than I would like them to be, but the functionality is shaping up to be what I envisioned.

Currently, I have only implemented paging for for the podcast episode view, but now that it is working, I should be able to implement the same for all of the library items as well pretty easily. Then I can move on to playlists and albums.

It's a bit late here right now, so I will update this description with a to-do list in the coming days to track progress. Also, I'm aware of the falling CI checks, those will be fixed before this is ready for complete review.

TODO:

Page all the things

TrackTable (delegate track context management to the type system via type aliases?)

  • MyPlaylists
  • AlbumSearch
  • PlaylistSearch
  • SavedTracks
  • RecommendedTracks
  • MadeForYou

Search results

  • Albums
  • Artists
  • Tracks
  • Playlists
  • Podcasts

Library Collections

  • Saved artists
  • Saved albums
  • Saved tracks
  • Made for you
  • Podcasts

Misc

  • User playlists

Other

  • Library podcasts view (needs to happen before we can page results)

Call to action

Please review the changes at any point. This PR represents a massive change to how we are handling almost every list of items in the app; I'd like to get it right so we aren't plagued with issues in the future.

Also, let me know if there is any thing that is currently not being paged that is eligible for paging that is not captured in the to-do list above.

If anyone would like to help out, much of the work could be done in parallel from here, I think. Let me know and we can coordinate. We could either work on my fork directly, or we could target a feature branch here.


🔄 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/Rigellute/spotify-tui/pull/635 **Author:** [@sputnick1124](https://github.com/sputnick1124) **Created:** 10/26/2020 **Status:** 🔄 Open **Base:** `master` ← **Head:** `improve-results-paging` --- ### 📝 Commits (10+) - [`e56b5b6`](https://github.com/Rigellute/spotify-tui/commit/e56b5b6b92e5f1f8ae07f3890e56317d03504ccb) stub out paging types - [`471aa9c`](https://github.com/Rigellute/spotify-tui/commit/471aa9cc0b045239f3930592df6c917ca0775744) Merge branch 'master' into improve-results-paging - [`a3fb7f3`](https://github.com/Rigellute/spotify-tui/commit/a3fb7f3cfcc867bf40a0ed00d7c43b61a90a6123) Merge branch 'master' into improve-results-paging - [`9850c96`](https://github.com/Rigellute/spotify-tui/commit/9850c96bf8cf7a4e79131f262dfb0a6d86d51d14) WIP: paging experiment, really ugly still - [`3f1ef60`](https://github.com/Rigellute/spotify-tui/commit/3f1ef6069ba8f71f5363d2782f06453bd20b30c7) Move paging to its own module (*massive* commit) - [`a9876b9`](https://github.com/Rigellute/spotify-tui/commit/a9876b9ae82ddedd65cf17407458c800c5b0c581) Minor fixup to new paging interface - [`896edb3`](https://github.com/Rigellute/spotify-tui/commit/896edb33b97a1ede7d4edba23d1b5263e305de7f) wire in channel for ui updates - [`b93fa86`](https://github.com/Rigellute/spotify-tui/commit/b93fa86221fd6e96c49d67905a1f2e9a8721aca2) make app.dispatch immutable - [`5474521`](https://github.com/Rigellute/spotify-tui/commit/54745217531707abda56aaa9a79bfaeece6b5f6d) make app.dispatch immutable - [`59182b2`](https://github.com/Rigellute/spotify-tui/commit/59182b2e4ad385de30e4466868c81ae1c66369b5) send more ui window info ### 📊 Changes **16 files changed** (+951 additions, -942 deletions) <details> <summary>View changed files</summary> 📝 `src/app.rs` (+85 -185) 📝 `src/handlers/album_list.rs` (+14 -44) 📝 `src/handlers/album_tracks.rs` (+11 -13) 📝 `src/handlers/artist.rs` (+1 -1) 📝 `src/handlers/artists.rs` (+8 -43) 📝 `src/handlers/common_key_events.rs` (+32 -11) 📝 `src/handlers/episode_table.rs` (+19 -46) 📝 `src/handlers/input.rs` (+1 -1) 📝 `src/handlers/made_for_you.rs` (+12 -45) 📝 `src/handlers/mod.rs` (+3 -2) 📝 `src/handlers/search_results.rs` (+2 -2) 📝 `src/handlers/track_table.rs` (+167 -375) 📝 `src/main.rs` (+1 -0) 📝 `src/network.rs` (+189 -121) ➕ `src/paging.rs` (+237 -0) 📝 `src/ui/mod.rs` (+169 -53) </details> ### 📄 Description I've been doing quite bit of work on trying to unify the paging interface and behavior the past couple of weekends. This is still very much a work in progress, but I would love to get some feedback from other developers if you think the current path might make things better. Three are a few things that are a little more complicated than I would like them to be, but the functionality is shaping up to be what I envisioned. ~~Currently, I have only implemented paging for for the podcast episode view, but now that it is working, I should be able to implement the same for all of the library items as well pretty easily. Then I can move on to playlists and albums.~~ ~~It's a bit late here right now, so I will update this description with a to-do list in the coming days to track progress. Also, I'm aware of the falling CI checks, those will be fixed before this is ready for complete review.~~ # TODO: ## Page all the things ### TrackTable (delegate track context management to the type system via type aliases?) - [ ] MyPlaylists - [ ] AlbumSearch - [ ] PlaylistSearch - [x] SavedTracks - [ ] RecommendedTracks - [ ] MadeForYou ### Search results - [ ] Albums - [ ] Artists - [ ] Tracks - [ ] Playlists - [ ] Podcasts ### Library Collections - [x] Saved artists - [x] Saved albums - [x] Saved tracks - [x] Made for you - [x] Podcasts ### Misc - [ ] User playlists ## Other - [ ] Library podcasts view (needs to happen before we can page results) # Call to action Please review the changes at any point. This PR represents a massive change to how we are handling almost every list of items in the app; I'd like to get it right so we aren't plagued with issues in the future. Also, let me know if there is any thing that is currently not being paged that is eligible for paging that is not captured in the to-do list above. If anyone would like to help out, much of the work could be done in parallel from here, I think. Let me know and we can coordinate. We could either work on my fork directly, or we could target a feature branch here. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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-tui#943
No description provided.