diff --git a/src/components/FilterBar.tsx b/src/components/FilterBar.tsx
index 73c809e..6d852d9 100644
--- a/src/components/FilterBar.tsx
+++ b/src/components/FilterBar.tsx
@@ -1,13 +1,16 @@
import { type Component, createSignal, For, Show } from "solid-js";
-import { Search, X, Hash, ArrowUpCircle, Clock } from "lucide-solid";
+import { Search, X, Hash, ArrowUpCircle, Clock, Minus } from "lucide-solid";
import { store, setFilter, clearFilter } from "@/store";
import { Button } from "./ui/button";
import { cn } from "@/lib/utils";
import { Badge } from "./ui/badge";
import { Select, SelectContent, SelectItem, SelectTrigger } from "./ui/select";
import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";
+import { useTheme } from "./ThemeProvider";
+import { getThemeAdjustedColor } from "@/lib/colors";
export const FilterBar: Component = () => {
+ const { resolvedTheme } = useTheme();
const [isOpen, setIsOpen] = createSignal(false);
const hasActiveFilters = () => {
@@ -15,7 +18,7 @@ export const FilterBar: Component = () => {
return f.query !== "" || f.tags.length > 0 || f.priorityMin !== 1 || f.priorityMax !== 10 || f.urgencyMin !== 1 || f.urgencyMax !== 10;
};
- const allTags = () => Object.keys(store.tagDefinitions || {}).sort();
+ const allTags = () => store.tagDefinitions.map(d => d.name).sort();
return (
@@ -162,27 +165,63 @@ export const FilterBar: Component = () => {
{(tag) => (
setFilter({ tags: store.filter.tags.filter(t => t !== tag) })}
+ class={cn(
+ "h-7 px-2.5 rounded-lg text-xs gap-2 transition-all border shadow-sm",
+ tag.excluded
+ ? "bg-red-500/10 text-red-600 dark:text-red-400 border-red-500/20 hover:bg-red-500/20"
+ : "bg-indigo-500/10 text-indigo-600 dark:text-indigo-300 border-indigo-500/20 hover:bg-indigo-500/20"
+ )}
+ style={!tag.excluded ? (() => {
+ const def = store.tagDefinitions.find(d => d.name === tag.name);
+ const color = getThemeAdjustedColor(def?.color, def?.theme, resolvedTheme());
+ return color ? {
+ "background-color": `${color}15`,
+ "color": color,
+ "border-color": `${color}30`
+ } : {};
+ })() : {}}
>
-
- {tag}
-
+ {
+ const newTags = store.filter.tags.map(t =>
+ t.name === tag.name ? { ...t, excluded: !t.excluded } : t
+ );
+ setFilter({ tags: newTags });
+ }}
+ >
+ }>
+
+
+ {tag.name}
+
+
)}