Add admin-editable alternative search terms per mod, searchable on /admin/ranked-mods - #52
Open
12problems wants to merge 1 commit into
Open
Add admin-editable alternative search terms per mod, searchable on /admin/ranked-mods#5212problems wants to merge 1 commit into
12problems wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-modsat all.Changes
mod_registrygets a newsearch_terms text[]column (migration0036_mod_search_terms.sql), same shape as the existingcategoriescolumn but with no upstream-index counterpart at all: unlikecategories/title/author/etc (SYNCABLE_MOD_FIELDS), this is never touched by the hourly upstream sync and never participates inoverriddenFields- there's no upstream value for it to ever protect.updateModFields()writes it directly instead of through thetouch()/overriddenFieldspath the ten real syncable fields use.PATCH /webadmin/mods/:modId, and at creation viaPOST /webadmin/mods/PUT .../custom) - a comma-separated "Alternative search terms" input right below Categories in the mod dialog./admin/ranked-modsnow has an actual search box (there wasn't one at all before) that filters the already-loaded catalog client-side by name, id, or anysearchTermsentry, 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 --noEmiton bothapps/serverandapps/webshows no errors introduced by this change (every remaining error is a pre-existing missing-module gap in this checkout, e.g.@bmp/types/sanitize-htmlnot installed, unrelated to any file this touches).biome checkflagged only pre-existing formatting/line-ending debt already present on these files before this change (confirmed viagit stashcomparison), nothing new.pnpm migrate) before this deploys.Follow-up
This only covers the admin website. The launcher (BET) doesn't yet consume
searchTermsfor its own in-app mod search - separate PR if wanted.🤖 Generated with Claude Code