[PR #395] [MERGED] Clicking a creative search result selects the query #2531

Closed
opened 2026-11-02 15:56:58 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

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


📝 Commits (2)

  • 5efb5ea Draw the quick craft drag as AbstractContainerScreen does
  • 3e0793a Select the creative search query when a result is clicked

📊 Changes

8 files changed (+243 additions, -46 deletions)

View changed files

📝 crates/horizon-client/src/clipboard.rs (+5 -1)
📝 crates/horizon-client/src/game.rs (+128 -25)
📝 crates/horizon-client/src/game/beacon.rs (+2 -2)
📝 crates/horizon-client/src/game/control.rs (+2 -2)
📝 crates/horizon-client/src/game/recipe_book.rs (+1 -1)
📝 crates/horizon-client/src/game/stations.rs (+4 -5)
📝 crates/horizon-client/src/game/trading.rs (+5 -5)
📝 crates/horizon-client/src/menu.rs (+96 -5)

📄 Description

Clicking a creative search result now selects the whole query, so the next character typed replaces it, as in vanilla. Part of #275.

CreativeModeInventoryScreen.slotClicked calls searchBox.moveCursorToEnd(false) then setHighlightPos(0) for any click on a display slot (isCreativeSlot). Horizon kept the query and appended to it. AppendSelection::select sets the selection, and display clicks on the search tab call it.

horizon-ctl type now edits the creative search the way typing does (the selection and the 50-character limit apply) instead of appending to the string directly.

How tested

In game (offscreen): type stone, then x → stonex (no click, so it appends). Click a result, then type dirt → the query is dirt.

Self-check:

cargo fmt --all --check                                   ok
cargo clippy --workspace --all-targets -- -D warnings     ok
cargo test -p horizon-client                              ok (689 + 44 + 15 + 2 + 2 + 2 on the integration commit)
tools/parity.py --changed origin/main                     80 passed, 0 failed (56 min), one run over an integration commit of all the inventory PRs (this one included)

Stacked on #393. Part of #275.

🤖 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/395 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/creative-search-select` --- ### 📝 Commits (2) - [`5efb5ea`](https://github.com/horizon-rust/horizon/commit/5efb5ea335d64f8806e165c20aab2112bc0d7770) Draw the quick craft drag as AbstractContainerScreen does - [`3e0793a`](https://github.com/horizon-rust/horizon/commit/3e0793af21984978f6bd7998da666949e3899ad5) Select the creative search query when a result is clicked ### 📊 Changes **8 files changed** (+243 additions, -46 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/clipboard.rs` (+5 -1) 📝 `crates/horizon-client/src/game.rs` (+128 -25) 📝 `crates/horizon-client/src/game/beacon.rs` (+2 -2) 📝 `crates/horizon-client/src/game/control.rs` (+2 -2) 📝 `crates/horizon-client/src/game/recipe_book.rs` (+1 -1) 📝 `crates/horizon-client/src/game/stations.rs` (+4 -5) 📝 `crates/horizon-client/src/game/trading.rs` (+5 -5) 📝 `crates/horizon-client/src/menu.rs` (+96 -5) </details> ### 📄 Description Clicking a creative search result now selects the whole query, so the next character typed replaces it, as in vanilla. Part of #275. `CreativeModeInventoryScreen.slotClicked` calls `searchBox.moveCursorToEnd(false)` then `setHighlightPos(0)` for any click on a display slot (`isCreativeSlot`). Horizon kept the query and appended to it. `AppendSelection::select` sets the selection, and display clicks on the search tab call it. `horizon-ctl type` now edits the creative search the way typing does (the selection and the 50-character limit apply) instead of appending to the string directly. ## How tested In game (offscreen): type `stone`, then `x` → `stonex` (no click, so it appends). Click a result, then type `dirt` → the query is `dirt`. Self-check: ``` cargo fmt --all --check ok cargo clippy --workspace --all-targets -- -D warnings ok cargo test -p horizon-client ok (689 + 44 + 15 + 2 + 2 + 2 on the integration commit) tools/parity.py --changed origin/main 80 passed, 0 failed (56 min), one run over an integration commit of all the inventory PRs (this one included) ``` Stacked on #393. Part of #275. 🤖 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-02 15:56:58 +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#2531
No description provided.