[PR #6650] [MERGED] Close waiting dialogs when the server closes the container #7012

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

📋 Pull Request Information

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

Base: main ← Head: fix/dialog-container-close


📝 Commits (3)

  • a40190c fix: close waiting dialogs on server container close
  • 9e0f4a8 Merge origin/main into fix/dialog-container-close
  • 2d257a0 Merge main into #6650

📊 Changes

2 files changed (+137 additions, -8 deletions)

View changed files

📝 crates/horizon-client/src/game/remote.rs (+11 -2)
📝 tools/server_e2e.py (+126 -6)

📄 Description

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

What and why

A Paper plugin can finish an action in a multi-action dialog configured with WAIT_FOR_RESPONSE by calling Player.closeInventory(). Vanilla handles the resulting container-close packet by dismissing the dialog. Horizon handled that packet only for a container screen or lectern, leaving the waiting screen open and its countdown running.

Handle container-close while an active dialog, its waiting screen or its warning overlay is open, discarding the underlying screen/menu state. Keep the separate clear-dialog behavior: it restores the parent screen and does not dismiss a waiting screen.

Fixes #6645

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.handleContainerClose calls LocalPlayer.clientSideCloseContainer.
  • LocalPlayer.clientSideCloseContainer sets the active screen to null through Gui.setScreen, including an active dialog, waiting screen or warning overlay.
  • The separate clear-dialog path restores a dialog's parent and leaves a waiting screen open.

Extended tools/server_e2e.py with dialog_close. A real vanilla dedicated server supplies the dialogs and menu state; a local proxy injects the pinned protocol's container-close packet. It covers the waiting screen, active dialog, parent container/chat/lectern, warning overlay, clear-dialog distinction, replacement dialog, held-key release and death. This is a Horizon network regression test, not a differential vanilla-client screen test.

Other projects' code

none

Verification

  • Before the correction, the container-close regression fails because the waiting screen remains open.
  • On current HEAD 9e0f4a8dd, dialog_close, dialog and titles pass together on a real local vanilla server. The regression checks waiting/active dialogs, warning overlays, retained parent screens and the distinct clear-dialog behavior, and guards prior key-release and death cleanup behavior.
  • The fast build with --no-default-features passes. Focused game-binary Clippy with warnings denied also passes using a consistent toolchain and separate target cache.
  • All 598 Python tests, rustfmt and public-tree checks pass in the current self-check.
  • 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 12 s)

Check Result
Scope ✅ 4 files, +217 −7
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 598 passed (41 s)
rustfmt ✅ (16 s)
clippy ❌ failed (8 s)
tests: horizon-client ❌ failed (2 s)
doc tests ❌ failed (4 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. The default-feature Rust checks cannot build without ALSA development metadata (alsa.pc); the runner's Clippy also encounters cached dependencies compiled by an incompatible Rust toolchain (E0514). The successful fast build and focused Clippy use --no-default-features; focused Clippy uses a consistent toolchain in a separate target cache. 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 two files, +214/−7, against main 81e528f92.

Screenshots

No screenshots included: this correction concerns packet-driven screen transitions. The dialog_close end-to-end test verifies that a container-close packet dismisses the dialog and its parent screen while preserving the distinct clear-dialog behavior.

🤖 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/6650 **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/dialog-container-close` --- ### 📝 Commits (3) - [`a40190c`](https://github.com/horizon-rust/horizon/commit/a40190c89612db2949c19997ecf96df6eff2098e) fix: close waiting dialogs on server container close - [`9e0f4a8`](https://github.com/horizon-rust/horizon/commit/9e0f4a8ddcda636124ebeaa729c505678f6897bd) Merge origin/main into fix/dialog-container-close - [`2d257a0`](https://github.com/horizon-rust/horizon/commit/2d257a0bdd48e78155d930cf9fe3243d83411823) Merge main into #6650 ### 📊 Changes **2 files changed** (+137 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote.rs` (+11 -2) 📝 `tools/server_e2e.py` (+126 -6) </details> ### 📄 Description > 🤖 Opened by xMelonekMaX's AI agent (Codex, GPT-6), not by xMelonekMaX personally. ## What and why A Paper plugin can finish an action in a multi-action dialog configured with `WAIT_FOR_RESPONSE` by calling `Player.closeInventory()`. Vanilla handles the resulting container-close packet by dismissing the dialog. Horizon handled that packet only for a container screen or lectern, leaving the waiting screen open and its countdown running. Handle container-close while an active dialog, its waiting screen or its warning overlay is open, discarding the underlying screen/menu state. Keep the separate clear-dialog behavior: it restores the parent screen and does not dismiss a waiting screen. Fixes #6645 ## 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.handleContainerClose` calls `LocalPlayer.clientSideCloseContainer`. - `LocalPlayer.clientSideCloseContainer` sets the active screen to null through `Gui.setScreen`, including an active dialog, waiting screen or warning overlay. - The separate clear-dialog path restores a dialog's parent and leaves a waiting screen open. Extended `tools/server_e2e.py` with `dialog_close`. A real vanilla dedicated server supplies the dialogs and menu state; a local proxy injects the pinned protocol's container-close packet. It covers the waiting screen, active dialog, parent container/chat/lectern, warning overlay, clear-dialog distinction, replacement dialog, held-key release and death. This is a Horizon network regression test, not a differential vanilla-client screen test. ## Other projects' code none ## Verification - Before the correction, the container-close regression fails because the waiting screen remains open. - On current HEAD `9e0f4a8dd`, `dialog_close`, `dialog` and `titles` pass together on a real local vanilla server. The regression checks waiting/active dialogs, warning overlays, retained parent screens and the distinct clear-dialog behavior, and guards prior key-release and death cleanup behavior. - The fast build with `--no-default-features` passes. Focused game-binary Clippy with warnings denied also passes using a consistent toolchain and separate target cache. - All 598 Python tests, rustfmt and public-tree checks pass in the current self-check. - 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 12 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +217 −7 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 598 passed (41 s) | | rustfmt | ✅ (16 s) | | clippy | ❌ failed (8 s) | | tests: horizon-client | ❌ failed (2 s) | | doc tests | ❌ failed (4 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. The default-feature Rust checks cannot build without ALSA development metadata (`alsa.pc`); the runner's Clippy also encounters cached dependencies compiled by an incompatible Rust toolchain (E0514). The successful fast build and focused Clippy use `--no-default-features`; focused Clippy uses a consistent toolchain in a separate target cache. 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 two files, +214/−7, against main `81e528f92`. ## Screenshots No screenshots included: this correction concerns packet-driven screen transitions. The `dialog_close` end-to-end test verifies that a container-close packet dismisses the dialog and its parent screen while preserving the distinct clear-dialog behavior. 🤖 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:32:06 +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#7012
No description provided.