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>
Add SpanAnnotation, SpanLabelType, and SubSpan interfaces extracted from
duplicate inline definitions across SpanAnnotationManager, SpanAnnotationList,
SpanPopover, Toolbox, and page.tsx components.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
src/types/predictions.ts already existed with PredictionSpan, PredictionState, and ModelInfoResponse interfaces matching actual usage across page.tsx, CandleChart.tsx, and PredictionPanel.tsx.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a shared Chart interface matching the DB schema (id, name, created_at)
and the existing usages in page.tsx and ChartSelector.tsx.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Creates src/types/annotations.ts with typed interfaces matching actual
usage in CandleChart.tsx, page.tsx, and DB schema. Marks task 9.2 done.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add shared Candle interface with time, open, high, low, close, and
optional volume fields. Volume is optional because the DB schema does
not store volume but the predict/patterns API routes accept it as an
optional field.
Mark task 9.1 as complete in tasks.md.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move the inline 'new Set<string>()' default prop to a module-level constant
(EMPTY_STRING_SET) to prevent unnecessary Set instance creation on every render,
which could cause unnecessary re-renders in children or effects that depend on
reference equality.
Replace inline magic numbers (8px, 60s, 2, 1, 0.15, 0.25, 100) and hardcoded
color strings with named module-level constants for better maintainability and
clarity. Organized constants into logical groups:
- Magic number constants (tolerance, intervals, sizes, alphas)
- Dark theme colors
- Light theme colors
- Candlestick colors
- Prediction overlay colors
- Predefined label colors
This improves code readability and makes it easier to adjust UI parameters globally.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>