[PR #2306] [MERGED] game: a mod's recipe pages in the item panel #4190

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

📋 Pull Request Information

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

Base: main ← Head: feat/mod-recipe-pages-game


📝 Commits (5)

  • ad557fe game: a mod's recipe pages in the item panel
  • eb66e42 Merge feat/mod-recipe-pages into feat/mod-recipe-pages-game
  • 5d70978 game: station tabs on the recipe pages
  • 69bb813 game: cut a recipe page's title with an ellipsis
  • 0cba2ed Merge branch 'feat/mod-recipe-pages' into feat/mod-recipe-pages-game

📊 Changes

3 files changed (+594 additions, -24 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+2 -0)
📝 crates/horizon-client/src/game/mod_browser.rs (+69 -24)
➕ crates/horizon-client/src/game/mod_browser_recipes.rs (+523 -0)

📄 Description

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

Part B2b of the recipe-viewer plan: the game side of browser.set-recipes (#2305). Stacked on #2305, then #2301, #2300 and #2284. Written from vanilla 26.3's screens and widgets; no other recipe viewer was looked at.

What it does

When a mod calls set-recipes, the item panel shows its recipes in place of the items. The search box stays.

  • Layouts. Each layout uses the game's own sprites: slot backgrounds, the furnace's arrow and flame, and small vanilla buttons:
    • grid: up to 3 x 3 slots, an arrow, the result;
    • cooking: the input over a flame;
    • single, smithing and brewing: 1, 3 or 2 inputs in a row.
  • The rest of a recipe. The note sits under it. The action button sits beside the result, or under it when the panel is too narrow (as in the screenshot run at GUI scale 3, 1280×720, where the panel has 6 columns).
  • Station tabs. A row of tabs above the recipes shows the stations the mod sent, each its item in a slot sprite, with a white frame on the selected one. A click sends tab to the mod; changing tab starts again at the first page. R/U and tooltips work on a tab's item.
  • Cycling. Slots cycle through their stacks once a second.
  • Pages. As many recipes as fit the panel's height make a page, with the recipe book's arrows and "page/pages". A title row holds a vanilla Back button and the title, cut to fit. Sending the same title again (the mod updating its buttons) keeps the page.
  • Events to the mod. Clicks on slots (left or right, with the stack shown), the action button (only when enabled), the arrows (page, with the first recipe shown) and Back.
  • Tooltips and keys. Tooltips and the mods' own keys (R/U) work on the recipes' stacks as they do on the items.
  • For agents. horizon-ctl ui lists the slots as " :", the action buttons as "+ ", the tabs as " tab", and Back.

Checks

  • pr_ready over both PRs (base #2301). cargo clippy -p horizon-client --bins -D warnings is also clean with --features mods and with --no-default-features.

pr_ready (tools/pr_ready.py --quick --base feat/mod-item-panel on ludovics-mac-mini, against feat/mod-item-panel at 763fc284e, 3 min 52 s)

Check Result
Scope ⚠️ 11 files, +711 −33; 602 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (6 s)
clippy ✅ (20 s)
tests: horizon-client, horizon-mod-sdk, horizon-mods, horizon-mods-test-ui-guest ✅ 1369 passed (2 min 47 s)
doc tests ✅ 2 passed (20 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (1 s)
launcher clippy ✅ (6 s)
launcher tests ✅ 132 passed (11 s)
Parity ➖ 99 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 87 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)
  • E2E (scratch driver, test UI guest, /browser_recipes minecraft:iron_ingot): 98/98 across in-frame, server thread, LAN guest (host in-frame), LAN guest (host on its server thread) and a dedicated server's guest. That covers the B1 checks, plus:
    • the recipe pages show with Back;
    • a right click on the result slot sends slot R S minecraft:iron_ingot;
    • an enabled action button sends action N;
    • "Next Page" sends page N;
    • the Furnace tab is listed and a click on it sends tab N;
    • Back sends back;
    • an empty list goes back to the items;
    • no panic and no stopped mod.

🤖 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/2306 **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-recipe-pages-game` --- ### 📝 Commits (5) - [`ad557fe`](https://github.com/horizon-rust/horizon/commit/ad557fef4708767d3e60ab24f173192af04716e6) game: a mod's recipe pages in the item panel - [`eb66e42`](https://github.com/horizon-rust/horizon/commit/eb66e42e387756f6801133dcdacab54d1c380fb1) Merge feat/mod-recipe-pages into feat/mod-recipe-pages-game - [`5d70978`](https://github.com/horizon-rust/horizon/commit/5d7097877bccd89bd0e448b875706ec8006ecdbf) game: station tabs on the recipe pages - [`69bb813`](https://github.com/horizon-rust/horizon/commit/69bb81312816fc283a3c74c02c365e7391ef6608) game: cut a recipe page's title with an ellipsis - [`0cba2ed`](https://github.com/horizon-rust/horizon/commit/0cba2edbd48758f2f7958e531df2c0850e16a062) Merge branch 'feat/mod-recipe-pages' into feat/mod-recipe-pages-game ### 📊 Changes **3 files changed** (+594 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+2 -0) 📝 `crates/horizon-client/src/game/mod_browser.rs` (+69 -24) ➕ `crates/horizon-client/src/game/mod_browser_recipes.rs` (+523 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Part B2b of the recipe-viewer plan: the game side of `browser.set-recipes` (#2305). Stacked on #2305, then #2301, #2300 and #2284. Written from vanilla 26.3's screens and widgets; no other recipe viewer was looked at. ## What it does When a mod calls `set-recipes`, the item panel shows its recipes in place of the items. The search box stays. - **Layouts.** Each layout uses the game's own sprites: slot backgrounds, the furnace's arrow and flame, and small vanilla buttons: - `grid`: up to 3 x 3 slots, an arrow, the result; - `cooking`: the input over a flame; - `single`, `smithing` and `brewing`: 1, 3 or 2 inputs in a row. - **The rest of a recipe.** The note sits under it. The action button sits beside the result, or under it when the panel is too narrow (as in the screenshot run at GUI scale 3, 1280×720, where the panel has 6 columns). - **Station tabs.** A row of tabs above the recipes shows the stations the mod sent, each its item in a slot sprite, with a white frame on the selected one. A click sends `tab` to the mod; changing tab starts again at the first page. R/U and tooltips work on a tab's item. - **Cycling.** Slots cycle through their stacks once a second. - **Pages.** As many recipes as fit the panel's height make a page, with the recipe book's arrows and "page/pages". A title row holds a vanilla Back button and the title, cut to fit. Sending the same title again (the mod updating its buttons) keeps the page. - **Events to the mod.** Clicks on slots (left or right, with the stack shown), the action button (only when enabled), the arrows (`page`, with the first recipe shown) and Back. - **Tooltips and keys.** Tooltips and the mods' own keys (R/U) work on the recipes' stacks as they do on the items. - **For agents.** `horizon-ctl ui` lists the slots as "<item> <recipe>:<slot>", the action buttons as "+ <recipe>", the tabs as "<item> tab", and Back. ## Checks - **pr_ready** over both PRs (base #2301). `cargo clippy -p horizon-client --bins -D warnings` is also clean with `--features mods` and with `--no-default-features`. **pr_ready** (`tools/pr_ready.py --quick --base feat/mod-item-panel` on ludovics-mac-mini, against feat/mod-item-panel at 763fc284e, 3 min 52 s) | Check | Result | | --- | --- | | Scope | ⚠️ 11 files, +711 −33; 602 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (6 s) | | clippy | ✅ (20 s) | | tests: horizon-client, horizon-mod-sdk, horizon-mods, horizon-mods-test-ui-guest | ✅ 1369 passed (2 min 47 s) | | doc tests | ✅ 2 passed (20 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (1 s) | | launcher clippy | ✅ (6 s) | | launcher tests | ✅ 132 passed (11 s) | | Parity | ➖ 99 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 87 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | - **E2E** (scratch driver, test UI guest, `/browser_recipes minecraft:iron_ingot`): 98/98 across in-frame, server thread, LAN guest (host in-frame), LAN guest (host on its server thread) and a dedicated server's guest. That covers the B1 checks, plus: - the recipe pages show with Back; - a right click on the result slot sends `slot R S minecraft:iron_ingot`; - an enabled action button sends `action N`; - "Next Page" sends `page N`; - the Furnace tab is listed and a click on it sends `tab N`; - Back sends `back`; - an empty list goes back to the items; - no panic and no stopped mod. 🤖 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:21 +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#4190
No description provided.