Skip to content

Issue 2056: Half-star Ratings for Albums#2167

Open
tonyhieu wants to merge 2 commits into
VocaDB:mainfrom
tonyhieu:main
Open

Issue 2056: Half-star Ratings for Albums#2167
tonyhieu wants to merge 2 commits into
VocaDB:mainfrom
tonyhieu:main

Conversation

@tonyhieu

@tonyhieu tonyhieu commented May 20, 2026

Copy link
Copy Markdown

This PR addresses Issue 2056 by allowing users to submit half star ratings. In addition, ratings on pages are fractional as opposed to being whole stars. Below are screenshots taken from a local build of the PR:

Albums list under artist:
image

Album page:
image

Update pop-up:
image

This PR includes both front-end and back-end changes. The front-end changes are seen above. Notably, the EditCollectionDialog component for inputting a rating has a new import: the outdated import JqxRating from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxrating'; is replaced with a more modern import Rating from '@mui/material/Rating'; from material-ui. For displaying fractional stars, the <Stars /> component has been tweaked and is now used in places where stars were hard coded (e.g. AlbumReviews.tsx). The <StarsMeta /> and <StarsMetaSpan /> components were also changed.

Because half-star ratings are allowed, the back-end has been updated to take rating and related members in as double instead of int. Included in this PR is a migration script to migrate the MSSQL database from int to double.

This change was tested locally and verified to work.

@FinnRG FinnRG left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi, thank you for your contributions. A few comments on the changes:

  1. The changeset is too large and contains unrelated changes. AFAICT you formatted the files using a different formatter. Please run npm run format or check your setup
  2. I don't like pulling in an entirely different framework for a single UI component. According to this fiddle: https://jsfiddle.net/jqwidgets/6bA3D/, jqWidgets might support a precision parameter for half star reviews. Could you check that out?
  3. Not a strict requirement, but it would be great if you could squash/rewrite your commit history to make it cleaner and reviews easier. It currently contains a lot of fixups that could be merged to the previous commits.

@tonyhieu

tonyhieu commented May 21, 2026

Copy link
Copy Markdown
Author

@FinnRG I addressed your changes:

  1. I ran npm run format to get rid of irrelevant changes
  2. Discussed Later
  3. Commits squashed into two commits

I faced a lot of difficulty trying to get JqxRating to work. I agree that bringing in a new library for one component is overkill. Some of the efforts I tried with JqxRating (with the setting precision={0.5}) were:

  • Changing .cshtml files to support fractional stars
  • Adding an always-changing key to the widget in order to get it to reload on hide/show
  • Importing jQuery in index.tsx
  • Bumping version

In the end, none of these attempts worked, and I'm not entirely sure why. I suspect it has something to do with the way the DOM is rendered, as jQuery isn't built on top of React like material-ui and is likely facing a conflict somewhere in the code. My solution was to create a new, minimal RatingPicker component with the desired functionality. I think that it's the cleanest solution possible given that JqxRating does not want to cooperate, and RatingPicker can also be potentially reused elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants