Launcher: registry mods show their 1-5 star rating
Horizon results and project pages show a project's rating from the registry service (GET playhorizon.dev/api/mods/ratings, fetched with the results, kept ten minutes): five pixel stars, the mean and how many, or "No ratings yet". Nothing shows when the service doesn't answer. The launcher has no GitHub account, so a project's page offers "Sign in with GitHub to rate": it opens the site's sign-in, which comes back to the project's page and its stars (one rating per GitHub account). HORIZON_MOD_RATINGS (a file or https:// address) points a test registry at its own ratings. The star icon is drawn for Horizon on the icons' grid. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -491,6 +491,21 @@ impl Launcher {
|
||||
.gap(px(24.))
|
||||
.child(div().flex().child(back))
|
||||
.child(head);
|
||||
// Registry projects are rated on the site, signed in with GitHub (one rating per account).
|
||||
if p.source == SourceId::Horizon {
|
||||
let url = browser::horizon::rate_url(&p.id);
|
||||
page = page.child(
|
||||
div()
|
||||
.flex()
|
||||
.items_center()
|
||||
.gap(px(16.))
|
||||
.children(super::mods_page::stars(&p.id, &t).map(|s| text(theme::UI).child(s)))
|
||||
.child(
|
||||
button("mods-rate", "Sign in with GitHub to rate", Kind::Ghost, &t)
|
||||
.on_click(move |_, _, cx| cx.open_url(&url)),
|
||||
),
|
||||
);
|
||||
}
|
||||
if let Some(why) = support.reason() {
|
||||
page = page.child(
|
||||
text(theme::UI)
|
||||
|
||||
Reference in New Issue
Block a user