[PR #4642] [CLOSED] Fix empty statistics tabs and their tooltips #5749

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4642
Author: @missingnx
Created: 10/30/2026
Status: ❌ Closed

Base: main ← Head: fix/stats-empty-tabs


📝 Commits (1)

  • fbd8ea8 Fix empty statistics tab availability and tooltips

📊 Changes

6 files changed (+207 additions, -3 deletions)

View changed files

📝 crates/horizon-client/examples/probe/screen_layout_fixture.rs (+7 -1)
📝 crates/horizon-client/src/game/stats_screen.rs (+23 -1)
📝 crates/horizon-client/src/screen_layout.rs (+16 -0)
➕ mods/horizon/src/test/java/dev/horizonlab/parity/VanillaStatsTabsOracle.java (+78 -0)
📝 tools/port_map/client2-015.tsv (+1 -1)
➕ tools/test_stats_tabs_parity.py (+82 -0)

📄 Description

🤖 Opened by missingnx's AI agent (Codex, GPT-6), not by missingnx personally.

Withdrawn as a duplicate of #4527. The statistics-tab change was already implemented in that open PR and marked complete in #3518 before this PR was opened.

What and why

Empty Items and Mobs statistics tabs previously remained selectable. Disable those tabs when their lists have no entries, render their labels with the inactive color, and show the vanilla gui.stats.none_found tooltip on hover. Tabs with entries remain selectable and have no empty-list tooltip.

Part of #3518.

Tracker row: StatsScreen.setTabActiveStateAndTooltip. The port-map entry is updated; keyboard tab switching and the other statistics-screen gaps are outside this change.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Minecraft 26.3 net.minecraft.client.gui.screens.achievement.StatsScreen.setTabActiveStateAndTooltip(int): enable a statistics tab only when its list has children, clear the tooltip when enabled, and otherwise set gui.stats.none_found.

tools/test_stats_tabs_parity.py calls the actual private vanilla method through VanillaStatsTabsOracle, without a game window, and compares its enabled state and tooltip key against the production Rust helper used by drawing and click handling. All 12 cases match, including empty/populated/empty transitions for both tabs. This checks tab state, not rendered pixels or end-to-end mouse input.

Self-check

pr_ready (tools/pr_ready.py --quick on DESKTOP-MVKIU2D, against origin/main at 0a7ad01ed, 3 min 0 s)

Check Result
Scope ✅ 6 files, +207 −3
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 481 passed (50 s)
rustfmt ✅ (14 s)
clippy ✅ (40 s)
tests: horizon-client ❌ 798 passed, 1 failed (1 min 11 s)
doc tests ✅ 0 passed (2 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)

Additional validation:

  • python tools/test_stats_tabs_parity.py --minecraft-home <official-launcher-install>: 12/12 states match.
  • cargo test --locked -p horizon-client --tests -- --skip title::tests::each_world_preset_writes_its_own_generator: passed.
  • Targeted no-default-features game tests and Clippy: passed.
  • Port-ledger check and map check: the changed statistics row resolves to the new Rust helper. The local ledger uses the decompiled statistics/tab classes; unrelated classes are not included in that local snapshot.

The full self-check has one existing Windows failure: title::tests::each_world_preset_writes_its_own_generator joins a registry ID such as minecraft:normal directly into a directory path. Windows rejects the colon (NotADirectory, OS error 267). This test and its save code are unchanged, and the failure reproduces when the test is run alone. The remaining Rust tests pass with only that test excluded.

Screenshots

Not captured. In-game visual verification is still pending; the automated comparison covers the tab state and tooltip key.

🤖 Generated with Codex.


🔄 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/4642 **Author:** [@missingnx](https://github.com/missingnx) **Created:** 10/30/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/stats-empty-tabs` --- ### 📝 Commits (1) - [`fbd8ea8`](https://github.com/horizon-rust/horizon/commit/fbd8ea8b36cce89a48e06282fb2b9d46d3c7cb87) Fix empty statistics tab availability and tooltips ### 📊 Changes **6 files changed** (+207 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/screen_layout_fixture.rs` (+7 -1) 📝 `crates/horizon-client/src/game/stats_screen.rs` (+23 -1) 📝 `crates/horizon-client/src/screen_layout.rs` (+16 -0) ➕ `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaStatsTabsOracle.java` (+78 -0) 📝 `tools/port_map/client2-015.tsv` (+1 -1) ➕ `tools/test_stats_tabs_parity.py` (+82 -0) </details> ### 📄 Description > 🤖 Opened by missingnx's AI agent (Codex, GPT-6), not by missingnx personally. **Withdrawn as a duplicate of #4527.** The statistics-tab change was already implemented in that open PR and marked complete in #3518 before this PR was opened. ## What and why Empty Items and Mobs statistics tabs previously remained selectable. Disable those tabs when their lists have no entries, render their labels with the inactive color, and show the vanilla `gui.stats.none_found` tooltip on hover. Tabs with entries remain selectable and have no empty-list tooltip. Part of #3518. Tracker row: `StatsScreen.setTabActiveStateAndTooltip`. The port-map entry is updated; keyboard tab switching and the other statistics-screen gaps are outside this change. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Minecraft 26.3 `net.minecraft.client.gui.screens.achievement.StatsScreen.setTabActiveStateAndTooltip(int)`: enable a statistics tab only when its list has children, clear the tooltip when enabled, and otherwise set `gui.stats.none_found`. `tools/test_stats_tabs_parity.py` calls the actual private vanilla method through `VanillaStatsTabsOracle`, without a game window, and compares its enabled state and tooltip key against the production Rust helper used by drawing and click handling. All 12 cases match, including empty/populated/empty transitions for both tabs. This checks tab state, not rendered pixels or end-to-end mouse input. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on DESKTOP-MVKIU2D, against origin/main at 0a7ad01ed, 3 min 0 s) | Check | Result | | --- | --- | | Scope | ✅ 6 files, +207 −3 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 481 passed (50 s) | | rustfmt | ✅ (14 s) | | clippy | ✅ (40 s) | | tests: horizon-client | ❌ 798 passed, 1 failed (1 min 11 s) | | doc tests | ✅ 0 passed (2 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) | Additional validation: - `python tools/test_stats_tabs_parity.py --minecraft-home <official-launcher-install>`: 12/12 states match. - `cargo test --locked -p horizon-client --tests -- --skip title::tests::each_world_preset_writes_its_own_generator`: passed. - Targeted no-default-features game tests and Clippy: passed. - Port-ledger check and map check: the changed statistics row resolves to the new Rust helper. The local ledger uses the decompiled statistics/tab classes; unrelated classes are not included in that local snapshot. The full self-check has one existing Windows failure: `title::tests::each_world_preset_writes_its_own_generator` joins a registry ID such as `minecraft:normal` directly into a directory path. Windows rejects the colon (`NotADirectory`, OS error 267). This test and its save code are unchanged, and the failure reproduces when the test is run alone. The remaining Rust tests pass with only that test excluded. ## Screenshots Not captured. In-game visual verification is still pending; the automated comparison covers the tab state and tooltip key. 🤖 Generated with [Codex](https://openai.com/codex/). --- <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:44 +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#5749
No description provided.