Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor HueSound into a functional component #2853

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

MonkeyDo
Copy link
Contributor

@MonkeyDo MonkeyDo commented Apr 25, 2024

Based on the userfeed-refactor branch, wait for #2844 to be merged please

+ rename from ColorPlay to HueSound
+Reorganize BrowserRouter so that ToastContainer has router context
@MonkeyDo MonkeyDo changed the base branch from single-page-app to userfeed-refactor April 25, 2024 18:07
@MonkeyDo MonkeyDo marked this pull request as ready for review April 30, 2024 09:54
@MonkeyDo MonkeyDo requested a review from anshg1214 April 30, 2024 10:07
Copy link
Member

@anshg1214 anshg1214 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! The PR looks really good, just some small changes left.

frontend/js/src/explore/huesound/HueSound.tsx Outdated Show resolved Hide resolved
frontend/js/src/explore/huesound/HueSound.tsx Outdated Show resolved Hide resolved
frontend/js/tests/explore/huesound/HueSound.test.tsx Outdated Show resolved Hide resolved
Base automatically changed from userfeed-refactor to master May 2, 2024 17:15
Can't click on elements rendered on a canvas in tests, so pass an optional color
+ finishing tests
Replace the initialColor prop I had put in to be able to run tests, and instead test with the router and URL params directly
@MonkeyDo
Copy link
Contributor Author

MonkeyDo commented May 16, 2024

I ended up refactoring a bit more to allow having a color in the URL params.
It's better for users and the updated URL bar makes it more shareable.
you can do hex string or named colors, for example /explore/huesound/red.

That way it also makes it possible to test the component, because we can't interact with the colorwheel (rendered canvas) in tests to select a color.

@MonkeyDo MonkeyDo requested a review from anshg1214 May 16, 2024 10:49
@MonkeyDo
Copy link
Contributor Author

Note that this component is refactored to play nice with react-router, but has not been refactored to be used with the new BrainzPlayer with queues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants