[PR #3399] [MERGED] Mod screens: a list's rows are cut at its frame #4954

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3399
Author: @d3grando
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: fix-mod-screen-list-clip


📝 Commits (1)

  • 8f00332 Mod screens: a list's rows are cut at its frame

📊 Changes

1 file changed (+96 additions, -20 deletions)

View changed files

📝 crates/horizon-client/src/game/mods.rs (+96 -20)

📄 Description

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

What and why

Fixes #3237. A mod screen's list widget drew its rows without cutting them at the frame. The frame holds 6 rows
(mod_ui_layout: rows.min(6) * 12 + 8), and the draw loop draws one more, for a scroll that shows a row in part
((first + ceil(72 / 12) + 1)). Unscrolled, that 7th row sat whole below the frame, over the screen background:
"Mellohi" in the report's music player, the same in the screenshot below.

The rows (with their hover and selection fills) now go through a small draw_list_rows, which cuts what it drew at
the frame's inside with HudBatch::clip_since, the GUI scissor the advancements and dialog screens already use. A
row a scroll shows in part is drawn in part, as in vanilla; layout, scrolling and clicks are unchanged (clicks were
already limited to the frame).

Vanilla reference

net.minecraft.client.gui.components.AbstractSelectionList.extractWidgetRenderState draws its entries between
enableScissor(GuiGraphicsExtractor) (→ GuiGraphicsExtractor.enableScissor(int, int, int, int)) and
GuiGraphicsExtractor.disableScissor() (javap -c on the 26.3 client jar). No harness: mod screens have none; the
unit test below checks it.

Test

game::mods::tests::list_rows_stay_inside_the_frame_scrolled_or_not draws 22 rows in a 6-row frame at scrolls 0, 6
and 30, with the 7th row selected and hovered (its fills need no font, so the test doesn't depend on the game's
assets), and checks that nothing is drawn outside the frame. Without the cut it fails:
scroll 0: rows span 46..128, the frame's inside is 41..119; with it, it passes.

Self-check

pr_ready (tools/pr_ready.py --quick on DESKTOP-J80C959, against origin/main at 81f339814, 2 min 46 s)

Check Result
Scope ✅ 1 files, +96 −20
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 405 run, FAILED (failures=1, skipped=12) (38 s)
rustfmt ✅ (6 s)
clippy ✅ (37 s)
tests: horizon-client ❌ 1108 passed, 1 failed (49 s)
doc tests ✅ 0 passed (35 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 ➖ not run (--quick): 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)

Both ❌ are Windows-only and fail the same on origin/main here (checked for #3130): save::tests::session_lock_is_exclusive (Windows error 33, a lock violation) and the Python test_port_publish.test_body_has_names_and_signatures_only. The new test passes; it is in the bin (cargo test -p horizon-client --features mods --bin horizon-client list_rows_stay_inside).

Screenshots

A throwaway client mod opening a screen with a 22-row list (ui.open-screen), GUI scale 2, Windows 11. Before:
release v0.2.94. After: this branch.

Before: the 7th row below the frame; after: cut at the frame

🤖 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/3399 **Author:** [@d3grando](https://github.com/d3grando) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix-mod-screen-list-clip` --- ### 📝 Commits (1) - [`8f00332`](https://github.com/horizon-rust/horizon/commit/8f00332979c4cf1034c5654e4b111f99525760e5) Mod screens: a list's rows are cut at its frame ### 📊 Changes **1 file changed** (+96 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/mods.rs` (+96 -20) </details> ### 📄 Description > 🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando themselves. ## What and why Fixes #3237. A mod screen's `list` widget drew its rows without cutting them at the frame. The frame holds 6 rows (`mod_ui_layout`: `rows.min(6) * 12 + 8`), and the draw loop draws one more, for a scroll that shows a row in part (`(first + ceil(72 / 12) + 1)`). Unscrolled, that 7th row sat whole below the frame, over the screen background: "Mellohi" in the report's music player, the same in the screenshot below. The rows (with their hover and selection fills) now go through a small `draw_list_rows`, which cuts what it drew at the frame's inside with `HudBatch::clip_since`, the GUI scissor the advancements and dialog screens already use. A row a scroll shows in part is drawn in part, as in vanilla; layout, scrolling and clicks are unchanged (clicks were already limited to the frame). ## Vanilla reference `net.minecraft.client.gui.components.AbstractSelectionList.extractWidgetRenderState` draws its entries between `enableScissor(GuiGraphicsExtractor)` (→ `GuiGraphicsExtractor.enableScissor(int, int, int, int)`) and `GuiGraphicsExtractor.disableScissor()` (`javap -c` on the 26.3 client jar). No harness: mod screens have none; the unit test below checks it. ## Test `game::mods::tests::list_rows_stay_inside_the_frame_scrolled_or_not` draws 22 rows in a 6-row frame at scrolls 0, 6 and 30, with the 7th row selected and hovered (its fills need no font, so the test doesn't depend on the game's assets), and checks that nothing is drawn outside the frame. Without the cut it fails: `scroll 0: rows span 46..128, the frame's inside is 41..119`; with it, it passes. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on DESKTOP-J80C959, against origin/main at 81f339814, 2 min 46 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +96 −20 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 405 run, FAILED (failures=1, skipped=12) (38 s) | | rustfmt | ✅ (6 s) | | clippy | ✅ (37 s) | | tests: horizon-client | ❌ 1108 passed, 1 failed (49 s) | | doc tests | ✅ 0 passed (35 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 | ➖ not run (--quick): 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) | Both ❌ are Windows-only and fail the same on `origin/main` here (checked for #3130): `save::tests::session_lock_is_exclusive` (Windows error 33, a lock violation) and the Python `test_port_publish.test_body_has_names_and_signatures_only`. The new test passes; it is in the bin (`cargo test -p horizon-client --features mods --bin horizon-client list_rows_stay_inside`). ## Screenshots A throwaway client mod opening a screen with a 22-row list (`ui.open-screen`), GUI scale 2, Windows 11. Before: release v0.2.94. After: this branch. ![Before: the 7th row below the frame; after: cut at the frame](https://raw.githubusercontent.com/d3grando/horizon/pr-assets/mod-list-clip.png) 🤖 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 05:09:09 +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#4954
No description provided.