diff --git a/frontend/src/components/filter/FilterBar.tsx b/frontend/src/components/filter/FilterBar.tsx index 89b3c2f..adbe736 100644 --- a/frontend/src/components/filter/FilterBar.tsx +++ b/frontend/src/components/filter/FilterBar.tsx @@ -45,6 +45,16 @@ export function FilterBar() { const sortBy = useFilterStore((s) => s.sortBy) const sortOrder = useFilterStore((s) => s.sortOrder) const tagIds = useFilterStore((s) => s.tagIds) + const currentSection = useFilterStore((s) => s.currentSection) + + // Section-locked pills: each section has a preset filter that defines + // it (Rated → ratingMin, Discarded → flag, Tags → groupBy=tag). The + // matching pill is hidden while you're inside that section because + // toggling it would either be a no-op or break the section. The user + // can still navigate away to change the locked dimension. + const hideRatingPill = currentSection === 'rated' + const hideFlagPill = currentSection === 'discarded' + const hideTagsPill = currentSection === 'tags' const setDateFrom = useFilterStore((s) => s.setDateFrom) const setDateTo = useFilterStore((s) => s.setDateTo) @@ -216,36 +226,40 @@ export function FilterBar() { - {/* Rating */} - setRatingMin(0)} - > -
-

Minimum

-
- {[1, 2, 3, 4, 5].map((n) => ( - - ))} + {/* Rating — hidden in the Rated section since the section already + * pins ratingMin and the only useful tweak (ratingMin >= N) lives + * in the section preset itself. */} + {!hideRatingPill && ( + setRatingMin(0)} + > +
+

Minimum

+
+ {[1, 2, 3, 4, 5].map((n) => ( + + ))} +
-
- + + )} {/* Color */} - {/* Flag — discarded toggle */} - setFlag('any')} - > -
- - -
-
+ {/* Flag — hidden in the Discarded section, where the flag is + * pinned to "discarded" by the section preset. */} + {!hideFlagPill && ( + setFlag('any')} + > +
+ + +
+
+ )} - {/* Tags */} - {allTags.length > 0 && ( + {/* Tags — hidden in the Tags section since the section already + * groups everything by tag and re-applying a tag filter on top + * collapses the view to a single bucket. */} + {!hideTagsPill && allTags.length > 0 && (