[PR #1795] [MERGED] Fix ghost items in the inventory grid after closing a remote menu #3767

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

📋 Pull Request Information

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

Base: main ← Head: t3/fix-remote-close-ghost-grid


📝 Commits (1)

  • 87b3c9a Drop the stale craft grid when a remote menu closes

📊 Changes

1 file changed (+5 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game/remote.rs (+5 -0)

📄 Description

🤖 Opened by socksprox's AI agent (Devin, SWE-2 High), not by socksprox himself.

What and why

Closing a crafting table that still had items in its grid left ghost stacks in the inventory's 2×2 crafting grid: they rendered but could not be picked up, and vanished on the next server sync.

On the remote path (single-player server thread, LAN guest, multiplayer) remote_close_local reset craft_size and station but kept craft_grid and carried. The server's removed() had already returned those stacks to the inventory, so the client's copies were stale. It now drops them; the server's inventory syncs supply the real stacks.

Vanilla reference

AbstractContainerMenu.removed → Inventory.placeItemBackInInventory (clearContainer for crafting menus). The in-frame path already returns the grid in close_container; the host side does the same for guests in lan_crafting_closed → lan_place_back.

Self-check

pr_ready (tools/pr_ready.py on MacBookPro, against origin/main at d2c96af14, 29 s)

Check Result
Scope ✅ 1 files, +5 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (5 s)
clippy ✅ (1 s)
tests: horizon-client ✅ 1218 passed (20 s)
doc tests ✅ 0 passed (3 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Devin


🔄 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/1795 **Author:** [@socksprox](https://github.com/socksprox) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `t3/fix-remote-close-ghost-grid` --- ### 📝 Commits (1) - [`87b3c9a`](https://github.com/horizon-rust/horizon/commit/87b3c9aa38e5568733a2678d0332ad33e0e792e3) Drop the stale craft grid when a remote menu closes ### 📊 Changes **1 file changed** (+5 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote.rs` (+5 -0) </details> ### 📄 Description > 🤖 Opened by socksprox's AI agent (Devin, SWE-2 High), not by socksprox himself. ## What and why Closing a crafting table that still had items in its grid left ghost stacks in the inventory's 2×2 crafting grid: they rendered but could not be picked up, and vanished on the next server sync. On the remote path (single-player server thread, LAN guest, multiplayer) `remote_close_local` reset `craft_size` and `station` but kept `craft_grid` and `carried`. The server's `removed()` had already returned those stacks to the inventory, so the client's copies were stale. It now drops them; the server's inventory syncs supply the real stacks. ## Vanilla reference `AbstractContainerMenu.removed` → `Inventory.placeItemBackInInventory` (`clearContainer` for crafting menus). The in-frame path already returns the grid in `close_container`; the host side does the same for guests in `lan_crafting_closed` → `lan_place_back`. ## Self-check **pr_ready** (`tools/pr_ready.py` on MacBookPro, against origin/main at d2c96af14, 29 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +5 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (5 s) | | clippy | ✅ (1 s) | | tests: horizon-client | ✅ 1218 passed (20 s) | | doc tests | ✅ 0 passed (3 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Devin](https://devin.ai) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:12:10 +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#3767
No description provided.