[PR #2305] [MERGED] mods: browser.set-recipes, recipes in the item panel's place #4189

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

📋 Pull Request Information

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

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


📝 Commits (3)

  • fc9305b mods: browser.set-recipes, recipes in the item panel's place
  • 6a62ad6 mods: set-recipes takes a row of tabs, and the tab event says which one the player picked
  • a373eea Merge branch 'feat/mod-item-panel' into feat/mod-recipe-pages

📊 Changes

8 files changed (+272 additions, -9 deletions)

View changed files

📝 crates/horizon-mod-sdk/wit/horizon.wit (+37 -0)
📝 crates/horizon-mods/src/api_level.rs (+2 -1)
📝 crates/horizon-mods/src/runtime.rs (+70 -5)
📝 crates/horizon-mods/tests/sandbox.rs (+56 -0)
📝 crates/horizon-mods/tests/ui_guest/src/lib.rs (+77 -1)
📝 docs/api/mods-reference.md (+28 -0)
📝 docs/api/stability.md (+1 -1)
📝 docs/mods.md (+1 -1)

📄 Description

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

Part B2a of the recipe-viewer plan: browser.set-recipes, the API for recipe pages. Stacked on #2301, then #2300 and #2284.

What it adds

set-recipes(title, tabs, tab, list<recipe-view>) shows the mod's recipes in the item panel's place. An empty list shows the items again. tabs is a row of stations (each a stack, such as a crafting table or a furnace, at most 16) and tab the selected one; a click on a tab sends the new event tab(u32), so the mod sends that station's recipes. A recipe-view has these fields:

  • layout: grid (a crafting grid of width x height, at most 3 x 3), cooking (one input over a flame), single (one input, the stonecutter), smithing (template, base, addition) or brewing (potion and ingredient).
  • slots: each slot's stacks, cycled once a second by the game. results cycles the same way.
  • note: a short line under the recipe, such as a cooking time.
  • action: an optional button beside the result. None, enabled, or shown greyed.

The game pages the recipes and sends the events #2300 already declares: slot-clicked (recipe index, slot index with the result after the slots, the stack shown, which button), action, page (the first recipe now shown) and back. At most 256 recipes, 9 slots each, and 64 stacks per slot. It takes the same API level as the rest of browser, since none of it has shipped.

Checks

  • The sandbox test browser_lists_items_and_hears_the_player now has the test guest show the recipes for planks from a small recipes table. It checks the title, the tabs and the selected tab, the layout, the size, a greyed action, the slots and results, and that an empty list clears them.
  • api_reference passes; mods-reference.md is regenerated.
  • The game side is the next PR, with its e2e.

🤖 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/2305 **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` --- ### 📝 Commits (3) - [`fc9305b`](https://github.com/horizon-rust/horizon/commit/fc9305bb155c090b35daa3534bcdf4d4daacb92f) mods: browser.set-recipes, recipes in the item panel's place - [`6a62ad6`](https://github.com/horizon-rust/horizon/commit/6a62ad67cce8fd23254f285ef6ba7881809216c7) mods: set-recipes takes a row of tabs, and the tab event says which one the player picked - [`a373eea`](https://github.com/horizon-rust/horizon/commit/a373eea1898035d9f2630f48d787d43f2d871fc1) Merge branch 'feat/mod-item-panel' into feat/mod-recipe-pages ### 📊 Changes **8 files changed** (+272 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-mod-sdk/wit/horizon.wit` (+37 -0) 📝 `crates/horizon-mods/src/api_level.rs` (+2 -1) 📝 `crates/horizon-mods/src/runtime.rs` (+70 -5) 📝 `crates/horizon-mods/tests/sandbox.rs` (+56 -0) 📝 `crates/horizon-mods/tests/ui_guest/src/lib.rs` (+77 -1) 📝 `docs/api/mods-reference.md` (+28 -0) 📝 `docs/api/stability.md` (+1 -1) 📝 `docs/mods.md` (+1 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Part B2a of the recipe-viewer plan: `browser.set-recipes`, the API for recipe pages. Stacked on #2301, then #2300 and #2284. ## What it adds `set-recipes(title, tabs, tab, list<recipe-view>)` shows the mod's recipes in the item panel's place. An empty list shows the items again. `tabs` is a row of stations (each a `stack`, such as a crafting table or a furnace, at most 16) and `tab` the selected one; a click on a tab sends the new event `tab(u32)`, so the mod sends that station's recipes. A `recipe-view` has these fields: - `layout`: `grid` (a crafting grid of `width` x `height`, at most 3 x 3), `cooking` (one input over a flame), `single` (one input, the stonecutter), `smithing` (template, base, addition) or `brewing` (potion and ingredient). - `slots`: each slot's stacks, cycled once a second by the game. `results` cycles the same way. - `note`: a short line under the recipe, such as a cooking time. - `action`: an optional button beside the result. None, enabled, or shown greyed. The game pages the recipes and sends the events #2300 already declares: `slot-clicked` (recipe index, slot index with the result after the slots, the stack shown, which button), `action`, `page` (the first recipe now shown) and `back`. At most 256 recipes, 9 slots each, and 64 stacks per slot. It takes the same API level as the rest of `browser`, since none of it has shipped. ## Checks - The sandbox test `browser_lists_items_and_hears_the_player` now has the test guest show the recipes for planks from a small `recipes` table. It checks the title, the tabs and the selected tab, the layout, the size, a greyed action, the slots and results, and that an empty list clears them. - `api_reference` passes; mods-reference.md is regenerated. - The game side is the next PR, with its e2e. 🤖 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:20 +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#4189
No description provided.