fix(editor): bubble clears the strip's commands, announces through a steady region

This commit is contained in:
bchanot committed 2026-11-19 21:04:21 +01:00
1 parent 49f0144729
commit a9252375e1
7 files changed
+313 -56

No files matched your search

@@ -790,10 +790,44 @@ describe('why a button is held (point 6)', () => {
stacks()
pend()
await user.click(redoButton())
expect(bubble()).toHaveAttribute('role', 'status')
expect(bubble()).toHaveAttribute('aria-hidden', 'true')
return user
}
it('is announced by the button\'s always-mounted status region, once per press', async () => {
const user = await openAnnotations()
stacks()
pend()
const region = screen.getByTestId('history-status-redo')
expect(region).toHaveAttribute('role', 'status')
expect(region).toBeEmptyDOMElement()
await user.click(redoButton())
expect(region).toBe(screen.getByTestId('history-status-redo'))
expect(region).toHaveTextContent(PENDING)
const first = region.firstElementChild
await user.click(redoButton())
expect(region).toHaveTextContent(PENDING)
expect(region.children).toHaveLength(1)
expect(region.firstElementChild).not.toBe(first)
await user.pointer({ keys: '[MouseLeft]', target: document.body })
expect(region).toBeEmptyDOMElement()
})
it('a second Escape drops the pending work, as before', async () => {
const user = await openAnnotations()
const list = screen.getByRole('list', { name: 'Annotations de la vue' })
await user.click(within(list).getAllByRole('button')[0]!)
stacks()
pend()
redoButton().focus()
await user.keyboard('{Enter}')
await user.keyboard('{Escape}')
noMessage()
expect(useAnnotationWork.getState().preview).not.toBeNull()
await user.keyboard('{Escape}')
expect(useAnnotationWork.getState().preview).toBeNull()
})
it('is portalled out of the row, so nothing in the layout can move', async () => {
await heldRedo()
expect(screen.getByTestId('history-buttons')).not.toContainElement(
@@ -860,7 +894,7 @@ describe('why a button is held (point 6)', () => {
expect(bubble()).toHaveTextContent(PENDING)
expect(bubble().style.getPropertyValue('--bubble-top')).toBe('54px')
expect(bubble().style.right).toBe('64px')
expect(bubble().style.maxWidth).toBe('min(22rem, 952px)')
expect(bubble().style.maxWidth).toBe('min(18rem, 952px)')
delete (document.documentElement as { clientWidth?: number }).clientWidth
})
})