diff --git a/frontend/components/knowledge-filter-list.tsx b/frontend/components/knowledge-filter-list.tsx index bac0e5ca..8e62058f 100644 --- a/frontend/components/knowledge-filter-list.tsx +++ b/frontend/components/knowledge-filter-list.tsx @@ -1,8 +1,7 @@ "use client"; import { useState } from "react"; -import { Button } from "@/components/ui/button"; -import { Loader2, Plus } from "lucide-react"; +import { Plus } from "lucide-react"; import { cn } from "@/lib/utils"; import { useGetFiltersSearchQuery, @@ -65,95 +64,102 @@ export function KnowledgeFilterList({ }; return ( - <> -
-
-
- Knowledge Filters -
- -
- {loading ? ( -
- - - Loading... - -
- ) : filters.length === 0 ? ( -
- {searchQuery ? "No filters found" : "No saved filters"} -
- ) : ( - filters.map((filter) => ( -
handleFilterSelect(filter)} - className={cn( - "flex items-center gap-3 px-3 py-2 w-full rounded-lg hover:bg-accent hover:text-accent-foreground cursor-pointer group transition-colors", - selectedFilter?.id === filter.id && - "active bg-accent text-accent-foreground" - )} +
+
+
+
+

+ Knowledge Filters +

+ +
+
+ {loading ? ( +
+ Loading...
-
- )) - )} + ) : filters.length === 0 ? ( +
+ {searchQuery ? "No filters found" : "No saved filters"} +
+ ) : ( + filters.map(filter => ( +
handleFilterSelect(filter)} + className={cn( + "flex items-center gap-3 px-3 py-2 w-full rounded-lg hover:bg-accent hover:text-accent-foreground cursor-pointer group transition-colors", + selectedFilter?.id === filter.id && + "active bg-accent text-accent-foreground" + )} + > +
+
+ {(() => { + const parsed = parseQueryData( + filter.query_data + ) as ParsedQueryData; + const Icon = iconKeyToComponent(parsed.icon); + return ( +
+ {Icon && } +
+ ); + })()} +
+ {filter.name} +
+
+ {filter.description && ( +
+ {filter.description} +
+ )} +
+
+ {new Date(filter.created_at).toLocaleDateString( + undefined, + { + month: "short", + day: "numeric", + year: "numeric", + } + )} +
+ + {(() => { + const dataSources = parseQueryData(filter.query_data) + .filters.data_sources; + if (dataSources[0] === "*") return "All sources"; + const count = dataSources.length; + return `${count} ${ + count === 1 ? "source" : "sources" + }`; + })()} + +
+
+
+ )) + )} +
+
+ {/* Create flow moved to panel create mode */}
- {/* Create flow moved to panel create mode */} - +
); } diff --git a/frontend/components/navigation.tsx b/frontend/components/navigation.tsx index c215f3dc..83306f21 100644 --- a/frontend/components/navigation.tsx +++ b/frontend/components/navigation.tsx @@ -5,7 +5,6 @@ import { FileText, Library, MessageSquare, - MoreHorizontal, Plus, Settings2, Trash2, @@ -397,7 +396,7 @@ export function Navigation({ {/* Conversations List - grows naturally, doesn't fill all space */}
{loadingNewConversation || isConversationsLoading ? ( -
+
Loading...
) : ( @@ -406,7 +405,7 @@ export function Navigation({ {placeholderConversation && (