[PR #6633] [MERGED] Hide underlying containers while a book screen is open #7000

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6633
Author: @xMelonekMaX
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/book-menu-visibility


📝 Commits (1)

  • 0d95220 fix: hide the underlying menu while a book is open

📊 Changes

4 files changed (+130 additions, -7 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+2 -2)
📝 crates/horizon-client/src/game/books.rs (+1 -1)
📝 crates/horizon-client/src/game/ui_control.rs (+1 -0)
📝 tools/server_e2e.py (+126 -4)

📄 Description

🤖 Opened by xMelonekMaX's AI agent (Codex, GPT-6), not by xMelonekMaX personally.

What and why

When a server opens a written book while Horizon retains an inventory or container screen, both interfaces are drawn at once. Closing the book also captures the mouse even though the retained menu needs the pointer.

Render the book as the active interface: suppress the underlying menu and its native screen render hook, and omit its slots from the agent UI while the book is open. When the book closes, leave the pointer available if a menu remains open. The existing retained menu state is preserved.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Inspected the pinned Minecraft Java Edition 26.3 client jar with javap:

  • ClientPacketListener.handleOpenBook opens the written book screen.
  • MenuScreens.ScreenConstructor.fromPacket opens a container screen.
  • Gui.setScreen and Screen.onClose manage the active screen and mouse state.

Vanilla has one active screen; book and container packets replace it in arrival order. This correction addresses Horizon drawing and exposing two interfaces simultaneously. It preserves Horizon's existing retained menu; it does not implement a packet queue or claim that vanilla automatically queues an inventory behind a book. Exact packet ordering in the reported plugin sequence has not been captured.

Extended tools/server_e2e.py with book_menu. A real vanilla dedicated server supplies a written book and a chest menu; a standalone packet proxy injects the OpenBook packet. The check verifies exclusive book UI, page navigation, return to the retained container, and an available mouse pointer. This is a Horizon network end-to-end regression test, not a differential test of vanilla screen transitions.

Other projects' code

none

Verification

  • Before the correction, book_menu fails because container slots remain exposed while the book is open; the screenshot also shows overlapping interfaces.
  • After the correction, book_menu passes: the book excludes menu slots, page navigation works, closing the book restores the retained container, and the mouse remains available.
  • On the independent branch at 0d95220d4, book_menu, dialog and titles all pass together on a local vanilla server. No container-close fix or close-dialog test is included in that run. Earlier stacked validation is preserved only as historical evidence.
  • Fast build with --no-default-features, focused game-binary Clippy with warnings denied, formatting and public-tree checks pass.
  • The full affected parity matrix has not been run.

Self-check

pr_ready (tools/pr_ready.py --quick on 192, against origin/main at 81e528f92, 1 min 33 s)

Check Result
Scope ✅ 6 files, +133 −7
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 598 passed (50 s)
rustfmt ✅ (14 s)
clippy ❌ failed (3 s)
tests: horizon-client ❌ failed (16 s)
doc tests ❌ failed (6 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 373 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, armor_stand_frost, arrow, arrow_wind_charge, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes and 361 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

This is not a clean full self-check. All 598 Python tests, rustfmt and public-tree checks pass on the updated base. The default-feature Rust tests and doc tests cannot build without ALSA development metadata (alsa.pc). The runner's Clippy fails with an incompatible cached Rust dependency (E0514); its toolchain differs from the Fedora compiler used by the successful no-default-features fast build. The 373 affected parity harnesses were listed, not run.

The runner included two unrelated untracked text files in its scope; they are excluded from this PR. The actual diff is four files, +130/−7. The independent branch is based directly on main 81e528f92; no container-close commit is included.

Screenshots

Before After
Before After

🤖 Generated with Codex


🔄 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/6633 **Author:** [@xMelonekMaX](https://github.com/xMelonekMaX) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/book-menu-visibility` --- ### 📝 Commits (1) - [`0d95220`](https://github.com/horizon-rust/horizon/commit/0d95220d49ade8173b9057fefacdfe13c43b6f11) fix: hide the underlying menu while a book is open ### 📊 Changes **4 files changed** (+130 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+2 -2) 📝 `crates/horizon-client/src/game/books.rs` (+1 -1) 📝 `crates/horizon-client/src/game/ui_control.rs` (+1 -0) 📝 `tools/server_e2e.py` (+126 -4) </details> ### 📄 Description > 🤖 Opened by xMelonekMaX's AI agent (Codex, GPT-6), not by xMelonekMaX personally. ## What and why When a server opens a written book while Horizon retains an inventory or container screen, both interfaces are drawn at once. Closing the book also captures the mouse even though the retained menu needs the pointer. Render the book as the active interface: suppress the underlying menu and its native screen render hook, and omit its slots from the agent UI while the book is open. When the book closes, leave the pointer available if a menu remains open. The existing retained menu state is preserved. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Inspected the pinned Minecraft Java Edition 26.3 client jar with `javap`: - `ClientPacketListener.handleOpenBook` opens the written book screen. - `MenuScreens.ScreenConstructor.fromPacket` opens a container screen. - `Gui.setScreen` and `Screen.onClose` manage the active screen and mouse state. Vanilla has one active screen; book and container packets replace it in arrival order. This correction addresses Horizon drawing and exposing two interfaces simultaneously. It preserves Horizon's existing retained menu; it does not implement a packet queue or claim that vanilla automatically queues an inventory behind a book. Exact packet ordering in the reported plugin sequence has not been captured. Extended `tools/server_e2e.py` with `book_menu`. A real vanilla dedicated server supplies a written book and a chest menu; a standalone packet proxy injects the OpenBook packet. The check verifies exclusive book UI, page navigation, return to the retained container, and an available mouse pointer. This is a Horizon network end-to-end regression test, not a differential test of vanilla screen transitions. ## Other projects' code none ## Verification - Before the correction, `book_menu` fails because container slots remain exposed while the book is open; the screenshot also shows overlapping interfaces. - After the correction, `book_menu` passes: the book excludes menu slots, page navigation works, closing the book restores the retained container, and the mouse remains available. - On the independent branch at `0d95220d4`, `book_menu`, `dialog` and `titles` all pass together on a local vanilla server. No container-close fix or close-dialog test is included in that run. Earlier stacked validation is preserved only as historical evidence. - Fast build with `--no-default-features`, focused game-binary Clippy with warnings denied, formatting and public-tree checks pass. - The full affected parity matrix has not been run. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on 192, against origin/main at 81e528f92, 1 min 33 s) | Check | Result | | --- | --- | | Scope | ✅ 6 files, +133 −7 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 598 passed (50 s) | | rustfmt | ✅ (14 s) | | clippy | ❌ failed (3 s) | | tests: horizon-client | ❌ failed (16 s) | | doc tests | ❌ failed (6 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 373 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, armor_stand_frost, arrow, arrow_wind_charge, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes and 361 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | This is not a clean full self-check. All 598 Python tests, rustfmt and public-tree checks pass on the updated base. The default-feature Rust tests and doc tests cannot build without ALSA development metadata (`alsa.pc`). The runner's Clippy fails with an incompatible cached Rust dependency (E0514); its toolchain differs from the Fedora compiler used by the successful no-default-features fast build. The 373 affected parity harnesses were listed, not run. The runner included two unrelated untracked text files in its scope; they are excluded from this PR. The actual diff is four files, +130/−7. The independent branch is based directly on main `81e528f92`; no container-close commit is included. ## Screenshots | Before | After | | --- | --- | | ![Before](https://github.com/user-attachments/assets/9240b448-9f02-4bdc-a71e-1d01a092dad5) | ![After](https://github.com/user-attachments/assets/1de5e206-1c85-48a4-b82b-692cd249c771) | 🤖 Generated with [Codex](https://openai.com/codex/) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:31: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#7000
No description provided.