From caf1dbd11a9f9e2afeaa2f6d68fa2efd8e02f60e Mon Sep 17 00:00:00 2001 From: nicktytarenko Date: Thu, 18 Jun 2026 23:13:53 +0300 Subject: [PATCH] Remove excluded_search_ids from Expert Finder --- .../library/new/components/AdvancedConfig.tsx | 32 ++++------------- .../ExcludeExpertsFromSearchesDropdown.tsx | 34 ------------------- .../new/components/ExpertFinderForm.tsx | 3 -- app/expert-finder/library/new/schema.ts | 1 - services/expertFinder.service.ts | 1 - types/expertFinder.ts | 18 ---------- 6 files changed, 7 insertions(+), 82 deletions(-) delete mode 100644 app/expert-finder/library/new/components/ExcludeExpertsFromSearchesDropdown.tsx diff --git a/app/expert-finder/library/new/components/AdvancedConfig.tsx b/app/expert-finder/library/new/components/AdvancedConfig.tsx index 3f2f54982..46f14baf1 100644 --- a/app/expert-finder/library/new/components/AdvancedConfig.tsx +++ b/app/expert-finder/library/new/components/AdvancedConfig.tsx @@ -1,6 +1,6 @@ 'use client'; -import { useState, useCallback, useEffect } from 'react'; +import { useState, useEffect } from 'react'; import type { FieldErrors, UseFormRegister } from 'react-hook-form'; import { ChevronDown, Settings } from 'lucide-react'; import { Button } from '@/components/ui/Button'; @@ -23,7 +23,6 @@ import { import { getFieldErrorMessage } from '@/utils/form'; import { cn } from '@/utils/styles'; import { SearchHistoryDropdown } from './SearchHistoryDropdown'; -import { ExcludeExpertsFromSearchesDropdown } from './ExcludeExpertsFromSearchesDropdown'; const INPUT_TYPE_OPTIONS: { value: InputType; label: string }[] = [ { value: 'full_content', label: 'Full Content' }, @@ -79,13 +78,6 @@ export function AdvancedConfig({ const regionLabel = getRegionLabel(values.region); - const handleExcludeChange = useCallback( - (excludedSearchIds: number[]) => { - onChange({ ...values, excludedSearchIds }); - }, - [onChange, values] - ); - return ( -
-
-
- -
-
- -
-
+
+
diff --git a/app/expert-finder/library/new/components/ExcludeExpertsFromSearchesDropdown.tsx b/app/expert-finder/library/new/components/ExcludeExpertsFromSearchesDropdown.tsx deleted file mode 100644 index 0a0e886ec..000000000 --- a/app/expert-finder/library/new/components/ExcludeExpertsFromSearchesDropdown.tsx +++ /dev/null @@ -1,34 +0,0 @@ -'use client'; - -import { useCallback } from 'react'; -import { UserMinus } from 'lucide-react'; -import { ExpertSearchPicker } from './ExpertSearchPicker'; - -export interface ExcludeExpertsFromSearchesDropdownProps { - value: number[]; - onExcludeChange: (excludedSearchIds: number[]) => void; -} - -export function ExcludeExpertsFromSearchesDropdown({ - value, - onExcludeChange, -}: ExcludeExpertsFromSearchesDropdownProps) { - const onChange = useCallback( - (searchIds: number[]) => { - onExcludeChange(searchIds); - }, - [onExcludeChange] - ); - - return ( - } - /> - ); -} diff --git a/app/expert-finder/library/new/components/ExpertFinderForm.tsx b/app/expert-finder/library/new/components/ExpertFinderForm.tsx index 28c79e885..62cd327ce 100644 --- a/app/expert-finder/library/new/components/ExpertFinderForm.tsx +++ b/app/expert-finder/library/new/components/ExpertFinderForm.tsx @@ -49,7 +49,6 @@ const defaultValues: ExpertFinderFormValues = { expertiseLevel: [], region: DEFAULT_REGION, state: DEFAULT_STATE, - excludedSearchIds: [], inputType: 'full_content', searchName: '', }, @@ -177,7 +176,6 @@ export function ExpertFinderForm() { expertiseLevel, region, state, - excludedSearchIds: search.excludedSearchIds ?? [], inputType, searchName: current.advanced.searchName ?? '', }, @@ -218,7 +216,6 @@ export function ExpertFinderForm() { region: adv.region, state: adv.state, }, - excluded_search_ids: adv.excludedSearchIds.length > 0 ? adv.excludedSearchIds : undefined, ...(adv.searchName?.trim() && { name: adv.searchName.trim() }), ...(trimmedAdditionalContext && { additional_context: trimmedAdditionalContext }), }; diff --git a/app/expert-finder/library/new/schema.ts b/app/expert-finder/library/new/schema.ts index 2ae1096c0..921bb4f52 100644 --- a/app/expert-finder/library/new/schema.ts +++ b/app/expert-finder/library/new/schema.ts @@ -35,7 +35,6 @@ export const advancedConfigSchema = z.object({ expertiseLevel: z.array(z.enum(EXPERTISE_LEVELS_SPECIFIC)).default([]), region: z.enum(REGION_VALUES), state: z.string(), - excludedSearchIds: z.array(z.number().int().positive()).default([]), inputType: z.enum(INPUT_TYPES as [InputType, ...InputType[]]).default('full_content'), searchName: z.string().optional().default(''), }); diff --git a/services/expertFinder.service.ts b/services/expertFinder.service.ts index 2324e9181..6c60439e7 100644 --- a/services/expertFinder.service.ts +++ b/services/expertFinder.service.ts @@ -77,7 +77,6 @@ export interface ExpertSearchCreatePayload { region: Region; state: string; }; - excluded_search_ids?: number[]; additional_context?: string; } diff --git a/types/expertFinder.ts b/types/expertFinder.ts index 0aaa6b13c..593e4a16c 100644 --- a/types/expertFinder.ts +++ b/types/expertFinder.ts @@ -54,7 +54,6 @@ export interface ExpertSearchResult { query: string; inputType: InputType; config: Record; - excludedSearchIds: number[]; llmModel: string; status: SearchStatus; progress: number; @@ -81,7 +80,6 @@ export interface ExpertSearchListItem { query: string; status: SearchStatus; expertCount: number; - excludedSearchIds: number[]; createdAt: string; completedAt: string | null; createdBy: CreatedByInfo | null; @@ -174,20 +172,6 @@ export function transformExpertResult(raw: any): ExpertResult { }; } -function transformExcludedSearchIds(raw: any): number[] { - if (!Array.isArray(raw)) return []; - const out: number[] = []; - const seen = new Set(); - for (const v of raw) { - const n = Number(v); - if (Number.isInteger(n) && n >= 1 && !seen.has(n)) { - seen.add(n); - out.push(n); - } - } - return out; -} - function pickExpertRows(raw: any): any[] { return Array.isArray(raw.experts) ? raw.experts : []; } @@ -201,7 +185,6 @@ export const transformExpertSearch = createTransformer( query: raw.query ?? '', inputType: raw.input_type ?? 'abstract', config: raw.config ?? {}, - excludedSearchIds: transformExcludedSearchIds(raw.excluded_search_ids), llmModel: raw.llm_model ?? '', status: raw.status ?? 'pending', progress: raw.progress ?? 0, @@ -229,7 +212,6 @@ export const transformExpertSearchListItem = createTransformer