feat: Change default filter flags for basic lands, commander sets, and tokens to false on client and server.
This commit is contained in:
@@ -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).
|
||||
|
||||
@@ -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`.
|
||||
@@ -53,15 +53,15 @@ export const CubeManager: React.FC<CubeManagerProps> = ({ 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
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user