From 0e8dcc6707b8cf7659c625b1769d29702594519f Mon Sep 17 00:00:00 2001 From: Marko Djordjevic Date: Tue, 17 Feb 2026 18:16:49 +0100 Subject: [PATCH] chore: archive line-rectangle-annotations change and sync specs - Archived change to openspec/changes/archive/2026-02-17-line-rectangle-annotations/ - Updated annotation-tools spec: added rectangle tool mode, TrendLine plugin rendering, line hit testing, line selection handles; updated line drawing and delete requirements; removed SVG overlay rendering - Created new rectangle-annotation spec with full requirements for rectangle drawing, rendering, hit testing, selection, deletion, and database storage Co-Authored-By: Claude Sonnet 4.5 --- .../.openspec.yaml | 2 + .../design.md | 92 +++++++++++++++ .../proposal.md | 29 +++++ .../specs/annotation-tools/spec.md | 83 ++++++++++++++ .../specs/rectangle-annotation/spec.md | 105 ++++++++++++++++++ .../tasks.md | 57 ++++++++++ openspec/specs/annotation-tools/spec.md | 57 ++++++++-- openspec/specs/rectangle-annotation/spec.md | 105 ++++++++++++++++++ 8 files changed, 522 insertions(+), 8 deletions(-) create mode 100644 openspec/changes/archive/2026-02-17-line-rectangle-annotations/.openspec.yaml create mode 100644 openspec/changes/archive/2026-02-17-line-rectangle-annotations/design.md create mode 100644 openspec/changes/archive/2026-02-17-line-rectangle-annotations/proposal.md create mode 100644 openspec/changes/archive/2026-02-17-line-rectangle-annotations/specs/annotation-tools/spec.md create mode 100644 openspec/changes/archive/2026-02-17-line-rectangle-annotations/specs/rectangle-annotation/spec.md create mode 100644 openspec/changes/archive/2026-02-17-line-rectangle-annotations/tasks.md create mode 100644 openspec/specs/rectangle-annotation/spec.md diff --git a/openspec/changes/archive/2026-02-17-line-rectangle-annotations/.openspec.yaml b/openspec/changes/archive/2026-02-17-line-rectangle-annotations/.openspec.yaml new file mode 100644 index 0000000..2a45c1f --- /dev/null +++ b/openspec/changes/archive/2026-02-17-line-rectangle-annotations/.openspec.yaml @@ -0,0 +1,2 @@ +schema: spec-driven +created: 2026-02-15 diff --git a/openspec/changes/archive/2026-02-17-line-rectangle-annotations/design.md b/openspec/changes/archive/2026-02-17-line-rectangle-annotations/design.md new file mode 100644 index 0000000..4cd4138 --- /dev/null +++ b/openspec/changes/archive/2026-02-17-line-rectangle-annotations/design.md @@ -0,0 +1,92 @@ +## Context + +The candle annotator uses lightweight-charts for rendering candlestick data and currently has two rendering layers for annotations: + +1. **Canvas-based (ISeriesPrimitive)**: Used by `SpanRectanglePrimitive.ts` for span annotations. These are attached to the series via `series.attachPrimitive()` and render natively within the chart canvas. They support `hitTest()`, autoscaling, and z-ordering. + +2. **SVG overlay**: Used by `SvgOverlay.tsx` for line annotations. An absolutely-positioned SVG element sits on top of the chart with `zIndex: 1111`, intercepting pointer events when the line or delete tool is active. It duplicates coordinate conversion logic and manages its own interaction state. + +The existing `src/plugins/trend-line.ts` already implements a `TrendLine` class using `ISeriesPrimitive