diff --git a/docs/development/CENTRAL.md b/docs/development/CENTRAL.md index 5dc4b02..323958e 100644 --- a/docs/development/CENTRAL.md +++ b/docs/development/CENTRAL.md @@ -64,3 +64,4 @@ - [Synchronized Display Boundaries](./devlog/2025-12-17-030000_synchronized_boundaries.md): Completed. Aligned "Art Crop" and "Preview Suppression" thresholds to 200px (50% slider value) for a unified UI behavior. - [Squared Art Crops](./devlog/2025-12-17-030500_squared_art_crops.md): Completed. Enforced square aspect ratio for art-crop thumbnails to optimize visual density and stacking. - [Fix Expansion Generation Limit](./devlog/2025-12-17-024500_fix_expansion_generation_limit.md): Completed. Implemented "Unlimited Pool" mode for expansion drafts to allow generating large numbers of packs from singleton set data. +- [Change Default Filter Flags](./devlog/2025-12-17-025500_change_default_flags.md): Completed. Updated client and server defaults for "Ignore Basic Lands", "Ignore Commander Sets", and "Ignore Tokens" to be unchecked (false). diff --git a/docs/development/devlog/2025-12-17-025500_change_default_flags.md b/docs/development/devlog/2025-12-17-025500_change_default_flags.md new file mode 100644 index 0000000..ddf953e --- /dev/null +++ b/docs/development/devlog/2025-12-17-025500_change_default_flags.md @@ -0,0 +1,19 @@ + +# 2025-12-17 Change Default Filter Flags + +## Objective +Change the default state of the "Ignore Basic Lands", "Ignore Commander Sets", and "Ignore Tokens" flags from checked (true) to unchecked (false) to match user preference. + +## Changes +1. **Client-Side (`src/client/src/modules/cube/CubeManager.tsx`)**: + * Updated the initial state of the `filters` object. + * The defaults for `ignoreBasicLands`, `ignoreCommander`, and `ignoreTokens` are now `false`. + * This affects new users or sessions where `localStorage` does not have saved preferences. + +2. **Server-Side (`src/server/index.ts`)**: + * Updated the default fallback values for `filters` in the `/api/packs/generate` route. + * If no filters are provided in the request payload, the server now defaults these flags to `false`. + +## Verification +* Verified that the variable names match the UI labels. +* Verified that the logic correctly implements "unchecked" by setting the boolean values to `false`. diff --git a/src/client/src/modules/cube/CubeManager.tsx b/src/client/src/modules/cube/CubeManager.tsx index a3563ab..7a6a3fc 100644 --- a/src/client/src/modules/cube/CubeManager.tsx +++ b/src/client/src/modules/cube/CubeManager.tsx @@ -53,15 +53,15 @@ export const CubeManager: React.FC = ({ packs, setPacks, onGoT try { const saved = localStorage.getItem('cube_filters'); return saved ? JSON.parse(saved) : { - ignoreBasicLands: true, - ignoreCommander: true, - ignoreTokens: true + ignoreBasicLands: false, + ignoreCommander: false, + ignoreTokens: false }; } catch { return { - ignoreBasicLands: true, - ignoreCommander: true, - ignoreTokens: true + ignoreBasicLands: false, + ignoreCommander: false, + ignoreTokens: false }; } }); diff --git a/src/server/index.ts b/src/server/index.ts index c35eb79..62f98af 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -139,9 +139,9 @@ app.post('/api/packs/generate', async (req: Request, res: Response) => { // Default filters if missing const activeFilters = filters || { - ignoreBasicLands: true, - ignoreCommander: true, - ignoreTokens: true + ignoreBasicLands: false, + ignoreCommander: false, + ignoreTokens: false }; const { pools, sets } = packGeneratorService.processCards(poolCards, activeFilters);