fix(transcription): remove annotation canvas delete button that obscures text #722
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Each annotation box on the document canvas renders a delete control (
AnnotationShape.svelte): a 44×44 px circular red button pinned totop: 4px; right: 4px. On a single-line annotation the button is taller than the box itself, so it overlaps the box below and obscures the underlying document text. It appears on hover/active in transcribe mode (canDraw).The 44 px size is the WCAG 2.2 touch-target minimum (transcribers work on tablets), so it cannot simply be shrunk without breaking touch accessibility — the control fundamentally fights the geometry of small annotation boxes.
Why removal is the right fix (not "improve in place")
The canvas delete button is redundant in 100% of normal user flows:
createFromDrawPOSTs once to/transcription-blocksand the backend creates the annotation and its block together (useTranscriptionBlocks.svelte.ts). Every user-created annotation always has a block.TranscriptionBlock.svelte), which cascades to remove the annotation.The only thing the canvas button uniquely handles is orphan annotations (annotation with no block) — but those are not reachable through any normal UI flow; they can only arise from a backend partial-failure or data corruption. That is a data-integrity concern, not a transcriber-facing job. Losing the in-app cleanup path for that edge case is an accepted trade-off.
Decision
Deleteshortcut (AnnotationShape.sveltekeydown handler) — it does not obscure any content and is retained as a power-user path. The entire wiring chain (showDelete→onDeleteRequest→deleteAnnotation) stays in place to feed the shortcut.Acceptance criteria
Scope (files)
frontend/src/lib/document/annotation/AnnotationShape.svelte<button>block and the now-unuseddeleteVisiblederived. KeepshowDelete,onDeleteRequest, and theDelete-key branch.frontend/src/lib/document/annotation/AnnotationShape.svelte.spec.tsDeletetests.frontend/src/lib/document/annotation/AnnotationLayer.svelte.spec.tsfrontend/e2e/documents.spec.tsadmin can delete an annotationtest from the (removed) canvas button to the kept path: focus an annotation → pressDelete→ confirm dialog ("Bestätigen"). The old matcher (/annotation löschen/i) never matched the button'sLöschenaria-label anyway.Unchanged (must stay — feeds the keyboard shortcut):
AnnotationLayer.svelte(showDelete={canDraw},onDeleteRequest),PdfViewer.svelte,DocumentViewer.svelte,documents/[id]/+page.svelte(handleAnnotationDeleteRequest),useTranscriptionBlocks.svelte.ts(deleteAnnotation).Non-functional notes
Deleteshortcut is out of scope here.npm run check, Prettier, and ESLint are clean for all touched files. Browser/e2e specs run in CI.marcel referenced this issue2026-06-04 14:02:53 +02:00
marcel referenced this issue2026-06-04 14:03:15 +02:00