From 8385da72658615a2ea194385d3e8859fc62e1a61 Mon Sep 17 00:00:00 2001 From: Frank Steiler Date: Tue, 19 May 2026 22:53:22 +0200 Subject: [PATCH 1/2] fix(photo-annotator): restore text/callout/measurement inline input The text, callout, and measurement tools were not opening the inline text input when drawn on the canvas. The issue was in handleStageMouseUp which checked createShapeFromDraft return value, but that function doesn't handle these tools. Fixed by restructuring handleStageMouseUp to dispatch to inline input based on tool type directly: - Text: click-to-place (no drag size requirement) - Callout: open input when drag exceeds MIN_SIZE in both axes - Measurement: open input when Euclidean distance exceeds MIN_SIZE Co-Authored-By: Claude frontend-developer (claude-haiku-4-5) --- .../photos/PhotoAnnotator/PhotoAnnotator.tsx | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/client/src/components/photos/PhotoAnnotator/PhotoAnnotator.tsx b/client/src/components/photos/PhotoAnnotator/PhotoAnnotator.tsx index 77a813e1a..80c99583e 100644 --- a/client/src/components/photos/PhotoAnnotator/PhotoAnnotator.tsx +++ b/client/src/components/photos/PhotoAnnotator/PhotoAnnotator.tsx @@ -499,17 +499,27 @@ export function PhotoAnnotator({ photo, onSave, onCancel }: PhotoAnnotatorProps) if (liveRegionRef.current) { liveRegionRef.current.textContent = t('shapeAddedFreehand'); } + } else if (state.selectedTool === 'text') { + // Text tool: click-to-place, no drag size requirement + openInlineInput(draftShape.startX, draftShape.startY); + } else if (state.selectedTool === 'callout') { + // Callout: requires minimum drag (rect with tail) + if (w > MIN_SIZE && h > MIN_SIZE) { + openInlineInput(draftShape.startX, draftShape.startY); + } else { + setDraftShape(null); + } + } else if (state.selectedTool === 'measurement') { + // Measurement: line-based, use Euclidean distance gate + const distance = Math.hypot(draftShape.endX - draftShape.startX, draftShape.endY - draftShape.startY); + if (distance > MIN_SIZE) { + openInlineInput(draftShape.startX, draftShape.startY); + } else { + setDraftShape(null); + } } else if (w > MIN_SIZE && h > MIN_SIZE) { const newShape = createShapeFromDraft(draftShape); - if ( - newShape && - (state.selectedTool === 'text' || - state.selectedTool === 'callout' || - state.selectedTool === 'measurement') - ) { - // These require text input - openInlineInput(draftShape.startX, draftShape.startY); - } else if (newShape) { + if (newShape) { undoStack.commit(undoStack.shapes.concat([newShape as AnnotationShape])); setDraftShape(null); const announcements: Record = { From d6a7f535b1b3628030217aa9145ba952e0acb78d Mon Sep 17 00:00:00 2001 From: Frank Steiler Date: Tue, 19 May 2026 23:03:03 +0200 Subject: [PATCH 2/2] ci: retrigger flaky App.test