From 7097f991fef17d8fc0f6580982a33f6403bc800c Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 14 Apr 2026 14:40:30 +0200 Subject: [PATCH] feat(annotations): add keyboard accessibility to resize handles [B2] Co-Authored-By: Claude Sonnet 4.6 --- .../components/AnnotationEditOverlay.svelte | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/AnnotationEditOverlay.svelte b/frontend/src/lib/components/AnnotationEditOverlay.svelte index 595459f3..bf920f2f 100644 --- a/frontend/src/lib/components/AnnotationEditOverlay.svelte +++ b/frontend/src/lib/components/AnnotationEditOverlay.svelte @@ -226,6 +226,17 @@ function handleKeyDown(event: KeyboardEvent): void { }, 300); } +const directionLabels: Record = { + nw: 'NW', + ne: 'NE', + sw: 'SW', + se: 'SE', + n: 'N', + s: 'S', + e: 'E', + w: 'W' +}; + // Preview rect in pixel space (maps live normalized coords back to SVG pixel coordinates). // Shown during pointer drag and during keyboard nudging (whenever live coords differ from stored). let previewX = $derived(((liveX - annotation.x) / annotation.width) * svgWidth); @@ -298,10 +309,15 @@ let hasLiveChanges = $derived( {#each handles as handle (handle.id)} handlePointerDown(e, 'handle', handle.id)} + onkeydown={(e) => { + if (e.key === 'Enter' || e.key === ' ') e.preventDefault(); + }} >