task 9.7: replace duplicate interfaces with @/types imports
Replace locally-defined duplicate interfaces in page.tsx, CandleChart.tsx, SpanAnnotationManager.tsx, Toolbox.tsx, SpanAnnotationList.tsx, and SpanPopover.tsx with imports from @/types. - SpanAnnotation, SpanLabelType: replaced in all 6 files - Candle, AnnotationType: replaced in CandleChart.tsx, SpanAnnotationManager.tsx, Toolbox.tsx - Annotation (with geometry): replaced in CandleChart.tsx and Toolbox.tsx - Chart: kept local in page.tsx (shared type has created_at: Date|number vs local number) - Annotation in page.tsx: kept local (geometry: any) but added missing color field for compatibility Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
28a0d0790e
commit
5c5701b080
6 changed files with 16 additions and 190 deletions
|
|
@ -14,6 +14,7 @@ import KeyboardShortcutsModal from '@/components/KeyboardShortcutsModal';
|
|||
import { useTheme } from 'next-themes';
|
||||
import { Settings, Tag, Layers } from 'lucide-react';
|
||||
import type { PredictionState, PredictionSpan, ModelInfoResponse, Disagreement, DisagreementType, PredictionSummary } from '@/types/predictions';
|
||||
import type { SpanAnnotation, SpanLabelType } from '@/types';
|
||||
|
||||
/**
|
||||
* Calculate overlap between two time ranges
|
||||
|
|
@ -120,46 +121,25 @@ function detectDisagreements(
|
|||
};
|
||||
}
|
||||
|
||||
// SpanAnnotation, SpanLabelType are imported from @/types above.
|
||||
// Chart: kept local because shared Chart.created_at is Date|number but local usage expects number.
|
||||
interface Chart {
|
||||
id: number;
|
||||
name: string;
|
||||
created_at: number;
|
||||
}
|
||||
|
||||
// Annotation: kept local because shared Annotation has geometry: Geometry|null but local usage passes geometry: any.
|
||||
interface Annotation {
|
||||
id: number;
|
||||
chart_id: number;
|
||||
timestamp: number;
|
||||
label_type: string;
|
||||
color: string | null;
|
||||
geometry: any;
|
||||
created_at: number;
|
||||
}
|
||||
|
||||
interface SpanAnnotation {
|
||||
id: number;
|
||||
chart_id: number;
|
||||
start_time: number;
|
||||
end_time: number;
|
||||
label: string;
|
||||
confidence: number | null;
|
||||
outcome: string | null;
|
||||
notes: string | null;
|
||||
sub_spans: any;
|
||||
color: string;
|
||||
created_at: number;
|
||||
}
|
||||
|
||||
interface SpanLabelType {
|
||||
id: number;
|
||||
name: string;
|
||||
display_name: string;
|
||||
color: string;
|
||||
hotkey: string | null;
|
||||
is_active: boolean;
|
||||
sort_order: number;
|
||||
created_at: number;
|
||||
}
|
||||
|
||||
export default function Home() {
|
||||
const { theme, setTheme } = useTheme();
|
||||
const [settingsOpen, setSettingsOpen] = useState(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue