From c41eb622fe9614b866cd951fd6dfc6006fe523c3 Mon Sep 17 00:00:00 2001 From: Marko Djordjevic Date: Thu, 12 Feb 2026 14:46:23 +0100 Subject: [PATCH] refactor: remove line-deletion capability (already implemented) Line deletion via Delete tool already exists in current implementation. Focus on three new capabilities: label-management, docker-deployment, hacker-theme --- .../.openspec.yaml | 2 + .../proposal.md | 6 -- .../specs/line-deletion/spec.md | 69 ------------------- 3 files changed, 2 insertions(+), 75 deletions(-) create mode 100644 openspec/changes/enhance-annotation-features-and-deployment/.openspec.yaml delete mode 100644 openspec/changes/enhance-annotation-features-and-deployment/specs/line-deletion/spec.md diff --git a/openspec/changes/enhance-annotation-features-and-deployment/.openspec.yaml b/openspec/changes/enhance-annotation-features-and-deployment/.openspec.yaml new file mode 100644 index 0000000..95d284a --- /dev/null +++ b/openspec/changes/enhance-annotation-features-and-deployment/.openspec.yaml @@ -0,0 +1,2 @@ +schema: spec-driven +created: 2026-02-12 diff --git a/openspec/changes/enhance-annotation-features-and-deployment/proposal.md b/openspec/changes/enhance-annotation-features-and-deployment/proposal.md index db1d471..fb3d1de 100644 --- a/openspec/changes/enhance-annotation-features-and-deployment/proposal.md +++ b/openspec/changes/enhance-annotation-features-and-deployment/proposal.md @@ -4,10 +4,6 @@ The candle annotator currently has basic line drawing functionality (Phase 1-4 c ## What Changes -### Line Management Enhancements -- **Delete Selected Line**: Add ability to delete the currently selected line using keyboard shortcut (Delete/Backspace key) -- **Delete All Lines**: Add button in Toolbox to clear all line annotations at once with confirmation dialog - ### Label Management System - **Delete All Labels**: Add button to remove all break_up/break_down markers with confirmation - **Select Label**: Make label markers (arrows) clickable to select/highlight them @@ -43,7 +39,6 @@ The candle annotator currently has basic line drawing functionality (Phase 1-4 c ## Capabilities ### New Capabilities -- `line-deletion`: Delete selected line or all lines at once - `label-management`: Complete CRUD interface for label annotations in sidebar - `docker-deployment`: Containerized deployment with docker-compose - `hacker-theme`: Terminal-inspired minimal dark theme with neon accents @@ -56,7 +51,6 @@ The candle annotator currently has basic line drawing functionality (Phase 1-4 c ### Code Changes - **Database**: No schema changes needed (existing tables support all operations) - **Components**: - - `SvgOverlay.tsx`: Add keyboard delete handlers, bulk delete logic - `Toolbox.tsx`: Add label list UI, delete buttons, collapsible sections, theme styling - `CandleChart.tsx`: Add label selection click handlers, highlight logic - `page.tsx`: Add state for selected label, pass callbacks diff --git a/openspec/changes/enhance-annotation-features-and-deployment/specs/line-deletion/spec.md b/openspec/changes/enhance-annotation-features-and-deployment/specs/line-deletion/spec.md deleted file mode 100644 index d8bfaab..0000000 --- a/openspec/changes/enhance-annotation-features-and-deployment/specs/line-deletion/spec.md +++ /dev/null @@ -1,69 +0,0 @@ -## ADDED Requirements - -### Requirement: Delete selected line with keyboard -The system SHALL allow users to delete the currently selected line annotation using keyboard shortcuts (Delete key or Backspace key). - -#### Scenario: Delete selected line with Delete key -- **WHEN** a line is selected (selectedLineId is set) and user presses Delete key -- **THEN** system sends DELETE request to `/api/annotations/{id}`, removes line from display, clears selection state, and triggers annotation refresh - -#### Scenario: Delete selected line with Backspace key -- **WHEN** a line is selected and user presses Backspace key -- **THEN** system sends DELETE request to `/api/annotations/{id}`, removes line from display, clears selection state, and triggers annotation refresh - -#### Scenario: No line selected when pressing delete -- **WHEN** no line is selected (selectedLineId is null) and user presses Delete or Backspace key -- **THEN** system takes no action and does not make any API calls - -#### Scenario: Delete key during line drawing -- **WHEN** user is actively drawing a line (drawingLine state is not null) and presses Delete key -- **THEN** system cancels the line drawing operation but does NOT delete any existing lines - -### Requirement: Delete all lines with confirmation -The system SHALL provide a UI button in the Toolbox to delete all line annotations at once with user confirmation. - -#### Scenario: User clicks Delete All Lines button -- **WHEN** user clicks "Delete All Lines" button in Toolbox -- **THEN** system displays a confirmation dialog with message "Delete all line annotations? This cannot be undone." and Cancel/Confirm buttons - -#### Scenario: User confirms delete all lines -- **WHEN** confirmation dialog is open and user clicks Confirm button -- **THEN** system sends DELETE request to `/api/annotations?type=line`, removes all lines from display, clears selection state, triggers annotation refresh, and closes dialog - -#### Scenario: User cancels delete all lines -- **WHEN** confirmation dialog is open and user clicks Cancel button -- **THEN** system closes dialog without making any API calls or removing any lines - -#### Scenario: No lines exist when clicking delete all -- **WHEN** user clicks "Delete All Lines" button and no line annotations exist in database -- **THEN** system still shows confirmation dialog (user confirms/cancels normally) - -### Requirement: API support for bulk line deletion -The API SHALL support deleting multiple annotations by type via query parameters. - -#### Scenario: Delete all lines via API -- **WHEN** DELETE request sent to `/api/annotations?type=line` -- **THEN** system deletes all annotations where label_type equals 'line' and returns `{ success: true, deleted: }` - -#### Scenario: Delete all annotations via API -- **WHEN** DELETE request sent to `/api/annotations?all=true` -- **THEN** system deletes all annotations regardless of type and returns `{ success: true, deleted: }` - -#### Scenario: Invalid type parameter -- **WHEN** DELETE request sent to `/api/annotations?type=invalid_type` -- **THEN** system returns 400 error with message "Invalid annotation type" - -### Requirement: Delete button in Toolbox -The Toolbox SHALL display a "Delete All Lines" button when line annotations exist. - -#### Scenario: Lines exist in database -- **WHEN** one or more line annotations exist in the database -- **THEN** Toolbox displays "Delete All Lines" button in destructive styling (red theme) - -#### Scenario: No lines exist -- **WHEN** no line annotations exist in database -- **THEN** Toolbox displays "Delete All Lines" button in disabled state with reduced opacity - -#### Scenario: Button position in Toolbox -- **WHEN** Toolbox renders -- **THEN** "Delete All Lines" button appears below the color picker section and above the "Delete" tool button