[PR #2177] [MERGED] Launcher: registry mods show their 1-5 star rating #4076

Closed
opened 2026-11-03 04:14:31 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2177
Author: @ludovic111
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: feat/launcher-mod-ratings


📝 Commits (2)

  • 590ca77 Mod registry: download counts in the index and the launcher's browser
  • 3dd17ad Launcher: registry mods show their 1-5 star rating

📊 Changes

11 files changed (+219 additions, -10 deletions)

View changed files

📝 THIRD_PARTY_NOTICES.md (+2 -1)
📝 crates/horizon-mods/src/index.rs (+8 -0)
📝 crates/horizon-mods/src/index/registry.rs (+1 -0)
📝 crates/horizon-mods/src/index/tests.rs (+7 -1)
➕ crates/horizon-theme/icons/pixel/star.svg (+3 -0)
📝 crates/horizon-theme/src/lib.rs (+2 -0)
📝 docs/api/mod-index.md (+3 -1)
📝 launcher/src/browser/horizon.rs (+104 -4)
📝 launcher/src/browser/horizon/tests.rs (+40 -0)
📝 launcher/src/mods_page.rs (+34 -3)
📝 launcher/src/mods_project.rs (+15 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Stacked on #2173 (download counts). Until that merges, this diff also shows its commit. This PR's own commit is the last one: 7 files, +179 −2.

What and why

Ludovic asked for a 1-5 star rating on each mod in the browser. The registry service stores ratings since #2167, and #2170 adds them to the website. This PR is the launcher's part.

  • Cards and project pages. Horizon results show the rating: five pixel stars (the mean rounded to whole stars, lit in the theme's warn colour), then the mean and the count. A project with no rating says "No ratings yet". The ratings come from GET https://playhorizon.dev/api/mods/ratings. They are fetched along with the search results and the project details, both of which already run off the UI thread, and kept for ten minutes. If the service doesn't answer, no stars are shown, only downloads. Entries that aren't well formed are dropped.
  • Rating from the launcher. The launcher has no GitHub sign-in: #1846 only links owners' profiles, and its only account is Microsoft. So a project's page has a "Sign in with GitHub to rate" button. It opens playhorizon.dev/api/mods/auth/login?back=/mods/<id> in the browser, which signs the player in and brings them back to the project's page with its stars. There they rate once per GitHub account and can change it later. Owners can't rate their own project, and nobody sees who rated (#2167).
  • Testing against a local registry. HORIZON_MOD_RATINGS (a file or an https:// address) gives a test registry its own ratings. A local HORIZON_MOD_INDEX without it shows none.
  • Star icon. star is a new icon in horizon-theme. I drew it myself on the same 2-unit grid as the Pixelarticons set, not taken from that set, and added a line to THIRD_PARTY_NOTICES.md saying so.

Self-check

  • Launcher cargo test --features gpui/runtime_shaders horizon: 11 pass, including the new ratings_keep_only_what_is_well_formed. It checks: averages outside 1-5, a count of 0, invalid ids, string values, a non-object answer, and the rate URL.
  • cargo test -p horizon-theme: 7 pass (every_icon_is_a_pixel_svg covers the star).
  • Launcher cargo clippy --all-targets -D warnings: clean. cargo fmt --check: clean.
  • Screenshots on the Mac mini, method from memory launcher-screenshots.md. The launcher ran with scratch homes, the live index with counts added, and sample ratings via HORIZON_MOD_RATINGS. Files: ~/scratch/mod-stats-1/launcher-{list,page}-{dark,light}.png.

Needs Ludovic

Nothing. A follow-up could rate from inside the launcher: GitHub's device flow on the registry's OAuth app, with the service accepting that token. That needs device flow turned on in the OAuth app's settings, which only Ludovic can do. Say if you want it.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2177 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/launcher-mod-ratings` --- ### 📝 Commits (2) - [`590ca77`](https://github.com/horizon-rust/horizon/commit/590ca775c2a828738ed5efcd9eab20826ebadcbf) Mod registry: download counts in the index and the launcher's browser - [`3dd17ad`](https://github.com/horizon-rust/horizon/commit/3dd17ad7d756dcff2e1e431100ec2e96f01a9d4e) Launcher: registry mods show their 1-5 star rating ### 📊 Changes **11 files changed** (+219 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `THIRD_PARTY_NOTICES.md` (+2 -1) 📝 `crates/horizon-mods/src/index.rs` (+8 -0) 📝 `crates/horizon-mods/src/index/registry.rs` (+1 -0) 📝 `crates/horizon-mods/src/index/tests.rs` (+7 -1) ➕ `crates/horizon-theme/icons/pixel/star.svg` (+3 -0) 📝 `crates/horizon-theme/src/lib.rs` (+2 -0) 📝 `docs/api/mod-index.md` (+3 -1) 📝 `launcher/src/browser/horizon.rs` (+104 -4) 📝 `launcher/src/browser/horizon/tests.rs` (+40 -0) 📝 `launcher/src/mods_page.rs` (+34 -3) 📝 `launcher/src/mods_project.rs` (+15 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Stacked on #2173 (download counts). Until that merges, this diff also shows its commit. This PR's own commit is the last one: 7 files, +179 −2. ## What and why Ludovic asked for a 1-5 star rating on each mod in the browser. The registry service stores ratings since #2167, and #2170 adds them to the website. This PR is the launcher's part. - **Cards and project pages.** Horizon results show the rating: five pixel stars (the mean rounded to whole stars, lit in the theme's `warn` colour), then the mean and the count. A project with no rating says "No ratings yet". The ratings come from `GET https://playhorizon.dev/api/mods/ratings`. They are fetched along with the search results and the project details, both of which already run off the UI thread, and kept for ten minutes. If the service doesn't answer, no stars are shown, only downloads. Entries that aren't well formed are dropped. - **Rating from the launcher.** The launcher has no GitHub sign-in: #1846 only links owners' profiles, and its only account is Microsoft. So a project's page has a "Sign in with GitHub to rate" button. It opens `playhorizon.dev/api/mods/auth/login?back=/mods/<id>` in the browser, which signs the player in and brings them back to the project's page with its stars. There they rate once per GitHub account and can change it later. Owners can't rate their own project, and nobody sees who rated (#2167). - **Testing against a local registry.** `HORIZON_MOD_RATINGS` (a file or an `https://` address) gives a test registry its own ratings. A local `HORIZON_MOD_INDEX` without it shows none. - **Star icon.** `star` is a new icon in `horizon-theme`. I drew it myself on the same 2-unit grid as the Pixelarticons set, not taken from that set, and added a line to THIRD_PARTY_NOTICES.md saying so. ## Self-check - Launcher `cargo test --features gpui/runtime_shaders horizon`: 11 pass, including the new `ratings_keep_only_what_is_well_formed`. It checks: averages outside 1-5, a count of 0, invalid ids, string values, a non-object answer, and the rate URL. - `cargo test -p horizon-theme`: 7 pass (`every_icon_is_a_pixel_svg` covers the star). - Launcher `cargo clippy --all-targets -D warnings`: clean. `cargo fmt --check`: clean. - Screenshots on the Mac mini, method from memory launcher-screenshots.md. The launcher ran with scratch homes, the live index with counts added, and sample ratings via `HORIZON_MOD_RATINGS`. Files: `~/scratch/mod-stats-1/launcher-{list,page}-{dark,light}.png`. ## Needs Ludovic Nothing. A follow-up could rate from inside the launcher: GitHub's device flow on the registry's OAuth app, with the service accepting that token. That needs device flow turned on in the OAuth app's settings, which only Ludovic can do. Say if you want it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:14:31 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4076
No description provided.