[PR #1153] [MERGED] Mod browser (2/3): install, update and remove, with horizon-launcher mods #3099

Closed
opened 2026-11-02 16:01:29 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/mod-browser-install


📝 Commits (1)

  • 9346ac0 Mod browser (2/3): install, update and remove, with horizon-launcher mods

📊 Changes

6 files changed (+774 additions, -2 deletions)

View changed files

📝 docs/mod-browser.md (+25 -0)
📝 launcher/README.md (+5 -0)
📝 launcher/src/browser.rs (+21 -2)
➕ launcher/src/browser/installed.rs (+260 -0)
➕ launcher/src/browser/installed/tests.rs (+252 -0)
📝 launcher/src/cli.rs (+211 -0)

📄 Description

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

Part 2 of 3 for #577, stacked on #1141 (review that first; this PR's own diff is the last commit). It installs, updates and removes packs, and adds a CLI, so it can be used and tested without the UI. Part 3 adds the launcher's Mods page on top.

What

  • browser::installed:
    • plan: picks the newest version that runs, then its required dependencies, recursively, before any download. A dependency that isn't a pack Horizon loads (a Java mod) stops the install with its name.
    • install: dependencies first, into resourcepacks/ or shaderpacks/, each file checksum-verified (part 1). mod-browser.json beside options.txt records the source, project, version, file and SHA-512:<hex> of each.
    • update (update_for + install): swaps in the newer file and deletes the old one.
    • remove: deletes only what the browser installed. A player's own file of the same name is never overwritten or removed.
    • fetch_modpack: a modpack's .mrpack or zip is downloaded, checked, into ports/downloads/, then imported with the Modpacks page's pipeline (modpacks::import).
  • Source::fetch (defaults to the checked download) lets tests serve files from memory.
  • CLI: horizon-launcher mods [list] | search | install | update [--check] | remove, with --json (README, docs/mod-browser.md).

Real run (Mac mini, scratch HORIZON_HOME, real Modrinth)

$ horizon-launcher mods search faithful
Faithful 64x  (faithful-64x)  Works · 7706791 downloads ...
$ horizon-launcher mods search --kind shader
Complementary Shaders - Reimagined  (complementary-reimagined)  Partly · 72307455 downloads
  Java shader packs are translated: their full-screen passes draw, the world and shadow passes don't yet (BSL and Complementary tested).
$ horizon-launcher mods install faithful-32x
Faithful 32x 26.3-september-2026: resourcepacks/Faithful 32x - 26.3.zip (SHA-512:e90ec63a…779db9)
$ horizon-launcher mods update --check
Faithful 32x 26.3-september-2026: up to date.
$ horizon-launcher mods remove faithful-32x
Removed Faithful 32x (resourcepacks/Faithful 32x - 26.3.zip).
$ horizon-launcher mods install fabulously-optimized
Imported Fabulously Optimized (Minecraft 26.3 · fabric 0.19.5 · 48 files): horizon-launcher modpack port fabulously-optimized
$ horizon-launcher mods search --source curseforge x
error: CurseForge needs an API key: HORIZON_CURSEFORGE_API_KEY (docs/mod-browser.md).

Self-check (Mac mini)

cd launcher
cargo fmt --check                                                     ok
set -o pipefail; cargo clippy --all-targets --features gpui/runtime_shaders -- -D warnings   ok
cargo test --features gpui/runtime_shaders                            lib 94 passed (2 ignored: network), bins 12 + 1 passed
python3 tools/parity.py --list --changed origin/main                  0 of 326 harnesses (launcher only)

New tests use a fake in-memory source:

  • install with a dependency, then reinstall (nothing downloaded), update (old file gone), remove;
  • a tampered file, a Java-mod dependency or a player's own file of the same name each leave nothing installed and the player's file untouched;
  • what doesn't run is refused;
  • a shader pack lands in shaderpacks/;
  • a modpack download is checked.

Needs Ludovic

Nothing new. The CurseForge key is described in #1141.

Part of #577.

🤖 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/1153 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/mod-browser-install` --- ### 📝 Commits (1) - [`9346ac0`](https://github.com/horizon-rust/horizon/commit/9346ac04ad4120b8ae7dfa926d508ca27eea0da3) Mod browser (2/3): install, update and remove, with `horizon-launcher mods` ### 📊 Changes **6 files changed** (+774 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `docs/mod-browser.md` (+25 -0) 📝 `launcher/README.md` (+5 -0) 📝 `launcher/src/browser.rs` (+21 -2) ➕ `launcher/src/browser/installed.rs` (+260 -0) ➕ `launcher/src/browser/installed/tests.rs` (+252 -0) 📝 `launcher/src/cli.rs` (+211 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Part 2 of 3 for #577, stacked on #1141 (review that first; this PR's own diff is the last commit). It installs, updates and removes packs, and adds a CLI, so it can be used and tested without the UI. Part 3 adds the launcher's Mods page on top. ## What - `browser::installed`: - **plan**: picks the newest version that runs, then its required dependencies, recursively, **before any download**. A dependency that isn't a pack Horizon loads (a Java mod) stops the install with its name. - **install**: dependencies first, into `resourcepacks/` or `shaderpacks/`, each file checksum-verified (part 1). `mod-browser.json` beside `options.txt` records the source, project, version, file and `SHA-512:<hex>` of each. - **update** (`update_for` + install): swaps in the newer file and deletes the old one. - **remove**: deletes only what the browser installed. **A player's own file of the same name is never overwritten or removed.** - **fetch_modpack**: a modpack's `.mrpack` or zip is downloaded, checked, into `ports/downloads/`, then imported with the Modpacks page's pipeline (`modpacks::import`). - `Source::fetch` (defaults to the checked download) lets tests serve files from memory. - CLI: `horizon-launcher mods [list] | search | install | update [--check] | remove`, with `--json` (README, docs/mod-browser.md). ## Real run (Mac mini, scratch `HORIZON_HOME`, real Modrinth) ``` $ horizon-launcher mods search faithful Faithful 64x (faithful-64x) Works · 7706791 downloads ... $ horizon-launcher mods search --kind shader Complementary Shaders - Reimagined (complementary-reimagined) Partly · 72307455 downloads Java shader packs are translated: their full-screen passes draw, the world and shadow passes don't yet (BSL and Complementary tested). $ horizon-launcher mods install faithful-32x Faithful 32x 26.3-september-2026: resourcepacks/Faithful 32x - 26.3.zip (SHA-512:e90ec63a…779db9) $ horizon-launcher mods update --check Faithful 32x 26.3-september-2026: up to date. $ horizon-launcher mods remove faithful-32x Removed Faithful 32x (resourcepacks/Faithful 32x - 26.3.zip). $ horizon-launcher mods install fabulously-optimized Imported Fabulously Optimized (Minecraft 26.3 · fabric 0.19.5 · 48 files): horizon-launcher modpack port fabulously-optimized $ horizon-launcher mods search --source curseforge x error: CurseForge needs an API key: HORIZON_CURSEFORGE_API_KEY (docs/mod-browser.md). ``` ## Self-check (Mac mini) ``` cd launcher cargo fmt --check ok set -o pipefail; cargo clippy --all-targets --features gpui/runtime_shaders -- -D warnings ok cargo test --features gpui/runtime_shaders lib 94 passed (2 ignored: network), bins 12 + 1 passed python3 tools/parity.py --list --changed origin/main 0 of 326 harnesses (launcher only) ``` New tests use a fake in-memory source: - install with a dependency, then reinstall (nothing downloaded), update (old file gone), remove; - a tampered file, a Java-mod dependency or a player's own file of the same name each leave nothing installed and the player's file untouched; - what doesn't run is refused; - a shader pack lands in `shaderpacks/`; - a modpack download is checked. ## Needs Ludovic Nothing new. The CurseForge key is described in #1141. Part of #577. 🤖 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-02 16:01: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#3099
No description provided.