fix(editor): a held press on another tab leaves the hidden line empty

The kept-alive annotations tab showed the reason in its hidden message
line, so it came back on the return. A press made while the place is
hidden is now only described by the button.
This commit is contained in:
bchanot committed 2026-11-19 15:03:06 +01:00
1 parent 531bbef619
commit 77251fa636
2 files changed
+21 -2

No files matched your search

@@ -767,6 +767,23 @@ describe('why a button is held (point 6)', () => {
)
})
it('on another tab a held « Refaire » keeps its description, and a press does nothing', async () => {
const user = await openAnnotations()
stacks()
await user.click(screen.getByRole('tab', { name: 'Général' }))
pend()
const before = store.getState().documentText
await user.click(redoButton())
expect(reason(redoButton())).toBe(PENDING)
expect(useAnnotationWork.getState().preview).not.toBeNull()
expect(store.getState().documentText).toBe(before)
expect(store.getState().redo).toHaveLength(1)
noMessage()
// Back on Annotations, the press made elsewhere is not shown in the line.
await user.click(screen.getByRole('tab', { name: 'Annotations' }))
noMessage()
})
it('give no reason when nothing is pending, nothing to redo or read-only', async () => {
const user = await openAnnotations()
expect(reason(redoButton())).toBeNull()