feat(mods): plain mods build their exefs code; mod ordering by drag and drop and a full menu search #3137
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3137
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Longshot:feat/plain-exefs-mods"
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
Two parts, kept in one pull request at the author's request: plain mods build their code, and a set of Mods tab and menu changes (about one commit each).
Plain mods
A mod copied into
mods/in the emulators' layout (romfs/,exefs/,cheats/, nomod.toml) has had itsexefscode left out of builds since #2822. The player was told "Some mods still need importing", which does not say what to do, andmod importleaves the original folder behind.Now such a mod needs no import. Its
exefspatch files andsubsdkmodules make it a code modlocal/<folder>: switch it on, accept the code warning once, and the next Play builds it in. It asks again when the code changes. Until accepted, its code does not reach the build at all (not even behind a switch), and itsromfsfiles and cheats work as before. Follows #3105, which starts hand-copied mods Off. See #2497 (modules in emulator-layout mods; this covers the layout, not that issue's particular mod, which was not tried).mod_needs_importwarning andgame-files'mod_layoutare gone.exefs/only the files the acceptance hashes. Before, a linked file, a.pchtxtwith no stem or (on Windows)SUBSDK9was built without being hashed,mod.tomlmods included.Read first:
game/crates/code-mods/src/lib.rs(find),builder/crates/game-files/src/code_mods.rs(exefs_mods),builder/crates/game-files/src/patches.rs(exefs_files),game/crates/api/src/loader/mod.rs(code_status,merge_ids),game/crates/modtool/src/profile.rs(plain_mod).Known gaps:
mod.tomlmod whose code is not accepted is still passed to the build as off, which looks able to compile its patches in behind a switch.Menu
ReorderList,game/crates/ui/src/core/reorder.rs) any mod can use, and amoveToedit.system/menugainsmods.host(it only reads) and tells the Mods tab where to go with its own event. In the UI engine, a newautoFocuscontrol in a system mod's slot filler can take the focus.Buttonvariant). ATextInputwhose own style setstextAlignnow follows it at rest.$text.*size, and its own tab, list and title texts, at 0.9, so labels fit.Testing
The menu part was partly tried in the game by the author on an earlier head (drag and drop, search field, option orders); the full search, the label and text-size changes and the later spacing have not been seen in the game. Second agents reviewed the menu commits and the search; their findings are fixed, except that a search result for a locked setting opens its page without taking the focus.
Checks on the whole branch at
79dba54d(mainmerged in), Linux: the changed-file Python checks,cargo testof the affected crates, the ignored end-to-end test, clippy, the sandbox tests,schema-genandffi-gen --checkandcargo fmt --checkpass, but for two tests that also failed on unmodifiedmainearlier today:installed_versions_reuse_their_own_builds_with_one_profileandthe_repository_s_lock_and_the_table_agree(test_lifter.pyfails with the latter).Tested: plain mods: a real game build and headless starts on Linux (CachyOS), NVIDIA RTX 3090, driver 620.70.06, at
037c06d2, from a repository save (kokiri-start), with a new profile holding one plain mod: a.pchtxtwriting a marker into unused padding, and oneromfsfile.romfsfile.mod installedthenmod allow --yes --sha256 <the hash it reported>, as the launcher does it: accepted; the row went fromaskstowaits.romfsfile;mod installedsaidbuilt, nothing waiting.fast check: current, nothing rebuilt.A second agent reviewed the code before the PR opened; its findings are fixed, with tests.
Still to test:
subsdkmodule in a plain folder, in a real build (by hand).Measurements
Nothing to measure: no change aims at speed.
Risks
exefsmod that was ignored now asks to be accepted, and is built in once accepted and on. Accepting means running that mod's code in the game.exefs/is no longer built.mod_needs_importis unused with builders that have this change.gotoevent and learn which mod result was picked. Mods' ownTextInputs are unchanged; the old one-stepmoveedit stays for the mod API. A revert is enough.trust.jsonare then ignored.Checklist
Ready for review
main; the title is a Conventional Commit. (Two topics, joined at the author's request.)mise run testpasses (any failure that also fails onmainis named). (Only the affected checks ran, not the whole suite.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand here, for a change that shows on screen. (The Mods tab: the control bridge's screenshots leave the menu out; by hand.)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
Possibly related, for context:
@review
Recommendation: Request changes. A converted copy can suppress an enabled emulator mod even when the copy is off or unaccepted. The real-game and launcher flows also remain untested.
The change discovers code in emulator-layout mods, asks the player to accept it, and includes accepted code in a subsequent build. It removes the import warning, but copy selection can leave a player's enabled code unapplied or direct acceptance to the wrong copy.
Blocking (1): must change before merging.
game/crates/code-mods/src/lib.rs:691: A matching manifest copy suppresses the plain mod regardless of whether that copy can contribute its code. (more on the line) Do: Choose a single effective copy using the profile's enabled and acceptance state, and keep the plain mod eligible when the matching copy will not contribute its code. Keep the loader and builder selection rules aligned.Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)
@fixcan do L1.Checks: Still running: 11 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven in a real game: the PR reports a passing synthetic end-to-end build, but no real game build or start. This is not a performance change.
Other systems: The change affects the builder, game Mods tab, launcher trust flow, profile stamps and pinned mods on Windows and Linux. The reported synthetic run covers the builder path; the real-game and Windows launcher flows have not been exercised.
Switches: No switches added, changed or removed.
Reviewed:
24574b7e3cagainstde8dee94ed: Read the repository instructions, contributing rules, standards and PR template; the commit and diff; and the changed acceptance, discovery, builder and loader paths with their surrounding code. Skimmed the remaining documentation and tests. The full contents of every changed code file were not read, so this review is incomplete.; nothing run (a code review).Checked and fine:
Testing: No commands that build, run tests or execute project code were run, as requested. The PR reports passing affected synthetic and crate checks, with failures also seen on its base; CI was still running.
Overlaps and merge order: Unknown; network access was unavailable.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -634,0 +688,4 @@}// (a converted copy's code is the original's: built once, as the manifest mod. After the pins: the game counts them)let held: Vec<String> = out.iter().filter_map(|m| patch_hash(&m.files)).collect();plain.retain(|m| !patch_hash(&m.files).is_some_and(|h| held.contains(&h)) && !out.iter().any(|o| o.id == m.id));L1 (blocking): A matching manifest copy suppresses the plain mod regardless of whether that copy can contribute its code.
When: An enabled and accepted plain mod has the same patches as an imported copy that is off or has not been accepted. The plain mod is removed from discovery, while the copy is not applied, so the enabled mod's patches disappear from the build.
Do: Choose a single effective copy using the profile's enabled and acceptance state, and keep the plain mod eligible when the matching copy will not contribute its code. Keep the loader and builder selection rules aligned.
e8a36576bd037c06d2beAddressed the review.
L1 (blocking): fixed in
037c06d2. A converted copy now takes the original's place only while it brings the code (switched on, accepted, same patch files and modules), in both the builder (game_files::code_mods::ordered) and the game (code_status). Off or not accepted, the original is built and asks for itself. Tests in both. One case is unchanged on purpose: a folder already named as its copy's id (mods/foobesidemods/local~foo) shares one id, switch and trust entry, so the copy alone is that mod.L2: run on Linux (RTX 3090): a real build and start before and after accepting, then a third build that rebuilt nothing. Patch and
romfsbehaviour as expected; details in Testing.L3: not run. No Windows launcher or in-game Mods tab run; both stay under Still to test, by hand. The launcher's steps were followed on the command line, and running them turned up a hash format it would have refused (fixed in
2b6cf7d8).On the related items: #984's module support is already on
mainthrough the mod API; this PR only extends who gets it to emulator-layout folders. #2497 is linked in the Summary.@review
Recommendation: Approve. The code is ready: only testing is left. The recorded Linux build and starts show the plain-mod acceptance path working, and the converted copy no longer suppresses the original when the copy is off or unaccepted. The Windows launcher and in-game Mods tab acceptance flows still need a run. Recommend approval; not approved on the forge.
Emulator-layout mods can have their ExeFS code accepted and built without an import step, while retaining their RomFS files and cheats. The change removes an import warning and adds matching and trust logic to avoid building a converted copy twice.
Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
Since the last review (on
24574b7e3c)Resolved: L1 (A matching manifest copy suppresses the plain mod regardless of whether that copy can cont…); L2 (The accepted and unaccepted plain-mod paths have not been exercised in a real game build.)
Still open: L3 (The Windows launcher and Mods tab acceptance flow has not been exercised.)
Checks: Still running: 11 checks.
Also noticed (2; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Yes: the author reports a Linux real-game build and headless start both before and after acceptance, with the patch marker present in the built image after acceptance and a subsequent fast check requiring no rebuild. The marker was not read from running memory.
Other systems: The builder, game loader, mod tool and launcher acceptance flow share the changed code or its output. Linux was exercised; Windows and the in-game Mods tab remain untested. A real build with a subsdk module and an existing imported copy has not been reported.
Switches: No switches added, changed or removed.
Reviewed:
037c06d2beagainstf536e7d061: Read AGENTS.md and CONTRIBUTING.md, the principal code diffs and the relevant builder and loader paths for the ledger items. Other changed files, tests and documentation were not read in full; the recorded run and CI results were reviewed from the pull request.; nothing run (a code review).Checked and fine:
Testing: No commands that build, run tests or execute project code were run during this review. The author reports affected Rust checks and a Linux real-game build and starts; Windows launcher and Mods tab runs remain outstanding.
Overlaps and merge order: None found in the supplied information.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
037c06d2be1af4566638WIP: feat(mods): an emulator mod's exefs code is built in with no import stepto WIP: feat(mods): plain mods build their exefs code; mods are ordered by drag and drop1af4566638c277cc8bdaHumanBean referenced this pull request2026-12-04 04:14:13 +00:00
WIP: feat(mods): plain mods build their exefs code; mods are ordered by drag and dropto WIP: feat(mods): plain mods build their exefs code; mod ordering by drag and drop and a full menu search@rebase
This pull request has merge commits, so I brought it up to date by merging
main(1c8c2634c7) into it rather than rebasing (its history stays as it is): the new head isc5aa395eed.Conflicts resolved
Nothing was built or run: read the resolution before merging.
Automated rebase by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@review
WIP: feat(mods): plain mods build their exefs code; mod ordering by drag and drop and a full menu searchto feat(mods): plain mods build their exefs code; mod ordering by drag and drop and a full menu searchRecommendation: Approve. The code is ready: only testing is left. The plain-mod patch worked in the recorded Linux build and start, but the Windows launcher and in-game Mods tab acceptance flows remain untested. The menu changes also need their stated in-game checks, and CI is still running. Recommend approval; not approved on the forge.
Plain emulator-layout mods can build accepted code without importing, while the Mods tab gains reordering and broader search. The changes expand the UI and build paths substantially; their full player-facing behavior remains unverified.
Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
Since the last review (on
037c06d2be)Still open: L3 (The Windows launcher and Mods tab acceptance flow has not been exercised.)
Checks: Still running: 11 checks.
Also noticed (2; not asked for, not blocking)
More: does it help, other systems, switches, what was read
Does it help: Unproven overall. The author reports a Linux build and headless start with a patch and romfs file before and after acceptance, plus a subsequent build that rebuilt nothing; the patch was not read back from running memory. This is not a performance change.
Other systems: The builder and acceptance flow affect Windows and Linux; the recorded real build covers Linux with one patch, but not a subsdk module or the Windows launcher. Reordering and search affect keyboard and controller users; their complete in-game flows remain to be exercised.
Switches: No switches were added, changed, or removed in the inspected changes.
Reviewed:
c5aa395eedagainst1c8c2634c7: Read AGENTS.md, CONTRIBUTING.md, game/mods/menu/src/mods.ts and game/mods/menu/src/search.tsx; inspected the reorder implementation, Mods tab acceptance controls, sandbox diff, loader tab diff, commit list and change summary. The large remaining diff, changed code files, translations and generated files were not fully reviewed. The referenced Tooling AGENTS.md was unavailable locally.; nothing run (a code review).Checked and fine:
Testing: No commands from the project were run. The author reports affected checks and a Linux game build and headless starts on earlier heads; the listed CI checks are still running on this head.
Overlaps and merge order: Not checked; network access is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its rebase. Nothing was run; a maintainer decides.