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:
@@ -98,23 +98,13 @@ describe('AnnotationLayer', () => {
|
||||
expect(el2.style.opacity).toBe('1');
|
||||
});
|
||||
|
||||
it('does not show delete button when annotation is not hovered or active', async () => {
|
||||
// The on-canvas delete button was removed (issue #722). Even in annotate mode
|
||||
// with an active annotation, no delete button must render over the document.
|
||||
it('never renders a delete button, even in annotate mode with an active annotation', async () => {
|
||||
render(AnnotationLayer, {
|
||||
annotations: [makeAnnotation('ann-1')],
|
||||
canDraw: true,
|
||||
color: '#00C7B1',
|
||||
onDraw: () => {}
|
||||
});
|
||||
|
||||
await expect.element(page.getByTestId('annotation-ann-1')).toBeInTheDocument();
|
||||
await expect.element(page.getByTestId('annotation-delete-ann-1')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('does not show delete button when canDraw is false even if annotation is active', async () => {
|
||||
render(AnnotationLayer, {
|
||||
annotations: [makeAnnotation('ann-1')],
|
||||
canDraw: false,
|
||||
color: '#00C7B1',
|
||||
activeAnnotationId: 'ann-1',
|
||||
onDraw: () => {}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user