[PR #7141] [MERGED] Inventory: honor rebound numeric keys in creative search #7368

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

📋 Pull Request Information

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

Base: main ← Head: fix/creative-search-keybindings


📝 Commits (1)

  • efff801 Inventory: honor rebound numeric keys in creative search

📊 Changes

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

View changed files

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

📄 Description

🤖 Opened by masa-masa-0314's AI agent (ZCode, GPT-6), not by masa-masa-0314 personally.

What and why

Fixes #7134.

The creative inventory search tab dispatched physical 1–9 as fixed hotbar slots. Binding slot 1 to 0 therefore left 0 unable to swap, while the now-unbound 1 still swapped into slot 1. Keypad bindings and numeric offhand bindings were also ignored.

Resolve the physical numeric key through the existing KeyBinds::container_hotbar_key before dispatching the canonical swap action. This honors current hotbar/offhand bindings and their priority while retaining the numeric-only gate and existing hover/carried-stack restrictions. Unbound digits continue to search input. Tab and letter bindings keep vanilla's search-box behavior.

One function, +5/-4 lines. This is an adjacent defect found during #6892 investigation; it does not claim to fix that issue's Tab report.

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

Independently inspected the installed Minecraft 26.3 client jar with javap -c -p:

  • CreativeModeInventoryScreen.keyPressed: numeric-key quick swap before the search field; empty creative display slots cannot quick swap.
  • AbstractContainerScreen.checkHotbarKeyPressed: empty carried stack and hovered slot required; configured offhand binding before configured hotbar slots.
  • InputConstants.Key.getNumericKeyValue: main-keyboard and keypad digits 0–9 pass the numeric gate.

Temporary isolated Rust regression fixture extracts the actual old/new function and existing hover predicate, and uses the real horizon-client-input::KeyBinds. It verifies canonical dispatch for defaults, 0, removed old bindings, swapped digit assignments, all keypad digits, offhand priority, nonnumeric input, empty/no hovered slots, carried stacks and missing renderer. Baseline: 8 passed / 7 failed; repaired source: 15 passed / 0 failed. UI hit testing and downstream inventory operations are adapters, so this is dispatch validation, not GUI/end-to-end proof or a runtime vanilla oracle.

Per the contributor's workflow preference, this temporary fixture is archived locally and is not included in this PR. No new permanent regression coverage is added. Full vanilla parity harnesses were not run because this worktree lacks the runner's prepared data; the installed jar was used for bytecode inspection only. Port-ledger index validation was not run because no prepared index was available.

Other projects' code

None.

Self-check

Frozen upstream baseline: 185ebe0a68bae59b78c3fa91fa97aa02235f71a3. Checks ran on the final uncommitted production diff; after committing as efff801398f274d9cdc39aa54b322ad21fc79d7f, the committed file was verified byte-for-byte against that tested snapshot. Additional cargo check --locked -p horizon-client --lib and cargo clippy --locked -p horizon-client --lib -- -D warnings both exited 0.

The following is the original self-check block, unchanged:

pr_ready (tools/pr_ready.py --base 185ebe0a68bae59b78c3fa91fa97aa02235f71a3 on DESKTOP-3050AHP, against 185ebe0a68 at 185ebe0a6, 12 min 51 s)

Check Result
Scope ✅ 1 files, +5 −4
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 612 passed (3 min 18 s)
rustfmt ✅ (21 s)
clippy ✅ (2 min 50 s)
tests: horizon-client ✅ 662 passed (6 min 12 s)
doc tests ✅ 0 passed (5 s)
content root tests ➖ content root untouched
mod API up to date ➖ native hooks untouched
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)

Doc-test command matched zero tests; that row is not additional behavioral coverage.

Screenshots

Not captured. No visible game or GUI/end-to-end run was performed. The change affects keyboard dispatch; evidence above is bytecode inspection, the isolated regression fixture and repository checks.

🤖 Generated with ZCode (GPT-6).


