[PR #1913] [CLOSED] Game rules and statistics lists drag their scroll bars #3859

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1913
Author: @vlesmentie
Created: 10/25/2026
Status: ❌ Closed

Base: main ← Head: fix/draggable-list-scrollbars


📝 Commits (2)

  • 775e6f3 Game rules and statistics lists drag their scroll bars
  • cd816c0 Merge origin/main into fix/draggable-list-scrollbars

📊 Changes

4 files changed (+133 additions, -15 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+11 -0)
📝 crates/horizon-client/src/game/game_rules_screen.rs (+68 -8)
📝 crates/horizon-client/src/game/lan_screen.rs (+19 -0)
📝 crates/horizon-client/src/game/stats_screen.rs (+35 -7)

📄 Description

🤖 Opened by vlesmentie's AI agent (Claude Code, Claude Opus 5.5), not by vlesmentie themselves.

What and why

Fixes #1782.

The Edit Game Rules list (Esc → World Options → Edit Game Rules) and the Statistics list could only scroll with the
wheel: pressing and dragging their scroll bar did nothing. In vanilla every AbstractScrollArea holds its bar on
a press over the bar's column and follows the pointer while the button is down. Horizon's other lists already do
this through ui::Scroll (press, drag, release); these two kept a bare f32 amount.

  • game/game_rules_screen.rs: scroll is a ui::Scroll. click presses it first (after the confirm dialog),
    over the bar's column at row_left + ROW_WIDTH + 8 (now bar_x, shared with the drawing), and drag / release
    follow and let go.
  • game/stats_screen.rs: the same for the Statistics list, its bar at the list's left + 286.
  • game/lan_screen.rs: world_options_drag / world_options_release pass the pointer to the rules list while it
    is open.
  • game.rs: the cursor's moves drag the held bar on these two screens, and a released left button lets it go.

The wheel and the drawn bar are unchanged.

Vanilla reference

  • AbstractScrollArea.updateScrolling (a press on the scroll bar's column, with something to scroll, sets
    scrolling), mouseDragged (above or below the list jumps to an end, otherwise the thumb follows the pointer),
    mouseReleased
  • AbstractSelectionList (the rule list) and StatsScreen's lists are AbstractScrollAreas

Checked against the 26.3 client jar's bytecode (javap). Horizon-only plumbing otherwise; no harness drives these
screens' mouse.

New test game::game_rules_screen::tests::the_scroll_bar_can_be_held_dragged_and_let_go: a press beside the bar
doesn't hold it, one on it does, dragging scrolls, below the list jumps to the end, and after the release the
pointer no longer moves the list.

Self-check

pr_ready (tools/pr_ready.py on debian, against origin/main at 7fd1f3118, 3 min 6 s)

Check Result
Scope ✅ 4 files, +133 −15
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (14 s)
clippy ✅ (39 s)
tests: horizon-client ❌ 1101 passed, 2 failed (2 min 7 s)
doc tests ✅ 0 passed (5 s)
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)

The two failing tests, packs::cache::tests::zip_content_and_failed_build_invalidate and packs::cache::tests::normalized_and_external_overlay_roots_keep_merged_bytes_current, fail the same way on main on this machine and come and go between runs here; CI's verify passes them. Because the library's tests stopped there, the new binary test was run separately: cargo test -p horizon-client --bin horizon-client game_rules_screen passes (5 tests).

Not checked in game.

🤖 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/1913 **Author:** [@vlesmentie](https://github.com/vlesmentie) **Created:** 10/25/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/draggable-list-scrollbars` --- ### 📝 Commits (2) - [`775e6f3`](https://github.com/horizon-rust/horizon/commit/775e6f3da6ce87741bb3f1eaa58bb2e2d9a223ba) Game rules and statistics lists drag their scroll bars - [`cd816c0`](https://github.com/horizon-rust/horizon/commit/cd816c044a13dba6a8c3bbbef3916ab2a99f3e79) Merge origin/main into fix/draggable-list-scrollbars ### 📊 Changes **4 files changed** (+133 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+11 -0) 📝 `crates/horizon-client/src/game/game_rules_screen.rs` (+68 -8) 📝 `crates/horizon-client/src/game/lan_screen.rs` (+19 -0) 📝 `crates/horizon-client/src/game/stats_screen.rs` (+35 -7) </details> ### 📄 Description > 🤖 Opened by vlesmentie's AI agent (Claude Code, Claude Opus 5.5), not by vlesmentie themselves. ## What and why Fixes #1782. The Edit Game Rules list (Esc → World Options → Edit Game Rules) and the Statistics list could only scroll with the wheel: pressing and dragging their scroll bar did nothing. In vanilla every `AbstractScrollArea` holds its bar on a press over the bar's column and follows the pointer while the button is down. Horizon's other lists already do this through `ui::Scroll` (`press`, `drag`, `release`); these two kept a bare `f32` amount. - `game/game_rules_screen.rs`: `scroll` is a `ui::Scroll`. `click` presses it first (after the confirm dialog), over the bar's column at `row_left + ROW_WIDTH + 8` (now `bar_x`, shared with the drawing), and `drag` / `release` follow and let go. - `game/stats_screen.rs`: the same for the Statistics list, its bar at the list's left + 286. - `game/lan_screen.rs`: `world_options_drag` / `world_options_release` pass the pointer to the rules list while it is open. - `game.rs`: the cursor's moves drag the held bar on these two screens, and a released left button lets it go. The wheel and the drawn bar are unchanged. ## Vanilla reference - `AbstractScrollArea.updateScrolling` (a press on the scroll bar's column, with something to scroll, sets `scrolling`), `mouseDragged` (above or below the list jumps to an end, otherwise the thumb follows the pointer), `mouseReleased` - `AbstractSelectionList` (the rule list) and `StatsScreen`'s lists are `AbstractScrollArea`s Checked against the 26.3 client jar's bytecode (`javap`). Horizon-only plumbing otherwise; no harness drives these screens' mouse. New test `game::game_rules_screen::tests::the_scroll_bar_can_be_held_dragged_and_let_go`: a press beside the bar doesn't hold it, one on it does, dragging scrolls, below the list jumps to the end, and after the release the pointer no longer moves the list. ## Self-check **pr_ready** (`tools/pr_ready.py` on debian, against origin/main at 7fd1f3118, 3 min 6 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +133 −15 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (14 s) | | clippy | ✅ (39 s) | | tests: horizon-client | ❌ 1101 passed, 2 failed (2 min 7 s) | | doc tests | ✅ 0 passed (5 s) | | 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) | The two failing tests, `packs::cache::tests::zip_content_and_failed_build_invalidate` and `packs::cache::tests::normalized_and_external_overlay_roots_keep_merged_bytes_current`, fail the same way on `main` on this machine and come and go between runs here; CI's `verify` passes them. Because the library's tests stopped there, the new binary test was run separately: `cargo test -p horizon-client --bin horizon-client game_rules_screen` passes (5 tests). Not checked in game. 🤖 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:12:50 +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#3859
No description provided.