[PR #2750] [MERGED] refactor: move the client's input modules into horizon-client-input #4584

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

📋 Pull Request Information

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

Base: main ← Head: refactor/horizon-client-input


📝 Commits (6)

  • beac638 refactor: move the client's input modules into horizon-client-input
  • d8cc59d Merge remote-tracking branch 'origin/main' into refactor/horizon-client-input
  • 1db0eda Merge remote-tracking branch 'origin/main' into refactor/horizon-client-input
  • 0d554de parity: game_loop records mouse, window and keymapping from the input crate
  • d9ab241 Merge remote-tracking branch 'origin/main' into refactor/horizon-client-input
  • 64c1741 Merge remote-tracking branch 'origin/main' into refactor/horizon-client-input

📊 Changes

24 files changed (+75 additions, -23 deletions)

View changed files

📝 AGENTS.md (+3 -2)
📝 Cargo.lock (+13 -1)
📝 Cargo.toml (+1 -0)
➕ crates/horizon-client-input/Cargo.toml (+23 -0)
📝 crates/horizon-client-input/src/clipboard.rs (+0 -0)
📝 crates/horizon-client-input/src/gamepad.rs (+0 -0)
📝 crates/horizon-client-input/src/input.rs (+0 -0)
📝 crates/horizon-client-input/src/interaction_input.rs (+0 -0)
📝 crates/horizon-client-input/src/key_names.rs (+0 -0)
📝 crates/horizon-client-input/src/keybinds.rs (+0 -0)
📝 crates/horizon-client-input/src/keymapping.rs (+0 -0)
➕ crates/horizon-client-input/src/lib.rs (+14 -0)
📝 crates/horizon-client-input/src/mouse.rs (+0 -0)
📝 crates/horizon-client-input/src/window.rs (+0 -0)
📝 crates/horizon-client/Cargo.toml (+2 -2)
📝 crates/horizon-client/src/lib.rs (+9 -9)
📝 docs/controllers.md (+1 -1)
📝 tools/test_frame_limiter_parity.py (+1 -1)
📝 tools/test_game_loop_parity.py (+2 -1)
📝 tools/test_interaction_input_parity.py (+1 -1)

...and 4 more files

📄 Description

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

Part of the horizon-client crate split (#1702 thread, ci-speed). This is a pure move: no code changes.

What

Nine input modules of the client lib move into a new crate, crates/horizon-client-input:

  • gamepad, keybinds, mouse, clipboard, keymapping, key_names, input, interaction_input, window

Details:

  • horizon-client re-exports each one under its old path (horizon_client::keybinds, ...), so no caller changes.
  • They depend on nothing else in the client lib. The new crate needs horizon-client-core, winit, arboard (which moves here from horizon-client), horizon-theme and png (the window icon), and optionally horizon-dualsense.
  • horizon-client's controllers feature turns on horizon-client-input/controllers, so the server build (--no-default-features) still leaves the DualSense out.
  • The harnesses that list these files as cache sources (options, toggle_keys, local_input, sprint_input, interaction_input, frame_limiter) now point at the new paths. So do docs/controllers.md and AGENTS.md.

Why

The client lib is one 232k-line crate, so an edit to a key-binding file and its unit tests rebuilds the whole lib's test binary. Measured on the Mac mini (-j 8, load ~35), with a one-line edit to keybinds.rs followed by its tests:

before after
command cargo test -p horizon-client --features horizon-client/mods --lib keybinds:: cargo test -p horizon-client-input --lib
time 10.3 s / 9.8 s 1.0 s / 0.8 s

The new crate's 45 unit tests run on their own. This is the first of 2-3 PRs that move the input and view modules (13 modules, 7.3k lines, 75 tests) out of the lib.

Self-check

This head is a merge of main f21e09510 into the branch (no rebase). Run on the Mac mini on that merge:

  • tools/pr_ready.py (full, harnesses included): green, block below.
  • tools/parity.py command_exec save_roundtrip --fresh: 2 passed, 0 failed (both had failed in CI on the earlier head: command_exec's vanilla oracle did not load the entities, save_roundtrip showed a vault-state difference; neither reproduces here).

pr_ready (tools/pr_ready.py on ludovics-mac-mini, against origin/main at f21e09510, 31 min 25 s)

Check Result
Scope ✅ 24 files, +75 −23
Cargo.lock ✅ changes with a Cargo.toml
Public tree ✅
Python tests ✅ 398 passed (50 s)
rustfmt ✅ (7 s)
clippy ✅ (2 s)
tests: workspace ✅ 2327 passed (3 min 39 s)
doc tests ✅ 2 passed (5 s)
content root tests ✅ 5 passed (1 min 7 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅
launcher clippy ✅ (1 s)
launcher tests ✅ 205 passed (4 s)
Parity ✅ 356 affected, 130 passed (25 min 30 s)
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/2750 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `refactor/horizon-client-input` --- ### 📝 Commits (6) - [`beac638`](https://github.com/horizon-rust/horizon/commit/beac63849ce65b81a5a6002e2339d4d4ddbe17d2) refactor: move the client's input modules into horizon-client-input - [`d8cc59d`](https://github.com/horizon-rust/horizon/commit/d8cc59dd555b8f702923c533621a82141260d64b) Merge remote-tracking branch 'origin/main' into refactor/horizon-client-input - [`1db0eda`](https://github.com/horizon-rust/horizon/commit/1db0eda4ae6f274d817ecf39cf70a884750403b1) Merge remote-tracking branch 'origin/main' into refactor/horizon-client-input - [`0d554de`](https://github.com/horizon-rust/horizon/commit/0d554de016241881c62c75078fb5c27e268107e0) parity: game_loop records mouse, window and keymapping from the input crate - [`d9ab241`](https://github.com/horizon-rust/horizon/commit/d9ab24140609334be740c2f2068914325b43de07) Merge remote-tracking branch 'origin/main' into refactor/horizon-client-input - [`64c1741`](https://github.com/horizon-rust/horizon/commit/64c174118afa89c3cc984f40f1be3172b3cdab8f) Merge remote-tracking branch 'origin/main' into refactor/horizon-client-input ### 📊 Changes **24 files changed** (+75 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `AGENTS.md` (+3 -2) 📝 `Cargo.lock` (+13 -1) 📝 `Cargo.toml` (+1 -0) ➕ `crates/horizon-client-input/Cargo.toml` (+23 -0) 📝 `crates/horizon-client-input/src/clipboard.rs` (+0 -0) 📝 `crates/horizon-client-input/src/gamepad.rs` (+0 -0) 📝 `crates/horizon-client-input/src/input.rs` (+0 -0) 📝 `crates/horizon-client-input/src/interaction_input.rs` (+0 -0) 📝 `crates/horizon-client-input/src/key_names.rs` (+0 -0) 📝 `crates/horizon-client-input/src/keybinds.rs` (+0 -0) 📝 `crates/horizon-client-input/src/keymapping.rs` (+0 -0) ➕ `crates/horizon-client-input/src/lib.rs` (+14 -0) 📝 `crates/horizon-client-input/src/mouse.rs` (+0 -0) 📝 `crates/horizon-client-input/src/window.rs` (+0 -0) 📝 `crates/horizon-client/Cargo.toml` (+2 -2) 📝 `crates/horizon-client/src/lib.rs` (+9 -9) 📝 `docs/controllers.md` (+1 -1) 📝 `tools/test_frame_limiter_parity.py` (+1 -1) 📝 `tools/test_game_loop_parity.py` (+2 -1) 📝 `tools/test_interaction_input_parity.py` (+1 -1) _...and 4 more files_ </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Part of the horizon-client crate split (#1702 thread, ci-speed). This is a pure move: no code changes. ## What Nine input modules of the client lib move into a new crate, `crates/horizon-client-input`: - `gamepad`, `keybinds`, `mouse`, `clipboard`, `keymapping`, `key_names`, `input`, `interaction_input`, `window` Details: - `horizon-client` re-exports each one under its old path (`horizon_client::keybinds`, ...), so no caller changes. - They depend on nothing else in the client lib. The new crate needs `horizon-client-core`, `winit`, `arboard` (which moves here from horizon-client), `horizon-theme` and `png` (the window icon), and optionally `horizon-dualsense`. - horizon-client's `controllers` feature turns on `horizon-client-input/controllers`, so the server build (`--no-default-features`) still leaves the DualSense out. - The harnesses that list these files as cache sources (options, toggle_keys, local_input, sprint_input, interaction_input, frame_limiter) now point at the new paths. So do `docs/controllers.md` and AGENTS.md. ## Why The client lib is one 232k-line crate, so an edit to a key-binding file and its unit tests rebuilds the whole lib's test binary. Measured on the Mac mini (-j 8, load ~35), with a one-line edit to `keybinds.rs` followed by its tests: | | before | after | | --- | --- | --- | | command | `cargo test -p horizon-client --features horizon-client/mods --lib keybinds::` | `cargo test -p horizon-client-input --lib` | | time | 10.3 s / 9.8 s | 1.0 s / 0.8 s | The new crate's 45 unit tests run on their own. This is the first of 2-3 PRs that move the input and view modules (13 modules, 7.3k lines, 75 tests) out of the lib. ## Self-check This head is a merge of main f21e09510 into the branch (no rebase). Run on the Mac mini on that merge: - `tools/pr_ready.py` (full, harnesses included): green, block below. - `tools/parity.py command_exec save_roundtrip --fresh`: **2 passed, 0 failed** (both had failed in CI on the earlier head: command_exec's vanilla oracle did not load the entities, save_roundtrip showed a vault-state difference; neither reproduces here). **pr_ready** (`tools/pr_ready.py` on ludovics-mac-mini, against origin/main at f21e09510, 31 min 25 s) | Check | Result | | --- | --- | | Scope | ✅ 24 files, +75 −23 | | Cargo.lock | ✅ changes with a Cargo.toml | | Public tree | ✅ | | Python tests | ✅ 398 passed (50 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (2 s) | | tests: workspace | ✅ 2327 passed (3 min 39 s) | | doc tests | ✅ 2 passed (5 s) | | content root tests | ✅ 5 passed (1 min 7 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ | | launcher clippy | ✅ (1 s) | | launcher tests | ✅ 205 passed (4 s) | | Parity | ✅ 356 affected, 130 passed (25 min 30 s) | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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:18:15 +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#4584
No description provided.