Skip to content

Open Browse's main file picker only when a mod has several Main files - #24927

Draft
r1chm8 wants to merge 2 commits into
masterfrom
fix/main-file-count
Draft

r1chm8 wants to merge 2 commits into
masterfrom
fix/main-file-count

Conversation

@r1chm8

@r1chm8 r1chm8 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Browse's 1-click install used to fetch a mod's files whenever its main file wasn't marked primary, just to find out whether there was anything to choose. The v3 API now says how many Main files a mod has (flamework#5292), so the picker only opens when there's a real choice.

Warning

Don't merge until production serves count. As of opening this, GET /v3/mods/{id} doesn't return it yet. Without it, count > 1 is false, so a mod with several Main files and no primary would install its newest one without asking.

What changes

  • Spec: openapi.yaml taken from flamework master after error: Unknown error (433) Backup couldn't be read: Unknown error (433) #5292. The only difference is the new required count on ModMainFileVersion: the mod's Main files that cleared the security scan, including this one.
  • The guard: the picker opens on !is_primary && count > 1, as the API PR recommends.
    • Several Main files, none primary: clicking fetches the files, now only to list them in the picker.
    • One Main file, not primary: installs straight away like a primary, with no files request.
    • Installed or downloaded: a mod with one Main file gets a plain button instead of the split button, as there's nothing to choose.
    • Count out of date: if the fetched list has one Main file after all, it's installed rather than opening a picker with one card.
  • Footnote: Browse's empty state now says "Mods without mod manager support or using legacy requirements aren’t included."

Tests

  • A single non-primary Main file installs without loading the mod's files.
  • A mod with one Main file keeps the plain button.
  • Existing picker tests use a main file with a count of 3.
  • Browse and Nexus integration tests, typecheck and lint pass. Not tried in the app, as production has no count to try it with.

… and none primary, installing a lone non-primary one without loading the mod's files, from the spec updated with main_file_version's count
@r1chm8 r1chm8 self-assigned this Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant