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
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3189
Loading…
Reference in a new issue
No description provided.
Delete branch "cuecuemoar/Longshot:fix/mods-tab-move-help"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The mods-tab test
a mod's long description and the lines after it fit the help card, 1024 bytes (#3101)fails onmain(its author whole, after the description cut). Two changes met: #3137 gave a movable mod's line the helpjoin(modHelp(...), moveHelp()), and #3149 madejoinfit 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.modHelpnow takes the place's lines among the lines it keeps whole (after), so only the detail is cut;ModLineOfpasses 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.tsmodHelp;game/mods/mods-tab/src/main.tsxModLineOf.See #3149, #3137.
Testing
Tested: Windows 10, RTX 4090, driver 617.42, keyboard and mouse. A runtime of #3188's first head (2287b5e77, on
mainb77c2f4b3; its Mods tab code ismain's, and this PR's files are the same on9f76a4379) 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 lineLong: 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: onmainand on the test commit1f37dc804the test fails (its author whole, after the description cut); on5ff9495ddit passes, andevery_built_in_mod_passestoo.tests/test_gfx_effects.py(readsmain.tsx) passes on both sides.--stricton5ff9495ddagainstmain9f76a4379: 844 passed, 46 failed, 13 skipped on both, the same 46 files (they fail onmainin this WSL).Still to test:
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
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.tests/that reads changed source is updated, not weakened (tests/test_gfx_effects.pyreadsgame/mods/mods-tab/src/main.tsx: it passes unchanged).mainand here, for a change that shows on screen.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
https://claude.ai/code/session_01VxeaZhRaNmRu5soDyrEw1o
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.
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:This PR's two files:
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.
WIP: fix(mods): a movable mod's line keeps its author and page line when its detail is cut, not only its place's linesto fix(mods): a movable mod's line keeps its author and page line when its detail is cut, not only its place's lines@review
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.
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.@fixcan 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:
5ff9495ddfagainst9f76a4379c: 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:
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.
@ -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);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.