fix(mods): a drag in the Mods tab stops at the loads-last line #3235

Merged
HumanBean merged 2 commits from HumanBean/Longshot:fix/mods-drag-split into main 2026-12-05 16:56:27 +00:00
Owner

Summary

In the Mods tab, a mod could be dragged (or moved with the keys or a controller) past the mods marked Loads last (#3192). The list showed it there, then snapped back, because the loader refuses that move. To see it on main: with two mods of your own and one with order = "last", drag the first one below the last one and let go. Nothing changes.

Now the held mod stops at the line between the two groups, as in the launcher (MagicBeanDev/LongshotLauncher#418).

  • A Box with onReorder takes a new optional reorderSplit: its children before that index and those from it on are ordered apart. The kit's ReorderList takes it as split, so any mod can use it.
  • The Mods tab sets it to where the mods marked Loads last begin.

Read game/crates/ui/src/core/reorder.rs first (bounds), then ops.rs, kit.tsx and mods-tab/src/main.tsx.

Testing

Tested: Linux, RTX 3090, driver 620.70.06, from the kokiri-start save, in a headless gamescope window, with three file-only mods (two ordinary, then one with order = "last"). The mouse dragged the first mod far past the end of the list.

  • With the split line taken out of the Mods tab (as main has it): the saved order did not change.
  • With this change: the mod was saved just above the one that loads last (log: test/other moved down (at the next start)).
  • A fourth mod added while the game ran was picked up (log: test/late: added while the game runs (off: switch it on in the Mods tab)).
  • No screenshots: frame dumps leave the menu out when the game has a window, which the mouse needs.

The game run was on the head before a rebase over one commit of main (#3209, pause menu buttons).

Checks:

  • The new Mods tab assertion fails at the test commit ("never below one that loads last") and passes with the fix.
  • mise run test before that rebase: 886 passed, 12 failed, 13 skipped. The same 12 fail on main and here after it: test_lifter (Clippy "large array defined as const" in host-sys, and a build-driver test), test_present_acquire_ahead, test_present_held_image, test_present_image_free, test_present_geometry_trace, test_dlssg, test_ui_renderer, test_sync_watch_event, test_turf_budget, test_vk_draw_overhead_lean, test_no_game_title, test_no_map_reload.
  • After the rebase: cargo test -p game-ui 195 passed (with the new no_item_crosses_a_lists_split). cargo test -p modtool testing_game:: 39 passed, 1 failed, 2 ignored; the failure is the_menu_passes_its_tests (layout, "the developer page"), which fails the same way on main.
  • cargo fmt --check, schema-gen --check, ffi-gen --check and Clippy on game-ui pass.

Still to test:

  • Linux or Windows: drag, Ctrl+Space and controller Y moves at the Loads last line, expecting the held mod to stop there (by hand)

Measurements

Nothing to measure: it changes which places a held list item can take.

Risks

A list with no reorderSplit behaves as before. reorderSplit is a new optional property of the mod UI API; nothing existing changes meaning. A revert is enough. Nothing changes in saves, settings or caches.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named).
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here.
  • Screenshots of the same spot on main and here, for a change that shows on screen. (Not taken yet: the run needed a window for the mouse, and its frame dumps leave the menu out.)
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary In the Mods tab, a mod could be dragged (or moved with the keys or a controller) past the mods marked **Loads last** ([#3192](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/3192)). The list showed it there, then snapped back, because the loader refuses that move. To see it on `main`: with two mods of your own and one with `order = "last"`, drag the first one below the last one and let go. Nothing changes. Now the held mod stops at the line between the two groups, as in the launcher ([MagicBeanDev/LongshotLauncher#418](https://git.magicbean.dev/MagicBeanDev/LongshotLauncher/pulls/418)). - A `Box` with `onReorder` takes a new optional `reorderSplit`: its children before that index and those from it on are ordered apart. The kit's `ReorderList` takes it as `split`, so any mod can use it. - The Mods tab sets it to where the mods marked Loads last begin. Read `game/crates/ui/src/core/reorder.rs` first (`bounds`), then `ops.rs`, `kit.tsx` and `mods-tab/src/main.tsx`. ## Testing **Tested:** Linux, RTX 3090, driver 620.70.06, from the `kokiri-start` save, in a headless gamescope window, with three file-only mods (two ordinary, then one with `order = "last"`). The mouse dragged the first mod far past the end of the list. - With the `split` line taken out of the Mods tab (as `main` has it): the saved order did not change. - With this change: the mod was saved just above the one that loads last (log: `test/other moved down (at the next start)`). - A fourth mod added while the game ran was picked up (log: `test/late: added while the game runs (off: switch it on in the Mods tab)`). - No screenshots: frame dumps leave the menu out when the game has a window, which the mouse needs. The game run was on the head before a rebase over one commit of `main` (#3209, pause menu buttons). Checks: - The new Mods tab assertion fails at the test commit ("never below one that loads last") and passes with the fix. - `mise run test` before that rebase: 886 passed, 12 failed, 13 skipped. The same 12 fail on `main` and here after it: `test_lifter` (Clippy "large array defined as const" in host-sys, and a build-driver test), `test_present_acquire_ahead`, `test_present_held_image`, `test_present_image_free`, `test_present_geometry_trace`, `test_dlssg`, `test_ui_renderer`, `test_sync_watch_event`, `test_turf_budget`, `test_vk_draw_overhead_lean`, `test_no_game_title`, `test_no_map_reload`. - After the rebase: `cargo test -p game-ui` 195 passed (with the new `no_item_crosses_a_lists_split`). `cargo test -p modtool testing_game::` 39 passed, 1 failed, 2 ignored; the failure is `the_menu_passes_its_tests` (layout, "the developer page"), which fails the same way on `main`. - `cargo fmt --check`, `schema-gen --check`, `ffi-gen --check` and Clippy on `game-ui` pass. **Still to test:** - Linux or Windows: drag, Ctrl+Space and controller Y moves at the Loads last line, expecting the held mod to stop there (by hand) ## Measurements Nothing to measure: it changes which places a held list item can take. ## Risks A list with no `reorderSplit` behaves as before. `reorderSplit` is a new optional property of the mod UI API; nothing existing changes meaning. A revert is enough. Nothing changes in saves, settings or caches. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. - [ ] Screenshots of the same spot on `main` and here, for a change that shows on screen. (Not taken yet: the run needed a window for the mouse, and its frame dumps leave the menu out.) - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Assisted-by: Claude Code
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
fix(mods): a drag in the Mods tab stops at the loads-last line
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
4e90e30aa4
A mod could be dragged or moved past the mods that load last, shown there, and
snapped back on release. A Box with onReorder now takes reorderSplit (the kit's
ReorderList: split): the children before it and those from it on are ordered
apart, by the pointer, the keys and the controller. The Mods tab sets it to
where the mods marked Loads last begin.

Assisted-by: Claude Code
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Author
Owner

Tested in game: Linux, RTX 3090, driver 620.70.06, kokiri-start: dragged a mod past a loads-last mod; it was saved just above it. With the split taken out, as main has it, the order did not change.

Tested in game: Linux, RTX 3090, driver 620.70.06, kokiri-start: dragged a mod past a loads-last mod; it was saved just above it. With the split taken out, as main has it, the order did not change.
HumanBean force-pushed fix/mods-drag-split from 4e90e30aa4
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 5cec70cead
Some checks failed
CI / What the change needs (pull_request) Successful in 9s
CI / Third-party parts and guide screenshots (pull_request) Successful in 14s
PR description / Title and description (pull_request_target) Failing after 6s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 17s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 1m24s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 11m48s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 10m34s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 9m50s
CI / Website build and checks (pull_request) Failing after 39s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 47m22s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 1h0m4s
2026-12-05 08:33:12 +00:00
Compare
HumanBean changed title from WIP: fix(mods): a drag in the Mods tab stops at the loads-last line to fix(mods): a drag in the Mods tab stops at the loads-last line 2026-12-05 16:56:20 +00:00
HumanBean deleted branch fix/mods-drag-split 2026-12-05 16:56:28 +00:00
Sign in to join this conversation.
No reviewers
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
MagicBeanDev/Longshot!3235
No description provided.