[PR #1576] [MERGED] fix(launcher): virtualize long mod lists from the first frame #3603

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

📋 Pull Request Information

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

Base: main ← Head: fix/launcher-mod-lists


📝 Commits (2)

  • 98639d1 fix(launcher): virtualize long mod lists from the first frame
  • f1ff81e launcher: spacers carry only their height; the version verdict leaves the check thread plainly

📊 Changes

6 files changed (+464 additions, -116 deletions)

View changed files

📝 launcher/README.md (+6 -0)
📝 launcher/src/cull.rs (+307 -69)
📝 launcher/src/main.rs (+5 -2)
📝 launcher/src/modpacks_page.rs (+17 -5)
📝 launcher/src/mods_page.rs (+56 -17)
📝 launcher/src/mods_project.rs (+73 -23)

📄 Description

🤖 Opened by Robert's AI agent (OpenAI Codex / GPT-6.1 Sol), not by Robert himself.

What and why

Opening or scrolling Mods rebuilt every loaded result and icon. Installed mods and modpack coverage reports also built every row. Versions and Patch notes had warm-frame culling, but still built every row initially, on resize and after pagination, plus one placeholder element per hidden row.

  • Make the existing page-scroll helper build nearby rows from the first frame, estimate unseen heights, measure wrapping as rows enter view and combine hidden ranges into spacers. Preserve the existing row components and outer scrollbar.
  • Use it for mod results, installed mods, coverage reports and project versions, as well as the existing Versions/Patch notes consumers. Reset measurements when searches, filters, packs or installed entries change; keep active removal confirmations rendered.
  • Build icons and clone project data only for rows being rendered. Share project details/version data and borrow release lists instead of cloning entire collections per frame. Read cached version verdicts with the background request and preserve later check updates in either event order.
  • Keep the final row visible when measurement changes the height after dragging to the bottom; leave the current viewport in place when More appends results.

The regression fixture has 10,000 rows: the first frame constructs at most 17 row elements instead of all 10,000. This measures bounded element construction, not an end-to-end frame-rate claim. A real GPUI desktop test also checks visible rows and the final row after scrollbar jumps.

Open launcher PRs and issues were checked before starting; none covers this rendering issue. This branch is independent of #1574 and #1575. The scope warning below includes replacing the old culling implementation and the new tests; the helper, its consumers and regression coverage ship as one performance fix. No dependencies or lockfile changes.

Vanilla reference

Horizon-only launcher rendering. Existing styling, row contents and page composition are preserved; gameplay is unchanged.

Self-check

pr_ready (tools/pr_ready.py on DESKTOP-KI5NGSR, against origin/main at 7fca3c2f9, 8 s)

Check Result
Scope ⚠️ 6 files, +476 −116; 586 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅
launcher clippy ❌ failed (2 s)
launcher tests ✅ 111 passed (4 s)
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)

Additional validation:

  • cargo test --manifest-path launcher/Cargo.toml --locked: 140 passed; two existing optional tests and the new desktop test are ignored by default.
  • cargo test --manifest-path launcher/Cargo.toml --bin horizon-launcher desktop_list_renders_the_viewport_after_scrollbar_jumps -- --ignored --nocapture: passed on Windows with a real GPUI window and 10,000 rows of different heights. Checks jumps to the final row and back, bounded row construction, and visible rows rather than spacers. The stricter final-row assertion caught and now covers the bottom-anchoring edge case.
  • Geometry tests cover initial rendering, large jumps, resize, appending results, retained confirmations and measurement invalidation.
  • Strict launcher Clippy remains blocked by the existing Windows dead-code diagnostics for name_in and link_stays_inside in launcher/src/mojang.rs. An additional all-targets Clippy pass with only dead-code allowed passed. The required self-check above retains the failure.

Why existing tests missed this: the old helper's tests checked geometry and explicitly expected all rows to be drawn before measurement. No test bounded first-frame element construction or checked the final visible row after a large scrollbar jump. The new tests cover both. The desktop test is opt-in for environments without an interactive desktop/GPU; a live Modrinth session and end-to-end frame timing are outside that fixture.

🤖 Generated with OpenAI Codex (GPT-6.1 Sol).


