nukeop / nuclear

Streaming music player that finds free music for you
https://nuclear.js.org/
GNU Affero General Public License v3.0
11.93k stars 1.03k forks source link

Add Filtering to the favorites lists #1204

Closed JoshTRN closed 3 weeks ago

JoshTRN commented 2 years ago

Hello.

I think there should be a filtering option on all of the favorites sections just like in the local library. I'd be happy to put in a pull request to do the work, but the docs said I should discuss it here first, so this is me opening the discussion.

(I already kinda did the work because I wanted to see what it would look like. Now, if you guys give the approval, I might need some help updating the snapshots as I've never used lerna before and some of this stuff is foreign to me even after reading the jest docs.)

nukeop commented 2 years ago

Sure, but I'd rather first upgrade the favorites to use a track table (the one that is currently used in album view and playlist view), then add an optional filter field to that table, so we can reuse it elsewhere. We could do it as a part of one pull request.

To update snapshots, you just run jest -u and check if what's rendered matches your expectations.

JoshTRN commented 2 years ago

Sure, but I'd rather first upgrade the favorites to use a track table (the one that is currently used in album view and playlist view), then add an optional filter field to that table, so we can reuse it elsewhere. We could do it as a part of one pull request.

To update snapshots, you just run jest -u and check if what's rendered matches your expectations.

Are you saying you want to make the favorite albums go from looking like this: image

to looking like this where each album takes up a row: image

You know, I'm not sure how the tests are running, but I don't have jest installed globally, so it's not clear to me how that's working. Should I just install it globally to run these jest commands?

nukeop commented 2 years ago

I was thinking about favorite tracks. Favorite albums should stay as they are now. Did you add the filter to the favorite albums view?

You don't have to install jest globally, it should be installed along with all the project dependencies in node_modules. You can use the locally installed version by running npx jest. So to update the snapshots in the app package, go to packages/app, then run npx jest -u in that folder.

JoshTRN commented 2 years ago

I did. I wanted it there also because I added a bunch of albums and was just like I just wanna filter it down. I added it to favorite tracks, favorite artists and favorite albums.

nukeop commented 2 years ago

Ok, let's see a pull request and we'll take it from there.

JoshTRN commented 2 years ago

Man I cannot figure out these unit tests to save my life. Might have to wait on that PR.

tauantcamargo commented 1 year ago

@nukeop Was it coded?

nukeop commented 1 year ago

It wasn't yet, do you want to take it?

tauantcamargo commented 1 year ago

@nukeop yeah.. assign it to me

nukeop commented 1 year ago

Let me know how you're going to design the filter input when you think it over.

nukeop commented 3 weeks ago

Closed by https://github.com/nukeop/nuclear/commit/da982ff94d1b78313b8ddd6046fdd0a6870daca3