fix(mods): a movable mod's line keeps its author and page line when its detail is cut, not only its place's lines #3189

Merged
HumanBean merged 2 commits from cuecuemoar/Longshot:fix/mods-tab-move-help into main 2026-12-04 20:28:12 +00:00
Contributor

Summary

The mods-tab test a mod's long description and the lines after it fit the help card, 1024 bytes (#3101) fails on main (its author whole, after the description cut). Two changes met: #3137 gave a movable mod's line the help join(modHelp(...), moveHelp()), and #3149 made join fit the help box by cutting its first part and keeping the rest whole. So for a long mod detail the whole mod help was the part cut, its author ("By mooki.") and the line about its page with it, while the place's lines were kept.

modHelp now takes the place's lines among the lines it keeps whole (after), so only the detail is cut; ModLineOf passes them there instead of joining afterwards.

A correction to #3149, which was mine: its test, and its description, called the cut part "a mod's description, up to 1024 bytes". It is the mod's detail, the Mods tab's "Has" line ("Has: a script (main.js). Permissions: …", game/crates/api/src/loader/mod.rs: never the description), which is short in practice. So no help a player sees changes here: the test's long detail is made up, and the cut it guards is for one nothing else bounds. The test's comment says so now.

Read first: game/mods/mods-tab/src/view.ts modHelp; game/mods/mods-tab/src/main.tsx ModLineOf.

See #3149, #3137.

Testing

Tested: Windows 10, RTX 4090, driver 617.42, keyboard and mouse. A runtime of #3188's first head (2287b5e77, on main b77c2f4b3; its Mods tab code is main's, and this PR's files are the same on 9f76a4379) with two player mods in its profile (Long, by mooki, and a second one, so the list can move), its system mods' scripts from a folder (HOS_SYSTEM_MODS_DIR): main's Mods tab, then the same with this PR's two files. Insert, Mods, the line Long: the same help in both ("Has: nothing that loads. By mooki.", the line about its page, then its place's two lines), as a real "Has" line is short; no fault in either run's log. Screenshots in the comment below.

Checks (Linux, WSL Ubuntu 22.04):

  • cargo test -p modtool --lib the_mods_tab_passes_its_tests: on main and on the test commit 1f37dc804 the test fails (its author whole, after the description cut); on 5ff9495dd it passes, and every_built_in_mod_passes too.
  • tests/test_gfx_effects.py (reads main.tsx) passes on both sides.
  • The whole suite --strict on 5ff9495dd against main 9f76a4379: 844 passed, 46 failed, 13 skipped on both, the same 46 files (they fail on main in this WSL).

Still to test:

  • None.

Measurements

Nothing to measure: the same help text, made once per line.

Risks

None a player sees. A revert is enough.

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.
  • A check under tests/ that reads changed source is updated, not weakened (tests/test_gfx_effects.py reads game/mods/mods-tab/src/main.tsx: it passes unchanged).
  • Screenshots of the same spot on main and here, for a change that shows on screen.
  • 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.ai/code/session_01VxeaZhRaNmRu5soDyrEw1o