🔄 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/7141 **Author:** [@masa-masa-0314](https://github.com/masa-masa-0314) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/creative-search-keybindings` --- ### 📝 Commits (1) - [`efff801`](https://github.com/horizon-rust/horizon/commit/efff801398f274d9cdc39aa54b322ad21fc79d7f) Inventory: honor rebound numeric keys in creative search ### 📊 Changes **1 file changed** (+5 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+5 -4) </details> ### 📄 Description > 🤖 Opened by masa-masa-0314's AI agent (ZCode, GPT-6), not by masa-masa-0314 personally. ## What and why Fixes #7134. The creative inventory search tab dispatched physical `1`–`9` as fixed hotbar slots. Binding slot 1 to `0` therefore left `0` unable to swap, while the now-unbound `1` still swapped into slot 1. Keypad bindings and numeric offhand bindings were also ignored. Resolve the physical numeric key through the existing `KeyBinds::container_hotbar_key` before dispatching the canonical swap action. This honors current hotbar/offhand bindings and their priority while retaining the numeric-only gate and existing hover/carried-stack restrictions. Unbound digits continue to search input. Tab and letter bindings keep vanilla's search-box behavior. One function, +5/-4 lines. This is an adjacent defect found during #6892 investigation; it does not claim to fix that issue's Tab report. ## 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 Independently inspected the installed Minecraft 26.3 client jar with `javap -c -p`: - `CreativeModeInventoryScreen.keyPressed`: numeric-key quick swap before the search field; empty creative display slots cannot quick swap. - `AbstractContainerScreen.checkHotbarKeyPressed`: empty carried stack and hovered slot required; configured offhand binding before configured hotbar slots. - `InputConstants.Key.getNumericKeyValue`: main-keyboard and keypad digits 0–9 pass the numeric gate. Temporary isolated Rust regression fixture extracts the actual old/new function and existing hover predicate, and uses the real `horizon-client-input::KeyBinds`. It verifies canonical dispatch for defaults, `0`, removed old bindings, swapped digit assignments, all keypad digits, offhand priority, nonnumeric input, empty/no hovered slots, carried stacks and missing renderer. Baseline: 8 passed / 7 failed; repaired source: 15 passed / 0 failed. UI hit testing and downstream inventory operations are adapters, so this is dispatch validation, not GUI/end-to-end proof or a runtime vanilla oracle. Per the contributor's workflow preference, this temporary fixture is archived locally and is not included in this PR. **No new permanent regression coverage is added.** Full vanilla parity harnesses were not run because this worktree lacks the runner's prepared data; the installed jar was used for bytecode inspection only. Port-ledger index validation was not run because no prepared index was available. ## Other projects' code None. ## Self-check Frozen upstream baseline: `185ebe0a68bae59b78c3fa91fa97aa02235f71a3`. Checks ran on the final uncommitted production diff; after committing as `efff801398f274d9cdc39aa54b322ad21fc79d7f`, the committed file was verified byte-for-byte against that tested snapshot. Additional `cargo check --locked -p horizon-client --lib` and `cargo clippy --locked -p horizon-client --lib -- -D warnings` both exited 0. The following is the original self-check block, unchanged: **pr_ready** (`tools/pr_ready.py --base 185ebe0a68bae59b78c3fa91fa97aa02235f71a3` on DESKTOP-3050AHP, against 185ebe0a68bae59b78c3fa91fa97aa02235f71a3 at 185ebe0a6, 12 min 51 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +5 −4 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 612 passed (3 min 18 s) | | rustfmt | ✅ (21 s) | | clippy | ✅ (2 min 50 s) | | tests: horizon-client | ✅ 662 passed (6 min 12 s) | | doc tests | ✅ 0 passed (5 s) | | content root tests | ➖ content root untouched | | mod API up to date | ➖ native hooks untouched | | 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) | Doc-test command matched zero tests; that row is not additional behavioral coverage. ## Screenshots Not captured. No visible game or GUI/end-to-end run was performed. The change affects keyboard dispatch; evidence above is bytecode inspection, the isolated regression fixture and repository checks. 🤖 Generated with ZCode (GPT-6). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:38:27 +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#7368
No description provided.