Open dfabulich opened 4 days ago
LOL I was just working on it. Here's mine, still has a few bugs (see TODO).
I'll review your approach with the knowledge I gained :)
UI issues I noticed:
leaveFunc
, which is wrong. That mouse-out is only needed to delay changing the "Rate it:" to "Your Rating:", to avoid shifting the stars element to the right, while you are hovering over it.)Cleanup:
General idea from my own attempt:
ifdbutil.js
, and add 'use strict;'
at the top. It makes it much easier to catch errors, and for linters to do their job. Since use strict
makes JS fail on stuff it didn't before, like undefined variables, it should be tested before deploying to production, but it was very useful during development.2. The settings page should say that the accessbility toggle currently does nothing :)
I wonder if there's anyone who likes the drop-down menu and would want to keep using it. If so, the description could be changed to say "Use drop-down menu for star ratings."
Or we could just hide that section entirely.
If the new implementation is good enough, there's no need to keep the drop-down. Can we consult with actual users of this feature, even if it's just to get feedback on the new implementation?
For the setting, it might be good to keep for future use...?
I started working on this again but didn't really see a clever way to implement this that works equally well on the viewgame
page and on the review
page, unless I add a "submit" button to viewgame
, which barely fits, and doesn't look great.
@salty-horse do you want to take a crack at this?
@dfabulich I'm not sure what is the "this" you mean that causes trouble. Something in my list above? I can see how switching from radio to buttons means a bit more work with the review
form.
"This" is just, this PR, in general.
I began by saying, "OK, I'll turn the radio buttons into buttons" and then I said, "but what about reviews?"
So then I went in to add a "Submit" button on /viewgame
but it didn't really fit (especially when the stars are large enough to tap with a finger). Then I got tired of working on it and wandered off!
OK, I'll fix the remaining stuff.
BTW, in Goodreads' "review" form, if you change the star rating, it submits it immediately, separately from the rest of the form. So it might be an OK behavior, but I prefer the current one.
Fixes https://github.com/iftechfoundation/ifdb/issues/490
Based on https://dev.to/grahamthedev/5-star-rating-system-actually-accessible-no-js-no-wai-aria-3idl
Tested on iOS 18 screen reader. It reads display ratings aloud, e.g. "4 and a half stars out of 5", and it supports navigating to each star as a radio button and checking it.