[PR #1469] [MERGED] Creative search tab: number keys over a slot move its item to the hotbar #3545

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

📋 Pull Request Information

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

Base: main ← Head: fix/creative-search-hotbar-keys


📝 Commits (2)

  • 717f54b Creative search tab: number keys over a slot move its item to the hotbar
  • 85c6103 Merge remote-tracking branch 'origin/main' into fix/creative-search-hotbar-keys

📊 Changes

2 files changed (+108 additions, -14 deletions)

View changed files

📝 crates/horizon-client/src/creative.rs (+39 -0)
📝 crates/horizon-client/src/game.rs (+69 -14)

📄 Description

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

Fixes #1460: on the creative Search tab, pressing a number key while hovering a slot typed the digit into the search box instead of moving the item to that hotbar slot.

Vanilla 26.3

CreativeModeInventoryScreen.keyPressed on the search tab sets ignoreTextInput and returns checkHotbarKeyPressed first, when all of these hold:

  • the key is a digit or keypad key (isNumericKey) bound to a hotbar slot
  • the hovered slot has an item, or isn't a display slot
  • the cursor stack is empty

In every other case (an empty display slot, no slot hovered, a stack held) the key goes to the search box.

Change

  • creative::search_key_swaps encodes that rule.
  • Game::search_tab_hotbar_key applies it to the hovered slot and swaps with inventory_hotkey. Both the window's keyboard input and scripted key presses go through it.

Tests

  • creative::tests::search_tab_number_keys_swap_over_a_slot_before_typing covers each branch of the rule.
  • In game (Mac mini, Metal), Search tab with "log" typed:
    • key 3 over Oak Log: on main the hotbar doesn't change and "3" is typed; after the change, 64 oak logs land in hotbar slot 3
    • an empty display slot plus key 6: the key is typed, no swap
    • bedrock plus key 7: swaps
    • --server-thread: the swapped stack reaches the server (/clear counts 64 oak logs)
before (main) after

Self-check

These checks ran on one integration commit with #1467, #1468, #1469, #1470 and #1471 merged on main (Mac mini):

  • cargo fmt --all -- --check: clean
  • cargo clippy --workspace --all-targets -- -D warnings: clean. The first run was on main at 8a4ebcc55, with the two functions #1472 restores added in a local commit. The final run, on main with #1472 merged, is clean too.
  • cargo test -p horizon-client --lib: 1063 passed. --bins: 98 + 18 passed.
  • tools/parity.py --changed origin/main: 309/310 passed in 69.8 min, the same run as the clippy check above. The one failure, menu_click, was the loom case fixed in #1467's second commit. On the refreshed integration commit (main with #1472, plus all five branches), menu_click passes: 8000/8000 with seed 7 and with seed 11.

Needs Ludovic

Nothing.

🤖 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/1469 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/creative-search-hotbar-keys` --- ### 📝 Commits (2) - [`717f54b`](https://github.com/horizon-rust/horizon/commit/717f54bf281cd81952af1382b5ba8cfcfd14daab) Creative search tab: number keys over a slot move its item to the hotbar - [`85c6103`](https://github.com/horizon-rust/horizon/commit/85c6103d45ae3d5335feb41a156b7554876299a8) Merge remote-tracking branch 'origin/main' into fix/creative-search-hotbar-keys ### 📊 Changes **2 files changed** (+108 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/creative.rs` (+39 -0) 📝 `crates/horizon-client/src/game.rs` (+69 -14) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #1460: on the creative Search tab, pressing a number key while hovering a slot typed the digit into the search box instead of moving the item to that hotbar slot. ## Vanilla 26.3 `CreativeModeInventoryScreen.keyPressed` on the search tab sets `ignoreTextInput` and returns `checkHotbarKeyPressed` first, when all of these hold: - the key is a digit or keypad key (`isNumericKey`) bound to a hotbar slot - the hovered slot has an item, or isn't a display slot - the cursor stack is empty In every other case (an empty display slot, no slot hovered, a stack held) the key goes to the search box. ## Change - `creative::search_key_swaps` encodes that rule. - `Game::search_tab_hotbar_key` applies it to the hovered slot and swaps with `inventory_hotkey`. Both the window's keyboard input and scripted key presses go through it. ## Tests - `creative::tests::search_tab_number_keys_swap_over_a_slot_before_typing` covers each branch of the rule. - In game (Mac mini, Metal), Search tab with "log" typed: - key 3 over Oak Log: on main the hotbar doesn't change and "3" is typed; after the change, 64 oak logs land in hotbar slot 3 - an empty display slot plus key 6: the key is typed, no swap - bedrock plus key 7: swaps - `--server-thread`: the swapped stack reaches the server (`/clear` counts 64 oak logs) | before (main) | after | |---|---| | ![](https://raw.githubusercontent.com/ludovic111/horizon/c5d43f6e724a6e9c6ad44ed4b6fc33fcfa081392/1460/search-before.png) | ![](https://raw.githubusercontent.com/ludovic111/horizon/c5d43f6e724a6e9c6ad44ed4b6fc33fcfa081392/1460/search-after.png) | ## Self-check These checks ran on one integration commit with #1467, #1468, #1469, #1470 and #1471 merged on main (Mac mini): - `cargo fmt --all -- --check`: clean - `cargo clippy --workspace --all-targets -- -D warnings`: clean. The first run was on main at 8a4ebcc55, with the two functions #1472 restores added in a local commit. The final run, on main with #1472 merged, is clean too. - `cargo test -p horizon-client --lib`: 1063 passed. `--bins`: 98 + 18 passed. - `tools/parity.py --changed origin/main`: 309/310 passed in 69.8 min, the same run as the clippy check above. The one failure, `menu_click`, was the loom case fixed in #1467's second commit. On the refreshed integration commit (main with #1472, plus all five branches), `menu_click` passes: 8000/8000 with seed 7 and with seed 11. ## Needs Ludovic Nothing. 🤖 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:10:19 +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#3545
No description provided.