feat(filter): add tag logic toggle (OR/AND) for include tags filtering

Add a segmented toggle in the Filter Panel to switch between 'Any' (OR)
and 'All' (AND) logic when filtering by multiple include tags.

Changes:
- Backend: Add tag_logic field to FilterCriteria and ModelFilterSet
- Backend: Parse tag_logic parameter in model handlers
- Frontend: Add segmented toggle UI in filter panel header
- Frontend: Add interaction logic and state management for tag logic
- Add translations for all supported languages
- Add comprehensive tests for the new feature

Closes #802
This commit is contained in:
Will Miao
2026-02-05 22:35:18 +08:00
parent 895d13dc96
commit fa3625ff72
20 changed files with 927 additions and 15 deletions

View File

@@ -673,6 +673,57 @@
/* Tag Logic Toggle Styles */
.filter-section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
}
.filter-section-header h4 {
margin: 0;
}
.tag-logic-toggle {
display: flex;
background-color: var(--lora-surface);
border: 1px solid var(--border-color);
border-radius: var(--border-radius-sm);
overflow: hidden;
}
.tag-logic-option {
background: none;
border: none;
padding: 2px 8px;
font-size: 11px;
cursor: pointer;
color: var(--text-color);
opacity: 0.7;
transition: all 0.2s ease;
font-weight: 500;
}
.tag-logic-option:hover {
opacity: 1;
background-color: var(--lora-surface-hover);
}
.tag-logic-option.active {
background-color: var(--lora-accent);
color: white;
opacity: 1;
}
.tag-logic-option:first-child {
border-right: 1px solid var(--border-color);
}
.tag-logic-option.active:first-child {
border-right: 1px solid rgba(255, 255, 255, 0.3);
}
/* Mobile adjustments */
@media (max-width: 768px) {
.search-options-panel,