-
({
value: bucket.key,
@@ -322,13 +336,12 @@ export function KnowledgeFilterPanel() {
onValueChange={(values) =>
handleFilterChange("data_sources", values)
}
- placeholder="Select data sources..."
- allOptionLabel="All Data Sources"
+ placeholder="Select sources..."
+ allOptionLabel="All sources"
/>
-
({
@@ -341,13 +354,12 @@ export function KnowledgeFilterPanel() {
onValueChange={(values) =>
handleFilterChange("document_types", values)
}
- placeholder="Select document types..."
- allOptionLabel="All Document Types"
+ placeholder="Select types..."
+ allOptionLabel="All types"
/>
-
({
value: bucket.key,
@@ -362,7 +374,6 @@ export function KnowledgeFilterPanel() {
-
({
@@ -375,33 +386,13 @@ export function KnowledgeFilterPanel() {
onValueChange={(values) =>
handleFilterChange("connector_types", values)
}
- placeholder="Select sources..."
- allOptionLabel="All Sources"
+ placeholder="Select connectors..."
+ allOptionLabel="All connectors"
/>
- {/* All/None buttons */}
-
-
-
-
-
{/* Result Limit Control - exactly like search page */}
-
+
-
- {/* Save Configuration Button */}
-
-
- {!createMode && (
-
- )}
-
+
+ {/* Save Configuration Button */}
+ {createMode && (
+
+ )}
+ {!createMode && (
+
+ )}
+
+
);
diff --git a/frontend/components/ui/button.tsx b/frontend/components/ui/button.tsx
index 689673cb..381ce3f7 100644
--- a/frontend/components/ui/button.tsx
+++ b/frontend/components/ui/button.tsx
@@ -14,7 +14,7 @@ const buttonVariants = cva(
"border border-input hover:bg-muted hover:text-accent-foreground disabled:bg-muted disabled:!border-none",
primary:
"border bg-background text-secondary-foreground hover:bg-muted hover:shadow-sm",
- warning: "bg-warning text-secondary hover:bg-warning/90",
+ warning: "bg-warning text-warning-foreground hover:bg-warning/90",
secondary:
"border border-muted bg-muted text-secondary-foreground hover:bg-secondary-foreground/5",
ghost:
diff --git a/frontend/components/ui/multi-select.tsx b/frontend/components/ui/multi-select.tsx
index ce45fd27..a70bdaa5 100644
--- a/frontend/components/ui/multi-select.tsx
+++ b/frontend/components/ui/multi-select.tsx
@@ -1,39 +1,39 @@
-"use client"
+"use client";
-import * as React from "react"
-import { ChevronDown, Check } from "lucide-react"
-import { cn } from "@/lib/utils"
-import { Button } from "@/components/ui/button"
+import * as React from "react";
+import { ChevronDown, Check } from "lucide-react";
+import { cn } from "@/lib/utils";
+import { Button } from "@/components/ui/button";
import {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
-} from "@/components/ui/command"
+} from "@/components/ui/command";
import {
Popover,
PopoverContent,
PopoverTrigger,
-} from "@/components/ui/popover"
-import { ScrollArea } from "@/components/ui/scroll-area"
+} from "@/components/ui/popover";
+import { ScrollArea } from "@/components/ui/scroll-area";
interface Option {
- value: string
- label: string
- count?: number
+ value: string;
+ label: string;
+ count?: number;
}
interface MultiSelectProps {
- options: Option[]
- value: string[]
- onValueChange: (value: string[]) => void
- placeholder?: string
- className?: string
- maxSelection?: number
- searchPlaceholder?: string
- showAllOption?: boolean
- allOptionLabel?: string
+ options: Option[];
+ value: string[];
+ onValueChange: (value: string[]) => void;
+ placeholder?: string;
+ className?: string;
+ maxSelection?: number;
+ searchPlaceholder?: string;
+ showAllOption?: boolean;
+ allOptionLabel?: string;
}
export function MultiSelect({
@@ -43,60 +43,61 @@ export function MultiSelect({
placeholder = "Select items...",
className,
maxSelection,
- searchPlaceholder = "Search...",
+ searchPlaceholder = "Search options...",
showAllOption = true,
- allOptionLabel = "All"
+ allOptionLabel = "All",
}: MultiSelectProps) {
- const [open, setOpen] = React.useState(false)
- const [searchValue, setSearchValue] = React.useState("")
+ const [open, setOpen] = React.useState(false);
+ const [searchValue, setSearchValue] = React.useState("");
- const isAllSelected = value.includes("*")
-
- const filteredOptions = options.filter(option =>
+ const isAllSelected = value.includes("*");
+
+ const filteredOptions = options.filter((option) =>
option.label.toLowerCase().includes(searchValue.toLowerCase())
- )
+ );
const handleSelect = (optionValue: string) => {
if (optionValue === "*") {
// Toggle "All" selection
if (isAllSelected) {
- onValueChange([])
+ onValueChange([]);
} else {
- onValueChange(["*"])
+ onValueChange(["*"]);
}
} else {
- let newValue: string[]
+ let newValue: string[];
if (value.includes(optionValue)) {
// Remove the item
- newValue = value.filter(v => v !== optionValue && v !== "*")
+ newValue = value.filter((v) => v !== optionValue && v !== "*");
} else {
// Add the item and remove "All" if present
- newValue = [...value.filter(v => v !== "*"), optionValue]
-
+ newValue = [...value.filter((v) => v !== "*"), optionValue];
+
// Check max selection limit
if (maxSelection && newValue.length > maxSelection) {
- return
+ return;
}
}
- onValueChange(newValue)
+ onValueChange(newValue);
}
- }
+ };
const getDisplayText = () => {
if (isAllSelected) {
- return allOptionLabel
+ return allOptionLabel;
}
-
+
if (value.length === 0) {
- return placeholder
+ return placeholder;
}
-
+
// Extract the noun from placeholder (e.g., "Select data sources..." -> "data sources")
- const noun = placeholder.toLowerCase().replace('select ', '').replace('...', '')
- return `${value.length} ${noun}`
- }
-
-
+ const noun = placeholder
+ .toLowerCase()
+ .replace("select ", "")
+ .replace("...", "");
+ return `${value.length} ${noun}`;
+ };
return (
@@ -106,17 +107,15 @@ export function MultiSelect({
role="combobox"
aria-expanded={open}
className={cn(
- "w-full justify-between min-h-[40px] h-auto text-left",
+ "w-full justify-between h-8 py-0 text-left",
className
)}
>
-
- {getDisplayText()}
-
+ {getDisplayText()}
-
+
handleSelect("*")}
className="cursor-pointer"
>
+ {allOptionLabel}
- {allOptionLabel}
-
- *
-
)}
{filteredOptions.map((option) => (
@@ -149,20 +145,19 @@ export function MultiSelect({
key={option.value}
onSelect={() => handleSelect(option.value)}
className="cursor-pointer"
- disabled={isAllSelected}
>
-
{option.label}
{option.count !== undefined && (
{option.count}
)}
+
))}
@@ -170,5 +165,5 @@ export function MultiSelect({
- )
-}
\ No newline at end of file
+ );
+}
diff --git a/frontend/components/ui/slider.tsx b/frontend/components/ui/slider.tsx
index 0ca945b1..bd2d8d80 100644
--- a/frontend/components/ui/slider.tsx
+++ b/frontend/components/ui/slider.tsx
@@ -17,10 +17,10 @@ const Slider = React.forwardRef<
)}
{...props}
>
-
-
+
+
-
+
))
Slider.displayName = SliderPrimitive.Root.displayName
diff --git a/frontend/components/ui/textarea.tsx b/frontend/components/ui/textarea.tsx
index e381511e..81833a45 100644
--- a/frontend/components/ui/textarea.tsx
+++ b/frontend/components/ui/textarea.tsx
@@ -7,7 +7,7 @@ function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {