Warn administrators about duplicate games during creation #363

Open
opened 2026-06-04 17:48:30 -05:00 by Codex · 1 comment
Member

Admins can currently fill out the full /admin/games/create form before learning that a submitted game may already exist. That wastes staff time and makes duplicate records more likely, especially now that the admin create flow supports both manual creation and IGDB-assisted prefill.

This issue tracks adding early duplicate detection once an admin enters a game name and selects a platform, so possible matches are surfaced before the rest of the form is completed.

Scope

  • Add duplicate detection near the top of the admin game creation process.
  • Start checking once both name and platform_id are present.
  • Apply the early warning to manual creation and IGDB-prefilled creation.
  • Compare at least normalized submitted name + selected platform against existing games.
  • Consider alternate-title matches as a warning signal, especially when the submitted name matches an existing game's alt_titles.
  • Show matching existing games with enough context for staff to inspect them, preferably linking to the admin edit page.
  • Keep final-submit duplicate validation as a backstop in case JavaScript is disabled, stale, or bypassed.
  • Do not change edit, clone, merge, disable, or restore behavior unless needed to avoid false positives.

Acceptance Criteria

  • After an admin enters a game name and selects a platform, the create form checks for possible duplicate games without requiring the full form to be submitted.
  • If a likely duplicate exists, the form shows a clear warning near the name/platform fields.
  • Duplicate warnings include the existing game name, platform, and admin edit link.
  • Admins can discover possible duplicates before filling in box art, description, genres, release dates, and other metadata.
  • Submitting a duplicate active game name/platform is still blocked server-side.
  • Genuinely distinct games with the same title on different platforms can still be created.
  • Soft-deleted games are handled intentionally: either shown as disabled matches or documented as excluded from blocking.
  • Existing successful create behavior continues working for non-duplicate submissions.

Test Coverage Required

  • Feature test for a duplicate-check endpoint or action returning matches for name + platform.
  • Feature test confirming no matches are returned for the same title on a different platform.
  • Feature test that posting a duplicate active game name/platform to admin.games.store is rejected and does not create a second row.
  • Feature test that a normal non-duplicate admin create still saves the game and redirects to the edit page.
  • If alternate titles are included, add coverage for submitted name matching an existing game's alt_titles.
  • Browser/DOM-oriented coverage if the project has an established pattern for JavaScript-enhanced admin forms; otherwise cover the server contract and Blade-rendered warning hook.
  • Run the focused admin game creation tests, then run vendor/bin/pint --dirty before closing the issue.

Progress Checklist

  • Admin create route exists
  • Manual and IGDB-assisted flows share the final create save path
  • Create form collects name and platform before the expensive metadata fields
  • Add early duplicate-check route/action or equivalent form interaction
  • Add UI warning near the name/platform fields
  • Link possible matches to existing admin game records
  • Add server-side duplicate blocking at final submit
  • Decide exact matching rules for normalized names, platforms, soft-deleted games, and alternate titles
  • Preserve valid new-game creation behavior
  • Add focused Pest feature coverage
  • Run affected tests and Pint
Admins can currently fill out the full `/admin/games/create` form before learning that a submitted game may already exist. That wastes staff time and makes duplicate records more likely, especially now that the admin create flow supports both manual creation and IGDB-assisted prefill. This issue tracks adding early duplicate detection once an admin enters a game name and selects a platform, so possible matches are surfaced before the rest of the form is completed. ## Scope - Add duplicate detection near the top of the admin game creation process. - Start checking once both `name` and `platform_id` are present. - Apply the early warning to manual creation and IGDB-prefilled creation. - Compare at least normalized submitted name + selected platform against existing games. - Consider alternate-title matches as a warning signal, especially when the submitted name matches an existing game's `alt_titles`. - Show matching existing games with enough context for staff to inspect them, preferably linking to the admin edit page. - Keep final-submit duplicate validation as a backstop in case JavaScript is disabled, stale, or bypassed. - Do not change edit, clone, merge, disable, or restore behavior unless needed to avoid false positives. ## Acceptance Criteria - After an admin enters a game name and selects a platform, the create form checks for possible duplicate games without requiring the full form to be submitted. - If a likely duplicate exists, the form shows a clear warning near the name/platform fields. - Duplicate warnings include the existing game name, platform, and admin edit link. - Admins can discover possible duplicates before filling in box art, description, genres, release dates, and other metadata. - Submitting a duplicate active game name/platform is still blocked server-side. - Genuinely distinct games with the same title on different platforms can still be created. - Soft-deleted games are handled intentionally: either shown as disabled matches or documented as excluded from blocking. - Existing successful create behavior continues working for non-duplicate submissions. ## Test Coverage Required - Feature test for a duplicate-check endpoint or action returning matches for name + platform. - Feature test confirming no matches are returned for the same title on a different platform. - Feature test that posting a duplicate active game name/platform to `admin.games.store` is rejected and does not create a second row. - Feature test that a normal non-duplicate admin create still saves the game and redirects to the edit page. - If alternate titles are included, add coverage for submitted name matching an existing game's `alt_titles`. - Browser/DOM-oriented coverage if the project has an established pattern for JavaScript-enhanced admin forms; otherwise cover the server contract and Blade-rendered warning hook. - Run the focused admin game creation tests, then run `vendor/bin/pint --dirty` before closing the issue. ## Progress Checklist - [x] Admin create route exists - [x] Manual and IGDB-assisted flows share the final create save path - [x] Create form collects name and platform before the expensive metadata fields - [ ] Add early duplicate-check route/action or equivalent form interaction - [ ] Add UI warning near the name/platform fields - [ ] Link possible matches to existing admin game records - [ ] Add server-side duplicate blocking at final submit - [ ] Decide exact matching rules for normalized names, platforms, soft-deleted games, and alternate titles - [ ] Preserve valid new-game creation behavior - [ ] Add focused Pest feature coverage - [ ] Run affected tests and Pint
Member

I'm going to weigh in on this, there are certain releases where there are two versions due to different versions released for a platform. Especially WIi Ware, Nintendo Switch Online & the nintendo digital library in general. There might be one version of a game released as part of an arcade collection or port while NSO gets SNES/NES version. and there exists entries like this already, what would happen to those?

"Add server-side duplicate blocking at final submit" Would make these entries impossible for what we do on the website. However the warning is good, I like that, just the blocking isn't.

I'm going to weigh in on this, there are certain releases where there are two versions due to different versions released for a platform. Especially WIi Ware, Nintendo Switch Online & the nintendo digital library in general. There might be one version of a game released as part of an arcade collection or port while NSO gets SNES/NES version. and there exists entries like this already, what would happen to those? "Add server-side duplicate blocking at final submit" Would make these entries impossible for what we do on the website. However the warning is good, I like that, just the blocking isn't.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MyVideoGameList/myvideogamelist.com#363
No description provided.