## Summary The mods-tab test `a mod's long description and the lines after it fit the help card, 1024 bytes (#3101)` fails on `main` (`its author whole, after the description cut`). Two changes met: #3137 gave a movable mod's line the help `join(modHelp(...), moveHelp())`, and #3149 made `join` fit the help box by cutting its first part and keeping the rest whole. So for a long mod detail the whole mod help was the part cut, its author ("By mooki.") and the line about its page with it, while the place's lines were kept. `modHelp` now takes the place's lines among the lines it keeps whole (`after`), so only the detail is cut; `ModLineOf` passes them there instead of joining afterwards. A correction to #3149, which was mine: its test, and its description, called the cut part "a mod's description, up to 1024 bytes". It is the mod's `detail`, the Mods tab's "Has" line ("Has: a script (main.js). Permissions: …", `game/crates/api/src/loader/mod.rs`: never the description), which is short in practice. So no help a player sees changes here: the test's long detail is made up, and the cut it guards is for one nothing else bounds. The test's comment says so now. Read first: `game/mods/mods-tab/src/view.ts` `modHelp`; `game/mods/mods-tab/src/main.tsx` `ModLineOf`. See #3149, #3137. ## Testing **Tested:** Windows 10, RTX 4090, driver 617.42, keyboard and mouse. A runtime of #3188's first head (2287b5e77, on `main` b77c2f4b3; its Mods tab code is `main`'s, and this PR's files are the same on 9f76a4379) with two player mods in its profile (`Long`, by mooki, and a second one, so the list can move), its system mods' scripts from a folder (`HOS_SYSTEM_MODS_DIR`): `main`'s Mods tab, then the same with this PR's two files. Insert, Mods, the line `Long`: the same help in both ("Has: nothing that loads. By mooki.", the line about its page, then its place's two lines), as a real "Has" line is short; no fault in either run's log. Screenshots in the comment below. Checks (Linux, WSL Ubuntu 22.04): - `cargo test -p modtool --lib the_mods_tab_passes_its_tests`: on `main` and on the test commit 1f37dc804 the test fails (`its author whole, after the description cut`); on 5ff9495dd it passes, and `every_built_in_mod_passes` too. - `tests/test_gfx_effects.py` (reads `main.tsx`) passes on both sides. - The whole suite `--strict` on 5ff9495dd against `main` 9f76a4379: 844 passed, 46 failed, 13 skipped on both, the same 46 files (they fail on `main` in this WSL). **Still to test:** - None. ## Measurements Nothing to measure: the same help text, made once per line. ## Risks None a player sees. A revert is enough. ## 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. - [x] A check under `tests/` that reads changed source is updated, not weakened (`tests/test_gfx_effects.py` reads `game/mods/mods-tab/src/main.tsx`: it passes unchanged). - [x] Screenshots of the same spot on `main` and here, for a change that shows on screen. - [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) https://claude.ai/code/session_01VxeaZhRaNmRu5soDyrEw1o
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VxeaZhRaNmRu5soDyrEw1o
fix(mods): a movable mod's line keeps its author and page line when its detail is cut, not only its place's lines
Some checks are pending
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 6s
5ff9495ddf
A movable mod's line (#3137) joined its help and its place's lines with join(), which cuts the first part to fit the
help box (#3149): for a long detail (the mod's "Has" line), the whole mod help was cut, its author and the line about
its page with it, and the place's lines kept. modHelp now takes the place's lines among the lines it keeps whole, so
the detail alone is cut. A real "Has" line is short, so the help shown in game is the same as before; this makes the
mods-tab test that fails on main pass again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VxeaZhRaNmRu5soDyrEw1o
Author
Contributor

Tested in game: Windows 10, RTX 4090, driver 617.42; Mods tab (Insert) with two player mods (Long by mooki, and a second, movable), main's Mods tab then this PR's two files via HOS_SYSTEM_MODS_DIR: the same help in both, as a real Has line is short; no fault in either log.

Tested in game: Windows 10, RTX 4090, driver 617.42; Mods tab (Insert) with two player mods (Long by mooki, and a second, movable), main's Mods tab then this PR's two files via HOS_SYSTEM_MODS_DIR: the same help in both, as a real Has line is short; no fault in either log.
Author
Contributor

Screenshots: Windows 10, RTX 4090; Insert, Mods, the line Long (a player mod by mooki, with a second mod so the list can move).

main's Mods tab:

main

This PR's two files:

this PR

The same help: a real "Has" line is short, so nothing is cut on either side. What this PR changes shows only for a "Has" line long enough to be cut, as its test makes it.

Screenshots: Windows 10, RTX 4090; Insert, Mods, the line `Long` (a player mod by mooki, with a second mod so the list can move). `main`'s Mods tab: ![main](https://git.magicbean.dev/attachments/08f83fef-ae87-40dd-997c-228db21fe734) This PR's two files: ![this PR](https://git.magicbean.dev/attachments/2a6208bd-9fbc-43d0-87e9-c22dcfa7117d) The same help: a real "Has" line is short, so nothing is cut on either side. What this PR changes shows only for a "Has" line long enough to be cut, as its test makes it.
cuecuemoar changed title from WIP: fix(mods): a movable mod's line keeps its author and page line when its detail is cut, not only its place's lines to fix(mods): a movable mod's line keeps its author and page line when its detail is cut, not only its place's lines 2026-12-04 18:03:49 +00:00
Owner
@review
BeanBot left a comment

Recommendation: Approve. The test shows the long-detail case is fixed, but a long loader note can now hide the instructions for moving a mod. CI is still running. Nothing blocking is left. Recommend approval; not approved on the forge.

The change keeps a movable mod’s author and page hint when its detail is cut to fit the help card. It also changes which text survives when the loader’s note is very long.

Should fix (1): not blocking, but worth doing before merging.

  • L1 game/mods/mods-tab/src/view.ts:128: A long loader note can now cut off the movable mod’s reorder instructions. (more on the line) Do: Reserve room for the move instructions when the note is long, truncating the note as needed, and add a test with a long note.

@fix can do L1.

Checks: Still running: 11 checks.

More: does it help, other systems, switches, what was read

Does it help: Yes for the tested case: the author reports that the game-free test fails on main and passes on this head. The in-game comparison showed the same help on both sides with a short real detail.

Other systems: The change affects Mods-tab help text on Windows and Linux, including translated text and movable player mods. It does not change rendering, mod ordering or saved settings.

Switches: None.

Reviewed: 5ff9495ddf against 9f76a4379c: Read the changed files, the diff and commit messages, repository rules, PR template and standards; traced modHelp, moveHelp, their callers and loader note construction. The separate Tooling checkout was unavailable. Screenshots were described in comments but could not be opened with the network closed.; nothing run (a code review).

Checked and fine:

  • The changed test exercises a movable mod and checks the author, page hint and final move-help text.
  • No switches, generated files, game-derived files or renderer API changes were added.
  • Both commits record AI assistance.

Testing: No code or tests were run during review. The author reports the relevant game-free test passing on this head and failing on main; CI is still running.

Overlaps and merge order: None found in the supplied context.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The test shows the long-detail case is fixed, but a long loader note can now hide the instructions for moving a mod. CI is still running. Nothing blocking is left. Recommend approval; not approved on the forge. The change keeps a movable mod’s author and page hint when its detail is cut to fit the help card. It also changes which text survives when the loader’s note is very long. **Should fix (1)**: not blocking, but worth doing before merging. - **L1** `game/mods/mods-tab/src/view.ts:128`: A long loader note can now cut off the movable mod’s reorder instructions. (more on the line) **Do:** Reserve room for the move instructions when the note is long, truncating the note as needed, and add a test with a long note. `@fix` can do L1. **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes for the tested case: the author reports that the game-free test fails on main and passes on this head. The in-game comparison showed the same help on both sides with a short real detail. **Other systems:** The change affects Mods-tab help text on Windows and Linux, including translated text and movable player mods. It does not change rendering, mod ordering or saved settings. **Switches:** None. **Reviewed:** 5ff9495ddf29 against 9f76a4379cea: Read the changed files, the diff and commit messages, repository rules, PR template and standards; traced modHelp, moveHelp, their callers and loader note construction. The separate Tooling checkout was unavailable. Screenshots were described in comments but could not be opened with the network closed.; nothing run (a code review). **Checked and fine:** - The changed test exercises a movable mod and checks the author, page hint and final move-help text. - No switches, generated files, game-derived files or renderer API changes were added. - Both commits record AI assistance. **Testing:** No code or tests were run during review. The author reports the relevant game-free test passing on this head and failing on main; CI is still running. **Overlaps and merge order:** None found in the supplied context. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -124,3 +126,3 @@
hint = `${t("profile.json is not a list of mods, so your switches are not read (the log says why).")} ${hint}`;
// (a long description cut, its author kept whole after it)
return fitHelp(r.detail.trim(), [hint.trim()], by);
return fitHelp(r.detail.trim(), [hint.trim(), ...after.map((l) => l.trim())], by);
Member

L1 (should fix): A long loader note can now cut off the movable mod’s reorder instructions.

When: For a movable mod with a sufficiently long note, such as a script reload compile error, the note and move help exceed 1024 bytes together. fitHelp cuts the combined tail at the end, removing some or all of the move instructions; previously the outer join reserved room for those instructions.

Do: Reserve room for the move instructions when the note is long, truncating the note as needed, and add a test with a long note.

**L1** (should fix): A long loader note can now cut off the movable mod’s reorder instructions. *When:* For a movable mod with a sufficiently long note, such as a script reload compile error, the note and move help exceed 1024 bytes together. fitHelp cuts the combined tail at the end, removing some or all of the move instructions; previously the outer join reserved room for those instructions. **Do:** Reserve room for the move instructions when the note is long, truncating the note as needed, and add a test with a long note.
HumanBean deleted branch fix/mods-tab-move-help 2026-12-04 20:28:12 +00:00
Some checks are pending
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 6s
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
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!3189
No description provided.