refactor(filter): extract preset management logic into FilterPresetManager

Move filter preset creation, deletion, application, and storage logic
from FilterManager into a dedicated FilterPresetManager class to
improve separation of concerns and maintainability.

- Add FilterPresetManager with preset CRUD operations
- Update FilterManager to use preset manager via composition
- Handle EMPTY_WILDCARD_MARKER for wildcard base model filters
- Add preset-related translations to all locale files
- Update filter preset UI styling and interactions
This commit is contained in:
Will Miao
2026-01-29 16:25:45 +08:00
parent e50b2c802e
commit 08267cdb48
16 changed files with 1383 additions and 247 deletions

View File

@@ -103,6 +103,19 @@ export async function fetchRecipesPage(page = 1, pageSize = 100) {
// Add base model filters
if (pageState.filters?.baseModel && pageState.filters.baseModel.length) {
// Check for empty wildcard marker - if present, no models should match
const EMPTY_WILDCARD_MARKER = '__EMPTY_WILDCARD_RESULT__';
if (pageState.filters.baseModel.length === 1 &&
pageState.filters.baseModel[0] === EMPTY_WILDCARD_MARKER) {
// Wildcard resolved to no matches - return empty results
return {
items: [],
totalItems: 0,
totalPages: 0,
currentPage: page,
hasMore: false
};
}
params.append('base_models', pageState.filters.baseModel.join(','));
}