feat(filters): make the topic Any/All match toggle prominent
The AND/OR ("Any"/"All") control for topic chips was a single faint corner link
that was easy to miss. Replace it with a labelled segmented control ("Match:
[Any][All]") so the AND option is discoverable. New trilingual 'match' label.
This commit is contained in:
parent
c44721ed98
commit
2866baa3e8
4 changed files with 29 additions and 9 deletions
|
|
@ -412,16 +412,33 @@ export default function Sidebar({
|
||||||
const chips = visibleChips(topics);
|
const chips = visibleChips(topics);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="flex justify-end mb-1.5">
|
<div
|
||||||
<button
|
className="flex items-center justify-between mb-1.5"
|
||||||
onClick={() =>
|
title={t("sidebar.tagModeTooltip")}
|
||||||
setFilters({ ...filters, tagMode: filters.tagMode === "or" ? "and" : "or" })
|
>
|
||||||
}
|
<span className="text-[10px] uppercase tracking-wide text-muted">
|
||||||
className="text-[10px] uppercase tracking-wide text-muted hover:text-accent"
|
{t("sidebar.match")}
|
||||||
title={t("sidebar.tagModeTooltip")}
|
</span>
|
||||||
|
<div
|
||||||
|
className="flex items-center rounded-full border border-border bg-card p-0.5 text-[10px]"
|
||||||
|
role="group"
|
||||||
|
aria-label={t("sidebar.match")}
|
||||||
>
|
>
|
||||||
{filters.tagMode === "or" ? t("sidebar.any") : t("sidebar.all")}
|
{(["or", "and"] as const).map((m) => (
|
||||||
</button>
|
<button
|
||||||
|
key={m}
|
||||||
|
onClick={() => setFilters({ ...filters, tagMode: m })}
|
||||||
|
aria-pressed={filters.tagMode === m}
|
||||||
|
className={`px-2 py-0.5 rounded-full transition ${
|
||||||
|
filters.tagMode === m
|
||||||
|
? "bg-accent text-accent-fg"
|
||||||
|
: "text-muted hover:text-fg"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{m === "or" ? t("sidebar.any") : t("sidebar.all")}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-wrap gap-1.5">
|
<div className="flex flex-wrap gap-1.5">
|
||||||
{chips.map((tg) => (
|
{chips.map((tg) => (
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
"any": "Beliebig",
|
"any": "Beliebig",
|
||||||
"all": "Alle",
|
"all": "Alle",
|
||||||
"tagModeTooltip": "Beliebige vs. alle ausgewählten Tags treffen",
|
"tagModeTooltip": "Beliebige vs. alle ausgewählten Tags treffen",
|
||||||
|
"match": "Treffer",
|
||||||
"custom": "Benutzerdefiniert",
|
"custom": "Benutzerdefiniert",
|
||||||
"from": "Von",
|
"from": "Von",
|
||||||
"to": "Bis",
|
"to": "Bis",
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
"any": "Any",
|
"any": "Any",
|
||||||
"all": "All",
|
"all": "All",
|
||||||
"tagModeTooltip": "Match any vs all selected tags",
|
"tagModeTooltip": "Match any vs all selected tags",
|
||||||
|
"match": "Match",
|
||||||
"custom": "Custom",
|
"custom": "Custom",
|
||||||
"from": "From",
|
"from": "From",
|
||||||
"to": "To",
|
"to": "To",
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
"any": "Bármelyik",
|
"any": "Bármelyik",
|
||||||
"all": "Összes",
|
"all": "Összes",
|
||||||
"tagModeTooltip": "Bármelyik vagy az összes kijelölt címke illeszkedjen",
|
"tagModeTooltip": "Bármelyik vagy az összes kijelölt címke illeszkedjen",
|
||||||
|
"match": "Egyezés",
|
||||||
"custom": "Egyéni",
|
"custom": "Egyéni",
|
||||||
"from": "Ettől",
|
"from": "Ettől",
|
||||||
"to": "Eddig",
|
"to": "Eddig",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue