Implement saved album exporting #216
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've seen this feature requested several times over the years. I'm in the camp of people who don't use playlists much, but would greatly benefit from having my saved album data be portable, so I decided to take a stab at contributing onto this project.
This PR adds an extra section to the bottom of the page, showing the user their count of saved albums. An export button is provided that will allow the user to download a CSV data dump of the saved albums


From a UI perspective I did my best to give it continuity with the rest of the page. The row has a soft highlight when you mouse over it, the button disables and the icon spins when an export is in progress, and a progress bar shows the user how far along the export is:

I tried to avoid touching existing pieces if possible, but I did make a minor change to the behavior of the spinner while initialization of the first page of playlists is in progress. Previously, the spinner was an absolutely positioned element outside the flow of the page. My new component has no awareness of the state of the playlist component, so it would often finish loading first and appear under the playlist spinner, which seemed not ideal. I changed the spinner to appear inline within its container, and also gave a spinner to the new album component, and they load in independently when they are ready.


There is also some duplication with the translation strings. Many of the column headers could re-use column headers from the track object, but it also seemed reasonable to treat 'album' as its own new object and give it its own strings. Past experience made me lean this way, as the different context might result in different translations in other languages, despite being the same in english. If you prefer to optimize for re-use, let me know and I will do so.
Thanks in advance for your review!