Skip to content

Item Card component displays Critic|Community ratings from setting #6919

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

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

Conversation

shoecar
Copy link

@shoecar shoecar commented Jun 3, 2025

Changes
Two major changes:

  • New cardRatings display setting
  • Item cards display Critic and/or/neither Community based on cardRatings value

Screenshots
New "Display > Item Card" setting type with "Item Card Ratings Display" setting:
image
image
This controls which of CriticRating/CommunityRating should be displayed (defaulting to None).

Here is what it looks like with All selected:
image
You can see no CriticRating is shown for shows as that data is not available. Moves have both CriticRating and CommunityRating so they are shown together.

Issues
3330/rating-on-posters
discussions/6911

@shoecar shoecar requested a review from a team as a code owner June 3, 2025 21:44
@jellyfin-bot
Copy link
Collaborator

jellyfin-bot commented Jun 3, 2025

Cloudflare Pages deployment

Latest commit dbbade5
Status ✅ Deployed!
Preview URL https://78f43513.jellyfin-web.pages.dev
Type 🔀 Preview

View build logs

@shoecar shoecar changed the title Item Card component displays Critic and/or/neither Community from setting Item Card component displays Critic|Community ratings from setting Jun 3, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

ESLint doesn't pass. Please fix all ESLint issues.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

ESLint doesn't pass. Please fix all ESLint issues.

@@ -321,6 +321,19 @@ export class UserSettings {
return this.get('customCss', false);
}

/**
Copy link
Author

Choose a reason for hiding this comment

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

I know /scripts are marked as deprecated, but from what I can tell updating this file is required when adding a display setting.

I'm open to different approaches but I think its important to have a setting. Both to allow for default behavior of still not showing card ratings, and the extra options I added.

Copy link
Member

Choose a reason for hiding this comment

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

It's adding new files that would be an issue, so it's fine.

Comment on lines +299 to +301
<h2 class="sectionTitle">
${ItemCard}
</h2>
Copy link
Author

Choose a reason for hiding this comment

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

I did not think any of the other sections fit well enough. Seeing "Item Details" existed I thought "Item Card" was a consistently themed section.
I think "Item Card" is distinct enough and a broad enough design space to justify its own section.

@shoecar
Copy link
Author

shoecar commented Jun 10, 2025

@thornbill I see you're very active in this repo, could you take a look at this PR?

Would also appreciate if you could add feature label as I'm not able to.

Thanks

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

ESLint doesn't pass. Please fix all ESLint issues.

@jellyfin-bot jellyfin-bot added the merge conflict Conflicts prevent merging label Jun 11, 2025
@jellyfin-bot
Copy link
Collaborator

This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged.

@jellyfin-bot jellyfin-bot removed the merge conflict Conflicts prevent merging label Jun 11, 2025
Copy link

@shoecar
Copy link
Author

shoecar commented Jun 29, 2025

@viown I addressed your comments, could you approve this? I'd really like to get it in.
If you're not good with unilaterally approving a UI change like this is there a way I can reach out to others to get more feedback?

soultaco83 added a commit to soultaco83/jellyfin-web-unstable that referenced this pull request Jun 29, 2025
added Item Card component displays Critic|Community ratings from setting jellyfin#6919
Copy link
Member

@viown viown left a comment

Choose a reason for hiding this comment

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

Sorry for the delay, although do note that it can take a while to get reviews and PRs in due to the low number of contributors on the web team (as denoted by the backlog of PRs at the moment 😅).

I personally think that that the setting can just be a simple checkbox to show none or all, but maybe someone else can chip in on that.

return this.set('cardRatings', val.toString(), false);
}

return this.get('cardRatings', false);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return this.get('cardRatings', false);
return this.get('cardRatings', false) || 'none';


.cardRating {
display: flex;
align-items: center;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
align-items: center;
align-items: center;
color: #fff;

The inherited color can make the ratings text hard to read on lighter themes

const backgroundImageClass = item.CriticRating >= 60 ? 'cardRatingFresh' : 'cardRatingRotten';
cardRatingHtml += `<div class="cardRating"><span class="cardRatingIcon cardCriticRating ${backgroundImageClass}"></span><span>${item.CriticRating}</span></div>`;
}
if (item.CommunityRating && ['community', 'all'].includes(ratingsSetting)) {
Copy link
Member

Choose a reason for hiding this comment

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

I think we can put community ratings first? Same order as in the item details page.

@shoecar
Copy link
Author

shoecar commented Jun 30, 2025

Sorry for the delay, although do note that it can take a while to get reviews and PRs in due to the low number of contributors on the web team (as denoted by the backlog of PRs at the moment 😅).

I personally think that that the setting can just be a simple checkbox to show none or all, but maybe someone else can chip in on that.

@viown yeah no worries, I mostly wanted to make sure it didn't fall through the cracks! I appreciate you leaving feedback, I'll be more patient

@theguymadmax
Copy link
Contributor

This is a nice feature, and I can absolutely see users wanting the option to display just one or the other.

@Hello-World-Traveler
Copy link

Could this be added to the server so clients can take full advantage of this new feature?

@shoecar
Copy link
Author

shoecar commented Jul 9, 2025

Could this be added to the server so clients can take full advantage of this new feature?

@Hello-World-Traveler I'm not sure what you're asking. This is fully a frontend/client side feature that will work as long as the server is passing critic/community rating data.
To get this live the PR needs an approval, to be merged, and then should be present in the next release (I'm not sure what the release cadence is, but doesn't seem super frequent).

If you had something else in mind I didn't address let me know, thanks

@Hello-World-Traveler
Copy link

@shoecar This new feature will only work for web clients not on Android or Apple apps that doesn't not use web client?

@shoecar
Copy link
Author

shoecar commented Jul 10, 2025

@shoecar This new feature will only work for web clients not on Android or Apple apps that doesn't not use web client?

ah yeah, just for the web app. This functionality would need to be ported over to other repos like jellyfin-android and jellyfin-expo (iOS App).
I have not looked into those repos but if there is interest I could look into doing that work too.

@Hello-World-Traveler
Copy link

I think it should be a core jellyfin feature. It's a good idea to add ratings to the item cards.

There would be a lot of interest for this in all clients as it's useful information.

@viown
Copy link
Member

viown commented Jul 10, 2025

ah yeah, just for the web app. This functionality would need to be ported over to other repos like jellyfin-android and jellyfin-expo (iOS App).

Both of those integrate the web client as their frontend, so no further changes would be needed there.

FYI, @shoecar you have some unaddressed review feedback, in case you missed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants