Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 7 additions & 25 deletions app/expert-finder/library/new/components/AdvancedConfig.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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' },
Expand Down Expand Up @@ -79,13 +78,6 @@ export function AdvancedConfig({

const regionLabel = getRegionLabel(values.region);

const handleExcludeChange = useCallback(
(excludedSearchIds: number[]) => {
onChange({ ...values, excludedSearchIds });
},
[onChange, values]
);

return (
<CollapsibleSection
title="Advanced Configuration"
Expand Down Expand Up @@ -294,22 +286,12 @@ export function AdvancedConfig({
</Dropdown>
</div>

<div className="min-w-0 md:!col-span-2 border-t border-gray-200 pt-4 mt-2 space-y-4">
<div className="grid grid-cols-1 md:!grid-cols-2 gap-4">
<div className="min-w-0">
<SearchHistoryDropdown
selectedSearchId={selectedSearchId}
onSearchSelect={onRerunSelect}
onLoadingChange={setIsLoadingRerun}
/>
</div>
<div className="min-w-0">
<ExcludeExpertsFromSearchesDropdown
value={values.excludedSearchIds}
onExcludeChange={handleExcludeChange}
/>
</div>
</div>
<div className="min-w-0 md:!col-span-2 border-t border-gray-200 pt-4 mt-2">
<SearchHistoryDropdown
selectedSearchId={selectedSearchId}
onSearchSelect={onRerunSelect}
onLoadingChange={setIsLoadingRerun}
/>
</div>
</div>
</div>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ const defaultValues: ExpertFinderFormValues = {
expertiseLevel: [],
region: DEFAULT_REGION,
state: DEFAULT_STATE,
excludedSearchIds: [],
inputType: 'full_content',
searchName: '',
},
Expand Down Expand Up @@ -177,7 +176,6 @@ export function ExpertFinderForm() {
expertiseLevel,
region,
state,
excludedSearchIds: search.excludedSearchIds ?? [],
inputType,
searchName: current.advanced.searchName ?? '',
},
Expand Down Expand Up @@ -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 }),
};
Expand Down
1 change: 0 additions & 1 deletion app/expert-finder/library/new/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(''),
});
Expand Down
1 change: 0 additions & 1 deletion services/expertFinder.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ export interface ExpertSearchCreatePayload {
region: Region;
state: string;
};
excluded_search_ids?: number[];
additional_context?: string;
}

Expand Down
18 changes: 0 additions & 18 deletions types/expertFinder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export interface ExpertSearchResult {
query: string;
inputType: InputType;
config: Record<string, unknown>;
excludedSearchIds: number[];
llmModel: string;
status: SearchStatus;
progress: number;
Expand All @@ -81,7 +80,6 @@ export interface ExpertSearchListItem {
query: string;
status: SearchStatus;
expertCount: number;
excludedSearchIds: number[];
createdAt: string;
completedAt: string | null;
createdBy: CreatedByInfo | null;
Expand Down Expand Up @@ -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<number>();
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 : [];
}
Expand All @@ -201,7 +185,6 @@ export const transformExpertSearch = createTransformer<any, ExpertSearchResult>(
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,
Expand Down Expand Up @@ -229,7 +212,6 @@ export const transformExpertSearchListItem = createTransformer<any, ExpertSearch
query: raw.query ?? '',
status: raw.status ?? 'pending',
expertCount: raw.expert_count ?? 0,
excludedSearchIds: transformExcludedSearchIds(raw.excluded_search_ids),
createdAt: raw.created_at ?? '',
completedAt: raw.completed_at ?? null,
createdBy: transformCreatedBy(raw.created_by),
Expand Down