From 9dd1b7a36e583eccdb419febc5fab840c9f0f07a Mon Sep 17 00:00:00 2001 From: DaKheera47 Date: Mon, 15 Dec 2025 16:17:40 +0000 Subject: [PATCH] show filtering all the time --- .../src/client/components/JobList.tsx | 69 ++++++++++++++++++- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/orchestrator/src/client/components/JobList.tsx b/orchestrator/src/client/components/JobList.tsx index 23b1dac..34366bb 100644 --- a/orchestrator/src/client/components/JobList.tsx +++ b/orchestrator/src/client/components/JobList.tsx @@ -3,10 +3,20 @@ */ import React, { useEffect, useMemo, useState } from "react"; -import { LayoutGrid, Search, Table2 } from "lucide-react"; +import { ArrowUpDown, LayoutGrid, Search, Table2 } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Card, CardContent } from "@/components/ui/card"; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuLabel, + DropdownMenuRadioGroup, + DropdownMenuRadioItem, + DropdownMenuSeparator, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu"; import { Input } from "@/components/ui/input"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { cn } from "@/lib/utils"; @@ -28,6 +38,16 @@ type ViewMode = "cards" | "table"; const JOB_LIST_VIEW_STORAGE_KEY = "jobops.jobs.viewMode"; const DEFAULT_SORT: JobSort = { key: "discoveredAt", direction: "desc" }; +const sortLabels: Record = { + discoveredAt: "Discovered", + score: "Score", + title: "Title", + employer: "Company", + source: "Source", + location: "Location", + status: "Status", +}; + const tabs: Array<{ id: FilterTab; label: string; statuses: JobStatus[] }> = [ { id: "ready", label: "Ready", statuses: ["ready"] }, { id: "discovered", label: "Discovered", statuses: ["discovered", "processing"] }, @@ -286,7 +306,52 @@ export const JobList: React.FC = ({ /> -
+
+ + + + + + Sort by + + + setSort({ + key: value as JobSort["key"], + direction: + value === "score" || value === "discoveredAt" + ? "desc" + : "asc", + }) + } + > + {(Object.keys(sortLabels) as Array).map((key) => ( + + {sortLabels[key]} + + ))} + + + + setSort((current) => ({ + ...current, + direction: current.direction === "asc" ? "desc" : "asc", + })) + } + > + Direction: {sort.direction === "asc" ? "Ascending" : "Descending"} + + + + {activeResultsCount} jobs {hasActiveFilters && (