[PR #2301] [MERGED] game: the item panel of a mod's browser beside container screens #4185

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

📋 Pull Request Information

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

Base: main ← Head: feat/mod-item-panel


📝 Commits (3)

  • 487a461 game: the item panel of a mod's browser beside container screens
  • 763fc28 Merge feat/mod-item-panel-api into feat/mod-item-panel
  • a2cd70e Merge branch 'feat/mod-item-panel-api' into feat/mod-item-panel

📊 Changes

6 files changed (+493 additions, -17 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+34 -16)
📝 crates/horizon-client/src/game/control.rs (+3 -0)
➕ crates/horizon-client/src/game/mod_browser.rs (+440 -0)
📝 crates/horizon-client/src/game/mod_input.rs (+12 -0)
📝 crates/horizon-client/src/game/mod_recipes.rs (+1 -1)
📝 crates/horizon-client/src/game/mods.rs (+3 -0)

📄 Description

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

Part B1b of the recipe-viewer plan: the game side of browser (#2300). The official recipe viewer mod will show its item list here. It is written from vanilla 26.3's recipe book and Horizon's own design, without looking at any other recipe viewer. Stacked on #2300, which is stacked on #2284.

What players get

Nothing on their own: the panel shows only while a mod puts items in it (browser.set-items).

  • Where it is. Right of the inventory or container window, on the survival inventory and every container screen (not the creative inventory). It runs from the top of the screen to a search box at its foot, in up to 12 columns of 18 px item slots, with the recipe book's page arrows and "page/pages" above. Where there is no room for two columns (a small window with the recipe book open), it hides.
  • Vanilla widgets only. It uses the game's item rendering, slot highlight, tooltips, EditBox and the recipe book's arrow sprites, as Horizon's other in-game pages do (docs/design-system.md).
  • What the mod hears.
    • A click on an item.
    • The search text each time it changes.
    • Its own keys (input.register-key, so rebindable in Controls) pressed while the pointer is on an item, the panel's or any slot's. A recipe viewer uses this for R and U.
  • Behaviour.
    • A click on the panel never throws the carried stack.
    • The carried stack and the slot tooltip are drawn again above the panel.
    • The search box takes every key but Escape while focused, as the recipe book's does, so E types instead of closing.
    • Each set-items is turned into stacks once, not every frame.
  • horizon-ctl ui lists the panel's items by name, plus "Next Page", "Previous Page" and the search field, so agents can drive it.

Checks

  • pr_ready, over both PRs (base #2284), plus cargo clippy -p horizon-client --features mods --bins -D warnings and --no-default-features, both clean:

pr_ready (tools/pr_ready.py --quick --base feat/mod-recipes-read on ludovics-mac-mini, against feat/mod-recipes-read at 409a82812, 6 min 34 s)

Check Result
Scope ⚠️ 16 files, +811 −27; 649 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (formatted after this run; cargo fmt --all -- --check passes)
clippy ✅ (51 s)
tests: horizon-client, horizon-mod-sdk, horizon-mods, horizon-mods-test-ui-guest ✅ 1369 passed (4 min 33 s)
doc tests ✅ 2 passed (36 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (1 s)
launcher clippy ✅ (6 s)
launcher tests ✅ 132 passed (16 s)
Parity ➖ 115 affected, to run in CI (--quick): ambient_sound, arrow, audio_attributes, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, block_transformer, breaking_model, camera and 103 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)
  • E2E (scratch driver, horizon-ctl and the test UI guest's /browser 400 and /browser_poll): 57/57 checks across in-frame, server thread, LAN guest (host in-frame), LAN guest (host on its server thread) and a dedicated server's guest. The checks:
    • the panel shows on the survival inventory;
    • "Next Page" pages it;
    • a click on Granite reaches the mod as clicked 1 left;
    • R over a panel item reaches it as key recipe on minecraft:granite x1;
    • U over an inventory slot reaches it as key uses on minecraft:oak_log x…;
    • typing "oak" in the box sends search "oak";
    • an empty list hides the panel;
    • no panic and no stopped mod.
  • Not covered by the e2e: E typed into the focused box (horizon-ctl's key doesn't go through the window's keyboard events). The guard is the recipe book search's, line for line.
  • No-mod path: one check per hook (browser_items() is None). --no-default-features builds with the stubs.

🤖 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/2301 **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-item-panel` --- ### 📝 Commits (3) - [`487a461`](https://github.com/horizon-rust/horizon/commit/487a461a8a7454871aaf92e11466cadc9504699b) game: the item panel of a mod's browser beside container screens - [`763fc28`](https://github.com/horizon-rust/horizon/commit/763fc284edccb5fa214ba9ed50532440b1068fd2) Merge feat/mod-item-panel-api into feat/mod-item-panel - [`a2cd70e`](https://github.com/horizon-rust/horizon/commit/a2cd70e8e188e0a63e296415d10f81797f33eae0) Merge branch 'feat/mod-item-panel-api' into feat/mod-item-panel ### 📊 Changes **6 files changed** (+493 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+34 -16) 📝 `crates/horizon-client/src/game/control.rs` (+3 -0) ➕ `crates/horizon-client/src/game/mod_browser.rs` (+440 -0) 📝 `crates/horizon-client/src/game/mod_input.rs` (+12 -0) 📝 `crates/horizon-client/src/game/mod_recipes.rs` (+1 -1) 📝 `crates/horizon-client/src/game/mods.rs` (+3 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Part B1b of the recipe-viewer plan: the game side of `browser` (#2300). The official recipe viewer mod will show its item list here. It is written from vanilla 26.3's recipe book and Horizon's own design, without looking at any other recipe viewer. Stacked on #2300, which is stacked on #2284. ## What players get Nothing on their own: the panel shows only while a mod puts items in it (`browser.set-items`). - **Where it is.** Right of the inventory or container window, on the survival inventory and every container screen (not the creative inventory). It runs from the top of the screen to a search box at its foot, in up to 12 columns of 18 px item slots, with the recipe book's page arrows and "page/pages" above. Where there is no room for two columns (a small window with the recipe book open), it hides. - **Vanilla widgets only.** It uses the game's item rendering, slot highlight, tooltips, `EditBox` and the recipe book's arrow sprites, as Horizon's other in-game pages do (docs/design-system.md). - **What the mod hears.** - A click on an item. - The search text each time it changes. - Its own keys (`input.register-key`, so rebindable in Controls) pressed while the pointer is on an item, the panel's or any slot's. A recipe viewer uses this for R and U. - **Behaviour.** - A click on the panel never throws the carried stack. - The carried stack and the slot tooltip are drawn again above the panel. - The search box takes every key but Escape while focused, as the recipe book's does, so E types instead of closing. - Each `set-items` is turned into stacks once, not every frame. - `horizon-ctl ui` lists the panel's items by name, plus "Next Page", "Previous Page" and the search field, so agents can drive it. ## Checks - **pr_ready**, over both PRs (base #2284), plus `cargo clippy -p horizon-client --features mods --bins -D warnings` and `--no-default-features`, both clean: **pr_ready** (`tools/pr_ready.py --quick --base feat/mod-recipes-read` on ludovics-mac-mini, against feat/mod-recipes-read at 409a82812, 6 min 34 s) | Check | Result | | --- | --- | | Scope | ⚠️ 16 files, +811 −27; 649 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (formatted after this run; `cargo fmt --all -- --check` passes) | | clippy | ✅ (51 s) | | tests: horizon-client, horizon-mod-sdk, horizon-mods, horizon-mods-test-ui-guest | ✅ 1369 passed (4 min 33 s) | | doc tests | ✅ 2 passed (36 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (1 s) | | launcher clippy | ✅ (6 s) | | launcher tests | ✅ 132 passed (16 s) | | Parity | ➖ 115 affected, to run in CI (--quick): ambient_sound, arrow, audio_attributes, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, block_transformer, breaking_model, camera and 103 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | - **E2E** (scratch driver, `horizon-ctl` and the test UI guest's `/browser 400` and `/browser_poll`): 57/57 checks across in-frame, server thread, LAN guest (host in-frame), LAN guest (host on its server thread) and a dedicated server's guest. The checks: - the panel shows on the survival inventory; - "Next Page" pages it; - a click on Granite reaches the mod as `clicked 1 left`; - R over a panel item reaches it as `key recipe on minecraft:granite x1`; - U over an inventory slot reaches it as `key uses on minecraft:oak_log x…`; - typing "oak" in the box sends `search "oak"`; - an empty list hides the panel; - no panic and no stopped mod. - **Not covered by the e2e**: E typed into the focused box (horizon-ctl's `key` doesn't go through the window's keyboard events). The guard is the recipe book search's, line for line. - **No-mod path**: one check per hook (`browser_items()` is None). `--no-default-features` builds with the stubs. 🤖 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:15:19 +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#4185
No description provided.