-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
[front] feat: display unavailable video message on comparison page for unavaible video #1431
[front] feat: display unavailable video message on comparison page for unavaible video #1431
Conversation
this commit attempts to fix the conflict between main and front-reload-unavailable-video-in-comparisons-page
Hello @tournesol-app/maintainers I've reviewed those changes and I'd like your input before going further. (1) about the usage The function Regarding the See:
(2) about the auto-load feature When opening a comparison link, the In my opinion this is a small problem, but a problem still: redirecting users to an unexpected place, and preventing them to edit their comparisons could be a source of frustration. This is something I'd like to avoid as much as possible in the UX: unexpected behaviours. Propositions:
(3) about the We currently call a non-generic function in a supposedly generic effect. As we don't have a generic The feedback are more than welcome on this : ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The behavior on this branch has a few problems:
- it's not possible to access a past comparison related to an unavailable video. The video is automatically replaced with another video without any explanation, which is very confusing for the user.
- when selecting an unavailable video manually in one of the selectors, I can see the message "Only available videos can be compared". However it's still possible to submit the comparison.
But more importantly, I'm not confident with how the EntitySelector
uses setTimeout
in multiple places . It's not clear what is the problem they are supposed to solve, and if they are actually fixed especially when some requests would be slower than expected.
This problem seems to arise because the video availability is achieved independently from the existing requests to the API. This creates a lot of potential race conditions.
I think it could make sense to move the state related to the selected entities in a new dedicated state/context, in order to reduce the complexity of EntitySelector
and define a single validation flow, to check the video availability, fetch the contributor rating, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discussion, let's remove the "autoReload" feature for now.
We can allow unavailable videos to be compared (or their past comparisons to be modified). The message used on the entity selector should be modified to clarify that.
cc @OoIwazaruoO
Co-authored-by: Adrien Matissart <amatissart@users.noreply.github.com>
entities -> elements youtube -> YouTube use a generic message in EntitySelector when the poll is not `videos`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't approve a pull request I opened myself, but the code looks good to me 👍
It's far more simple now : ) @amatissart do you want to have a final look before approving?
Next step
We now have a small display bug making the duration not easy to read when the entities are not available (see the bottom right corner of the capture):
edit fixed by 1d7b731
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the simplification @OoIwazaruoO @GresilleSiffle !
Co-authored-by: Adrien Matissart <amatissart@users.noreply.github.com>
related to #1070
This PR attempts to fix the conflicts between #1426 and the branch
main
.@OoIwazaruoO I've imported all your code as-is here, you can continue on this branch.
to-do