[PR #4638] [MERGED] UI: Slider keyboard navigation, arrow control, and mouse wheel adjustment #5747

Closed
opened 2026-11-03 05:14:43 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4638
Author: @elythepreciouscat
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: feat/ui-slider-keyboard-controls


📝 Commits (10+)

  • ac08e26 UI: Add keyboard navigation, arrow control, and wheel scrolling for sliders
  • e74b415 UI: Add keyboard navigation, arrow controls, and wheel scrolling for Horizon graphics settings and extras
  • 4a06ae4 UI: Add keyboard navigation for Title, Pause, Death, and Confirm screens; refine slider parity
  • b0ed32a Merge remote-tracking branch 'origin/main' into feat/ui-slider-keyboard-controls
  • f4531d6 UI: fix missing click sounds for keyboard Space/Enter; add focused-widget wheel
  • fca2bb2 Merge remote-tracking branch 'origin/main' into feat/ui-slider-keyboard-controls
  • 9b9b30a Reset pause focus when reopening the menu
  • f6fb532 Fix remaining keyboard focus review findings
  • 67f328d Merge remote-tracking branch 'origin/main' into sweepB/4638
  • d54c7b2 Merge origin/main into feat/ui-slider-keyboard-controls

📊 Changes

16 files changed (+2599 additions, -129 deletions)

View changed files

📝 crates/horizon-client-render/src/graphics_style.rs (+28 -0)
📝 crates/horizon-client-render/src/graphics_ui.rs (+462 -6)
📝 crates/horizon-client-render/src/options_ui.rs (+881 -14)
📝 crates/horizon-client-render/src/ui.rs (+37 -5)
📝 crates/horizon-client/src/confirm_screen.rs (+115 -4)
📝 crates/horizon-client/src/game.rs (+62 -6)
📝 crates/horizon-client/src/game/debug_keys.rs (+1 -0)
📝 crates/horizon-client/src/game/dialogs.rs (+38 -10)
📝 crates/horizon-client/src/game/lan_screen.rs (+324 -13)
📝 crates/horizon-client/src/game/options.rs (+8 -1)
📝 crates/horizon-client/src/game/screens.rs (+242 -27)
📝 crates/horizon-client/src/game/startup_menu.rs (+21 -6)
📝 crates/horizon-client/src/save.rs (+20 -0)
📝 crates/horizon-client/src/title.rs (+263 -30)
📝 crates/horizon-client/src/title/create_world.rs (+18 -7)
📝 crates/horizon-client/src/title/tests.rs (+79 -0)

📄 Description

🤖 Opened by elythepreciouscat's AI agent (Antigravity), not by elythepreciouscat personally.

Fixes #4637

Summary

Brings slider, settings controls, and screen navigation in line with Vanilla Minecraft (Java Edition 26.3):

  • Slider Keyboard Control:
    • Left / Right Arrow keys adjust slider values when in can_change_value mode (discrete integer steps for discrete options, continuous nudging 1.0 / (width - 8.0) for continuous options).
    • Space / Enter toggles can_change_value mode; when not active, arrow keys navigate focus between widgets instead of modifying values.
    • Escape cancels can_change_value mode before closing the options screen.
    • Tab / Shift+Tab cycles focus through all widgets and automatically activates can_change_value on sliders.
  • Mouse Wheel Parity:
    • Per Java Edition 26.3 specification (AbstractSliderButton has no mouseScrolled), mouse wheel in scrollable lists scrolls the list; sliders do not intercept the wheel.
    • Scrolling over cycle buttons or Act::Extra toggle switches cycles their modes (CycleButton.mouseScrolled). Blocked/disabled rows fall through to scroll the list.
  • Step Derivation:
    • Slider steps are derived directly from the option's definition/step count via slider_steps and slider_position / set_slider, ensuring exact synchronization between keyboard stepping and slider value setting without duplicate hardcoding.
  • Screen & Dialog Keyboard Navigation:
    • Full keyboard focus, Tab/Shift-Tab cycling, 2D arrow key navigation, Space/Enter activation, and visual focus highlighting for Title Screen, Select / Create World, Pause Screen, Death Screen, Confirm / Choice Screens, and LAN / World Options screens.
    • Dialog sliders: Arrow keys step by declared step / range ratio rather than fixed 0.01; wheel scrolls the dialog area.

pr_ready (tools/pr_ready.py --quick on omarchy, against origin/main at 19ca1c8b3, 12 min 58 s)

Check Result
Scope ⚠️ 15 files, +2393 −118; 2511 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 481 passed (1 min 7 s)
rustfmt ✅ (17 s)
clippy ✅ (1 min 37 s)
tests: horizon-client, horizon-client-render ✅ 1695 passed (9 min 21 s)
doc tests ✅ 0 passed (18 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 356 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 344 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Antigravity


🔄 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/4638 **Author:** [@elythepreciouscat](https://github.com/elythepreciouscat) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/ui-slider-keyboard-controls` --- ### 📝 Commits (10+) - [`ac08e26`](https://github.com/horizon-rust/horizon/commit/ac08e260609d5c867f8c3c53ca21c596ffd751d9) UI: Add keyboard navigation, arrow control, and wheel scrolling for sliders - [`e74b415`](https://github.com/horizon-rust/horizon/commit/e74b415d72a276e7aa811fec74f89bfbe7efbe93) UI: Add keyboard navigation, arrow controls, and wheel scrolling for Horizon graphics settings and extras - [`4a06ae4`](https://github.com/horizon-rust/horizon/commit/4a06ae4d475346c22b75f6bdbe28515054781672) UI: Add keyboard navigation for Title, Pause, Death, and Confirm screens; refine slider parity - [`b0ed32a`](https://github.com/horizon-rust/horizon/commit/b0ed32ad9a520a526295f597fa8d748589fde23d) Merge remote-tracking branch 'origin/main' into feat/ui-slider-keyboard-controls - [`f4531d6`](https://github.com/horizon-rust/horizon/commit/f4531d6e0d2636aea3591f3370cf754d5cb23371) UI: fix missing click sounds for keyboard Space/Enter; add focused-widget wheel - [`fca2bb2`](https://github.com/horizon-rust/horizon/commit/fca2bb2b79346a8aa66a48e0014b51f27da9e738) Merge remote-tracking branch 'origin/main' into feat/ui-slider-keyboard-controls - [`9b9b30a`](https://github.com/horizon-rust/horizon/commit/9b9b30a0f5ad5cd4e3518799eb324e9bb697552f) Reset pause focus when reopening the menu - [`f6fb532`](https://github.com/horizon-rust/horizon/commit/f6fb5327827cb379983af03c99f53d3034bb1f7c) Fix remaining keyboard focus review findings - [`67f328d`](https://github.com/horizon-rust/horizon/commit/67f328dfc59be60ca89fca37020b37ba2cafce84) Merge remote-tracking branch 'origin/main' into sweepB/4638 - [`d54c7b2`](https://github.com/horizon-rust/horizon/commit/d54c7b2629798a302cda42f16dd87f653a3c7409) Merge origin/main into feat/ui-slider-keyboard-controls ### 📊 Changes **16 files changed** (+2599 additions, -129 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/graphics_style.rs` (+28 -0) 📝 `crates/horizon-client-render/src/graphics_ui.rs` (+462 -6) 📝 `crates/horizon-client-render/src/options_ui.rs` (+881 -14) 📝 `crates/horizon-client-render/src/ui.rs` (+37 -5) 📝 `crates/horizon-client/src/confirm_screen.rs` (+115 -4) 📝 `crates/horizon-client/src/game.rs` (+62 -6) 📝 `crates/horizon-client/src/game/debug_keys.rs` (+1 -0) 📝 `crates/horizon-client/src/game/dialogs.rs` (+38 -10) 📝 `crates/horizon-client/src/game/lan_screen.rs` (+324 -13) 📝 `crates/horizon-client/src/game/options.rs` (+8 -1) 📝 `crates/horizon-client/src/game/screens.rs` (+242 -27) 📝 `crates/horizon-client/src/game/startup_menu.rs` (+21 -6) 📝 `crates/horizon-client/src/save.rs` (+20 -0) 📝 `crates/horizon-client/src/title.rs` (+263 -30) 📝 `crates/horizon-client/src/title/create_world.rs` (+18 -7) 📝 `crates/horizon-client/src/title/tests.rs` (+79 -0) </details> ### 📄 Description > 🤖 Opened by elythepreciouscat's AI agent (Antigravity), not by elythepreciouscat personally. Fixes #4637 ### Summary Brings slider, settings controls, and screen navigation in line with Vanilla Minecraft (Java Edition 26.3): - **Slider Keyboard Control**: - Left / Right Arrow keys adjust slider values when in `can_change_value` mode (discrete integer steps for discrete options, continuous nudging `1.0 / (width - 8.0)` for continuous options). - Space / Enter toggles `can_change_value` mode; when not active, arrow keys navigate focus between widgets instead of modifying values. - Escape cancels `can_change_value` mode before closing the options screen. - Tab / Shift+Tab cycles focus through all widgets and automatically activates `can_change_value` on sliders. - **Mouse Wheel Parity**: - Per Java Edition 26.3 specification (`AbstractSliderButton` has no `mouseScrolled`), mouse wheel in scrollable lists scrolls the list; sliders do not intercept the wheel. - Scrolling over cycle buttons or `Act::Extra` toggle switches cycles their modes (`CycleButton.mouseScrolled`). Blocked/disabled rows fall through to scroll the list. - **Step Derivation**: - Slider steps are derived directly from the option's definition/step count via `slider_steps` and `slider_position` / `set_slider`, ensuring exact synchronization between keyboard stepping and slider value setting without duplicate hardcoding. - **Screen & Dialog Keyboard Navigation**: - Full keyboard focus, Tab/Shift-Tab cycling, 2D arrow key navigation, Space/Enter activation, and visual focus highlighting for Title Screen, Select / Create World, Pause Screen, Death Screen, Confirm / Choice Screens, and LAN / World Options screens. - Dialog sliders: Arrow keys step by declared step / range ratio rather than fixed 0.01; wheel scrolls the dialog area. **pr_ready** (`tools/pr_ready.py --quick` on omarchy, against origin/main at 19ca1c8b3, 12 min 58 s) | Check | Result | | --- | --- | | Scope | ⚠️ 15 files, +2393 −118; 2511 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 481 passed (1 min 7 s) | | rustfmt | ✅ (17 s) | | clippy | ✅ (1 min 37 s) | | tests: horizon-client, horizon-client-render | ✅ 1695 passed (9 min 21 s) | | doc tests | ✅ 0 passed (18 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 356 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 344 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Antigravity](https://deepmind.google/technologies/gemini/) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:14:43 +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#5747
No description provided.