Skip to content

Add admin-editable alternative search terms per mod, searchable on /admin/ranked-mods - #52

Open
12problems wants to merge 1 commit into
mqttfrom
feat/mod-alternative-search-terms
Open

Add admin-editable alternative search terms per mod, searchable on /admin/ranked-mods#52
12problems wants to merge 1 commit into
mqttfrom
feat/mod-alternative-search-terms

Conversation

@12problems

Copy link
Copy Markdown

Problem

Admins managing the ranked mod catalog had no way to find a mod by anything other than its real title/id - e.g. "What's in my Fool" is commonly called "wimf" by players, but there was no way to associate that alias with the mod, and no search box on /admin/ranked-mods at all.

Changes

  • mod_registry gets a new search_terms text[] column (migration 0036_mod_search_terms.sql), same shape as the existing categories column but with no upstream-index counterpart at all: unlike categories/title/author/etc (SYNCABLE_MOD_FIELDS), this is never touched by the hourly upstream sync and never participates in overriddenFields - there's no upstream value for it to ever protect. updateModFields() writes it directly instead of through the touch()/overriddenFields path the ten real syncable fields use.
  • Editable via the same admin field-edit form as categories (PATCH /webadmin/mods/:modId, and at creation via POST /webadmin/mods / PUT .../custom) - a comma-separated "Alternative search terms" input right below Categories in the mod dialog.
  • /admin/ranked-mods now has an actual search box (there wasn't one at all before) that filters the already-loaded catalog client-side by name, id, or any searchTerms entry, case-insensitive substring on each - the catalog is small enough this needs no server round trip per keystroke. The table's empty-state message now distinguishes "no mods synced yet" from "no mods match this search".

Verification

  • tsc --noEmit on both apps/server and apps/web shows no errors introduced by this change (every remaining error is a pre-existing missing-module gap in this checkout, e.g. @bmp/types/sanitize-html not installed, unrelated to any file this touches).
  • biome check flagged only pre-existing formatting/line-ending debt already present on these files before this change (confirmed via git stash comparison), nothing new.
  • Not yet run against a live database - the migration needs to be applied (pnpm migrate) before this deploys.

Follow-up

This only covers the admin website. The launcher (BET) doesn't yet consume searchTerms for its own in-app mod search - separate PR if wanted.

🤖 Generated with Claude Code

…dmin/ranked-mods

Admins managing the ranked mod catalog had no way to find a mod by
anything other than its real title/id - e.g. "What's in my Fool" is
commonly called "wimf" by players, but typing that into a (previously
nonexistent) search box would have found nothing.

- mod_registry gets a new search_terms text[] column (migration
  0036_mod_search_terms.sql), same shape as the existing categories
  column but with no upstream-index counterpart at all: unlike
  categories/title/author/etc (SYNCABLE_MOD_FIELDS), this is never
  touched by the hourly upstream sync and never participates in
  overriddenFields - there's no upstream value for it to ever protect.
  updateModFields() writes it directly instead of through the
  touch()/overriddenFields path the ten real syncable fields use.
- Editable via the same admin field-edit form as categories (PATCH
  /webadmin/mods/:modId, and at creation via POST /webadmin/mods /
  PUT .../custom) - a comma-separated "Alternative search terms" input
  right below Categories in the mod dialog.
- /admin/ranked-mods now has an actual search box (there wasn't one at
  all before) that filters the already-loaded catalog client-side by
  name, id, or any searchTerms entry, case-insensitive substring on
  each - the catalog is small enough this needs no server round trip
  per keystroke. The table's empty-state message now distinguishes "no
  mods synced yet" from "no mods match this search".

Verified: tsc --noEmit on both apps/server and apps/web shows no errors
introduced by this change (every remaining error is a pre-existing
missing-module gap in this checkout, e.g. @bmp/types/sanitize-html not
installed, unrelated to any file this touches). biome check flagged
only pre-existing formatting/line-ending debt already present on these
files before this change (confirmed via git stash comparison), nothing
new.

Not yet run against a live database - the migration should be applied
(pnpm migrate) before this deploys.
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