[PR #2173] [MERGED] Mod registry: download counts in the index and the launcher's browser #4071

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

📋 Pull Request Information

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

Base: main ← Head: feat/mod-index-downloads


📝 Commits (1)

  • 590ca77 Mod registry: download counts in the index and the launcher's browser

📊 Changes

7 files changed (+40 additions, -8 deletions)

View changed files

📝 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)
📝 docs/api/mod-index.md (+3 -1)
📝 launcher/src/browser/horizon.rs (+8 -3)
📝 launcher/src/browser/horizon/tests.rs (+12 -0)
📝 launcher/src/mods_page.rs (+1 -3)

📄 Description

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

What and why

Ludovic asked for a download count on each mod in the browser. Each version's file is a release asset of ludovic111/horizon-mods, and GitHub counts its downloads. ludovic111/horizon-mods#7 makes the publish job, now hourly, write the total per project into index.json as downloads.

  • horizon_mods::index::Project gets downloads: u64. It reads as 0 when absent and isn't written when 0, so older launchers ignore it and the schema stays 1. Documented in docs/api/mod-index.md. The platform-2 thread was told through the orchestrator before this touched crates/horizon-mods.
  • Launcher. Horizon results show "12.3k downloads", as Modrinth's do. Until now the line was hidden for the registry because it always read 0. Horizon results are listed most-downloaded first. The registry has no filter bar, so that is its order.
  • Install path. The launcher installs from file.url, which is the asset's browser_download_url, the URL GitHub counts. So installs from the launcher add to the number.

Self-check

  • cargo test -p horizon-mods --all-features --lib index: 14 pass. The sample test now checks that downloads is absent when 0 and reads back when present.
  • Launcher cargo test --features gpui/runtime_shaders horizon: 10 pass. searches_by_kind_and_words now checks the most-downloaded-first order.
  • cargo clippy --all-targets -D warnings: launcher and horizon-mods clean. cargo fmt --check: clean.
  • tools/pr_ready.py --quick:
Check Result
Scope ⚠️ 7 files, +40 −8; mixes game, launcher
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (29 s)
clippy ✅ (5 min 56 s)
tests: horizon-mods ✅ 49 passed (1 min 57 s)
doc tests ✅ 0 passed (55 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (4 s)
launcher clippy ✅ (44 s)
launcher tests ✅ 132 passed (1 min 24 s)
Parity ➖ 77 affected, to run in CI (--quick): arrow, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, breaking_model, cauldron, chat_screen, command_exec, command_parse and 65 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

CI's parity-scope ran no harnesses for this change (run-parity skipped).

Needs Ludovic

Merge ludovic111/horizon-mods#7 (CODEOWNERS) so the index gets the counts. Until then this PR shows "0 downloads" on registry cards.

🤖 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/2173 **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/mod-index-downloads` --- ### 📝 Commits (1) - [`590ca77`](https://github.com/horizon-rust/horizon/commit/590ca775c2a828738ed5efcd9eab20826ebadcbf) Mod registry: download counts in the index and the launcher's browser ### 📊 Changes **7 files changed** (+40 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `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) 📝 `docs/api/mod-index.md` (+3 -1) 📝 `launcher/src/browser/horizon.rs` (+8 -3) 📝 `launcher/src/browser/horizon/tests.rs` (+12 -0) 📝 `launcher/src/mods_page.rs` (+1 -3) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What and why Ludovic asked for a download count on each mod in the browser. Each version's file is a release asset of ludovic111/horizon-mods, and GitHub counts its downloads. ludovic111/horizon-mods#7 makes the publish job, now hourly, write the total per project into `index.json` as `downloads`. - **`horizon_mods::index::Project`** gets `downloads: u64`. It reads as 0 when absent and isn't written when 0, so older launchers ignore it and the schema stays 1. Documented in `docs/api/mod-index.md`. The platform-2 thread was told through the orchestrator before this touched `crates/horizon-mods`. - **Launcher.** Horizon results show "12.3k downloads", as Modrinth's do. Until now the line was hidden for the registry because it always read 0. Horizon results are listed most-downloaded first. The registry has no filter bar, so that is its order. - **Install path.** The launcher installs from `file.url`, which is the asset's `browser_download_url`, the URL GitHub counts. So installs from the launcher add to the number. ## Self-check - `cargo test -p horizon-mods --all-features --lib index`: 14 pass. The sample test now checks that `downloads` is absent when 0 and reads back when present. - Launcher `cargo test --features gpui/runtime_shaders horizon`: 10 pass. `searches_by_kind_and_words` now checks the most-downloaded-first order. - `cargo clippy --all-targets -D warnings`: launcher and horizon-mods clean. `cargo fmt --check`: clean. - `tools/pr_ready.py --quick`: | Check | Result | | --- | --- | | Scope | ⚠️ 7 files, +40 −8; mixes game, launcher | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (29 s) | | clippy | ✅ (5 min 56 s) | | tests: horizon-mods | ✅ 49 passed (1 min 57 s) | | doc tests | ✅ 0 passed (55 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (4 s) | | launcher clippy | ✅ (44 s) | | launcher tests | ✅ 132 passed (1 min 24 s) | | Parity | ➖ 77 affected, to run in CI (--quick): arrow, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, breaking_model, cauldron, chat_screen, command_exec, command_parse and 65 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | CI's parity-scope ran no harnesses for this change (`run-parity` skipped). ## Needs Ludovic Merge ludovic111/horizon-mods#7 (CODEOWNERS) so the index gets the counts. Until then this PR shows "0 downloads" on registry cards. 🤖 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:29 +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#4071
No description provided.