🔄 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/1576 **Author:** [@RobertTGreat](https://github.com/RobertTGreat) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/launcher-mod-lists` --- ### 📝 Commits (2) - [`98639d1`](https://github.com/horizon-rust/horizon/commit/98639d1471759f8d315bde469a9f7f5d33c0fc47) fix(launcher): virtualize long mod lists from the first frame - [`f1ff81e`](https://github.com/horizon-rust/horizon/commit/f1ff81e874950a213c543ae51ab9efadef874e00) launcher: spacers carry only their height; the version verdict leaves the check thread plainly ### 📊 Changes **6 files changed** (+464 additions, -116 deletions) <details> <summary>View changed files</summary> 📝 `launcher/README.md` (+6 -0) 📝 `launcher/src/cull.rs` (+307 -69) 📝 `launcher/src/main.rs` (+5 -2) 📝 `launcher/src/modpacks_page.rs` (+17 -5) 📝 `launcher/src/mods_page.rs` (+56 -17) 📝 `launcher/src/mods_project.rs` (+73 -23) </details> ### 📄 Description > 🤖 Opened by Robert's AI agent (OpenAI Codex / GPT-6.1 Sol), not by Robert himself. ## What and why Opening or scrolling Mods rebuilt every loaded result and icon. Installed mods and modpack coverage reports also built every row. Versions and Patch notes had warm-frame culling, but still built every row initially, on resize and after pagination, plus one placeholder element per hidden row. - Make the existing page-scroll helper build nearby rows from the first frame, estimate unseen heights, measure wrapping as rows enter view and combine hidden ranges into spacers. Preserve the existing row components and outer scrollbar. - Use it for mod results, installed mods, coverage reports and project versions, as well as the existing Versions/Patch notes consumers. Reset measurements when searches, filters, packs or installed entries change; keep active removal confirmations rendered. - Build icons and clone project data only for rows being rendered. Share project details/version data and borrow release lists instead of cloning entire collections per frame. Read cached version verdicts with the background request and preserve later check updates in either event order. - Keep the final row visible when measurement changes the height after dragging to the bottom; leave the current viewport in place when More appends results. The regression fixture has 10,000 rows: the first frame constructs at most 17 row elements instead of all 10,000. This measures bounded element construction, not an end-to-end frame-rate claim. A real GPUI desktop test also checks visible rows and the final row after scrollbar jumps. Open launcher PRs and issues were checked before starting; none covers this rendering issue. This branch is independent of #1574 and #1575. The scope warning below includes replacing the old culling implementation and the new tests; the helper, its consumers and regression coverage ship as one performance fix. No dependencies or lockfile changes. ## Vanilla reference Horizon-only launcher rendering. Existing styling, row contents and page composition are preserved; gameplay is unchanged. ## Self-check **pr_ready** (`tools/pr_ready.py` on DESKTOP-KI5NGSR, against origin/main at 7fca3c2f9, 8 s) | Check | Result | | --- | --- | | Scope | ⚠️ 6 files, +476 −116; 586 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ | | launcher clippy | ❌ failed (2 s) | | launcher tests | ✅ 111 passed (4 s) | | 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) | Additional validation: - `cargo test --manifest-path launcher/Cargo.toml --locked`: 140 passed; two existing optional tests and the new desktop test are ignored by default. - `cargo test --manifest-path launcher/Cargo.toml --bin horizon-launcher desktop_list_renders_the_viewport_after_scrollbar_jumps -- --ignored --nocapture`: passed on Windows with a real GPUI window and 10,000 rows of different heights. Checks jumps to the final row and back, bounded row construction, and visible rows rather than spacers. The stricter final-row assertion caught and now covers the bottom-anchoring edge case. - Geometry tests cover initial rendering, large jumps, resize, appending results, retained confirmations and measurement invalidation. - Strict launcher Clippy remains blocked by the existing Windows dead-code diagnostics for `name_in` and `link_stays_inside` in `launcher/src/mojang.rs`. An additional all-targets Clippy pass with only `dead-code` allowed passed. The required self-check above retains the failure. Why existing tests missed this: the old helper's tests checked geometry and explicitly expected all rows to be drawn before measurement. No test bounded first-frame element construction or checked the final visible row after a large scrollbar jump. The new tests cover both. The desktop test is opt-in for environments without an interactive desktop/GPU; a live Modrinth session and end-to-end frame timing are outside that fixture. 🤖 Generated with [OpenAI Codex](https://openai.com/codex/) (GPT-6.1 Sol). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:10: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#3603
No description provided.