fix(transcription): remove annotation canvas delete button that obscured text (#722)

The per-annotation delete button (a 44px circular control pinned to the
box's top-right) overlapped the box below and obscured the underlying
document text. It was redundant: every user-drawn annotation has a
transcription block, and the right-hand panel already offers a
non-overlapping delete per block that cascades to the annotation.

Remove the visible button and its `deleteVisible` derived. Keep the
keyboard Delete shortcut (and its `showDelete`/`onDeleteRequest`/
`deleteAnnotation` wiring) — it obscures nothing and remains a
power-user path and the only cleanup route for orphan annotations.

Tests: replace the button-render/click specs with contract tests
asserting no delete button ever renders; repoint the e2e delete flow
to the keyboard shortcut + confirm dialog.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-06-03 22:38:37 +02:00
committed by marcel
parent 27b6d58632
commit ad820955fd
4 changed files with 18 additions and 153 deletions

View File

@@ -383,12 +383,16 @@ test.describe('PDF annotations — admin', () => {
// Record count now — the draw test may have created more than one annotation
const countBefore = await page.locator('[data-testid^="annotation-"]').count();
// Enable annotate mode to show delete buttons
// Enable annotate mode — deletion is only available while annotating
await page.getByRole('button', { name: /^annotieren$/i }).click();
const deleteBtn = page.getByRole('button', { name: /annotation löschen/i }).first();
await expect(deleteBtn).toBeVisible({ timeout: 8000 });
await deleteBtn.click();
// The on-canvas delete button was removed (issue #722). Delete via the
// kept keyboard shortcut: focus an annotation, press Delete, confirm.
const annotation = page.locator('[data-testid^="annotation-"]').first();
await annotation.click();
await annotation.press('Delete');
await page.getByRole('button', { name: /^bestätigen$/i }).click();
await expect(page.locator('[data-testid^="annotation-"]')).toHaveCount(countBefore - 1, {
timeout: 8000