fix(precons): replace native type filter and handle catalog load failures#3602
fix(precons): replace native type filter and handle catalog load failures#3602carlh7777 wants to merge 3 commits into
Conversation
…handling - Replaced SelectField with MenuSelect for improved UI/UX in type filtering. - Updated useDecks hook to return loading and error states. - Enhanced PreconDeckModal to display loading and error messages based on the state. - Added type filter label and options using useMemo for performance optimization. - Updated translations for loading and error messages in multiple languages.
There was a problem hiding this comment.
Code Review
This pull request updates the useDecks hook to return loading and error states, replaces the SelectField with MenuSelect in PreconDeckModal, and adds corresponding loading and error UI states. The review feedback recommends refactoring the boolean flags (loading and loadError) to a single status enum ('loading' | 'success' | 'error') across the hook, components, and tests to comply with the repository's style guide rule against boolean fields (Rule R2).
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
…flags
- Updated useDecks hook to return a status string ("loading", "success", "error") for better state management.
- Modified PreconDeckModal and related tests to utilize the new status structure.
- Enhanced loading and error handling in PreconDeckModal for improved user experience.
|
This is a frontend change (precons UI: native type filter replacement + catalog load-failure handling across client/src components/hooks/i18n/pages), which the maintainer reviews directly — UI behavior + the i18n key changes need a browser check and locale-parity verification the automated review loop can't do. Flagging for maintainer review; no engine/rules concerns from my side. |
Summary
Fixes two user-facing issues in the Preconstructed Decks modal on Windows:
MenuSelectcomponent to eliminate a rendering issue where a stray "All (0)" option could appear outside the dropdown.decks.jsoncannot be loaded, preventing the UI from remaining indefinitely stuck on "Loading deck catalog...".These changes improve consistency with the rest of the application and provide clearer feedback when deck data is unavailable.
Implementation Method (Required)
How was the engine/parser logic in this PR produced? Check exactly one:
/engine-implementerpipeline (plan → review-plan → implement → review-impl → commit)/engine-implementer— explain why belowReason
This is a frontend-only UI and UX improvement.
Replaced the native
SelectFieldimplementation inPreconDeckModalwith the existing sharedMenuSelectcomponent used elsewhere in the application.Extended
useDecks()to expose explicitloadingandloadErrorstates.Updated modal rendering logic to distinguish between:
No gameplay systems, engine behavior, parser logic, rules processing, targeting, effect resolution, or networking logic were modified.
Note
Any change to
crates/engine/game logic — parser, effects, resolver, targeting, or rules behavior — is expected to go through/engine-implementer.This PR only affects frontend presentation and error handling.
CR References
None.
The change is limited to UI presentation and client-side loading state management. No game rules, deck validation logic, or engine functionality were modified.
User Impact
Before
decks.jsonfailed to load, the modal remained indefinitely in a loading state with no indication that an error had occurred.After
MenuSelectcomponent, providing consistent cross-platform behavior.Verification
Automated
pnpm exec vitest run \ src/components/menu/__tests__/MyDecks.test.tsx \ src/pages/__tests__/GameSetupPage.test.tsxResult: ✅ Pass
Manual Testing
MenuSelect.decks.jsonrequest.Screenshots
Before
After