Skip to content

Modrinth search: filter by server type so mods and plugins do not mix (#47 pt 1) - #61

Merged
CaYatur merged 1 commit into
mainfrom
feat/modrinth-search-by-type
Jul 24, 2026
Merged

Modrinth search: filter by server type so mods and plugins do not mix (#47 pt 1)#61
CaYatur merged 1 commit into
mainfrom
feat/modrinth-search-by-type

Conversation

@CaYatur

@CaYatur CaYatur commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Part of #47 (does not close it — the detail view + compatibility line follow in a second PR). First of the UX & access pass's Modrinth work.

Why

The browse search filtered by a single Modrinth loader (MR_LOADER[type]), so a Paper server missed plugins tagged only spigot/bukkit, and nothing kept the result set to the kind of add-on the server can actually run.

Changes

  • New pure searchLoaders(type) in core/mods.ts:
    • plugin servers → the whole Bukkit family (paper/purpur/folia/spigot/bukkit);
    • modded / proxy → the single loader;
    • hybrid (mohist/arclight) → the plugin family unioned with its mod loaders (forge), so both plugins and mods show — the issue's explicit hybrid case, which loadersFor() alone does not satisfy (mohist is in both families, so it resolves to paper-only there).
  • searchModrinth now filters by searchLoaders() as an OR facet. Because the loader taxonomies are disjoint (nothing is tagged both paper and fabric), this is exactly what stops a Fabric server from listing plugins and vice-versa — item Epic: Stage 15 — Audit trail completion #1 of the issue.
  • Deliberately not filtering by project_type: verified against the live Modrinth API that plugins are indexed as project_type: "mod", so a project_type:plugin facet would return zero plugins for every Paper server — a regression. The loader facet is the correct separator (documented in a code comment so it isn't "fixed" later).

Verify

  • typecheck, build — pass.
  • MSMS_SMOKE_MODUPDATE PASS, new unit: searchLoaders gives the plugin family for plugin servers, a single loader for modded/proxy, the union for a hybrid (mohist → paper/spigot/bukkit/forge), and nothing for vanilla.
  • The facet OR shape and the project_type finding were checked against a live api.modrinth.com/v2/search response (the live search itself stays inspection-only).

Next (PR2, closes #47)

A detail view on opening a result — description, author, downloads, license, links — and a compatibility line: whether a version exists for this server's MC version + loaders, reusing the update-checker's matching. That part depends on Modrinth version-endpoint shape, hence the split.

Modrinth search: filter by the server type so mods and plugins do not mix (#47 pt 1)

The browse search filtered by a single Modrinth loader (MR_LOADER[type]),
so a Paper server missed plugins tagged only spigot/bukkit, and nothing
kept the result set to the right kind for the server.

- New pure searchLoaders(type) in core/mods.ts: plugin servers get the whole
  Bukkit family (paper/purpur/folia/spigot/bukkit), modded/proxy stay single,
  and a HYBRID (mohist/arclight) unions the plugin family with its mod loaders
  (forge) so both plugins and mods show — the issues explicit hybrid case,
  which loadersFor() alone does NOT satisfy (mohist is in both families, so it
  resolves to paper-only there).
- searchModrinth now filters by searchLoaders() as an OR facet. Because the
  loader taxonomies are disjoint (nothing is tagged both `paper` and `fabric`),
  this is what stops a Fabric server from listing plugins and vice-versa.
- Deliberately NOT filtering by project_type: verified against the live
  Modrinth API that plugins are indexed as project_type "mod", so a
  project_type:plugin facet would return zero plugins — a regression. The
  loader facet is the correct separator.
- MSMS_SMOKE_MODUPDATE: pure unit for searchLoaders (plugin family, modded
  single, hybrid unions both, vanilla unfiltered).

Part of #47; the detail view + compatibility line follow in a second PR.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@
Copilot AI review requested due to automatic review settings July 24, 2026 16:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@CaYatur
CaYatur merged commit fd3ade7 into main Jul 24, 2026
1 check passed
@CaYatur
CaYatur deleted the feat/modrinth-search-by-type branch July 24, 2026 16:27
CaYatur added a commit that referenced this pull request Jul 27, 2026
* Modrinth: project detail + per-server compatibility line

Part 2 of the richer Modrinth tab. Part 1 (PR #61) filtered browse results by
server type; this adds the detail view and, with it, the compatibility verdict.

- shared/mods.ts: pure pickCompatibleVersion(versions, {mcVersion, loaders}).
  Same doctrine as diffUpdates - a version_number is arbitrary text and is never
  compared as if it sorted. Recency comes from date_published, and a stable
  release outranks a newer beta/alpha. Also folderForLoaders(), and PLUGIN_LOADERS
  moved here so the update check and the folder decision cannot drift apart.
- core/mods.ts modrinthDetail(): project + versions + members in one call each,
  versions fetched UNFILTERED so the UI can tell "nothing for your Minecraft
  version" apart from "nothing for your loader". Compatibility is computed
  against searchLoaders(type) - the same set browse was filtered by - so a listed
  result can never claim a compatibility the install then refuses.
- installModrinth(): now picks via the same pure function, accepts an optional
  versionId that is validated against the project's own version list, and takes
  the target folder from the chosen version's loaders instead of the server type.
  A hybrid (mohist/arclight) runs Bukkit plugins AND Forge mods, so type alone
  dropped every plugin into mods/.
- ModsView: expandable detail per result - compatibility line, author, downloads,
  followers, license, categories, description, external links. Late replies are
  discarded if the card was collapsed meanwhile; switching servers clears results
  and detail (they carry the old server's loader verdict).
- en/tr keys in lockstep (42/42).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Review fixes: stale-detail race and an overclaimed MC compatibility line

Two problems found reviewing the branch.

1. toggleDetail ran setDetail/setDetailState inside a setOpenId updater. State
   updaters must be pure - React double-invokes them in StrictMode - and the
   projectId it compared could not tell a re-opened card's new request from its
   own stale one. Replaced with a monotonic request sequence in a ref; close and
   server-switch both bump it, so any in-flight reply is dropped.

2. pickCompatibleVersion is deliberately lenient about a version that declares
   no game_versions, but the UI rendered that as a definite 'X supports MC Y'.
   The line now only names the MC version when the build actually lists it, and
   falls back to the softer 'latest matching version' wording otherwise.

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.

Modrinth tab: richer detail, compatible versions, mods-vs-plugins by server type

2 participants