Skip to content

Commit 7256eb1

Browse files
committed
Suppress idempotent reduced ink done
1 parent 0fabe59 commit 7256eb1

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

frontend/taskdeck-web/src/components/paper/InkBleed.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,13 @@ function scheduleSequence(): void {
107107
108108
function applyReducedPhase(next: InkBleedPhase): void {
109109
clearTimers()
110-
if (next === 'auto' || next === 'dried') {
111-
const wasDried = currentPhase.value === 'dried'
110+
if (next === 'auto') {
111+
setPhase('dried')
112+
if (currentPhase.value === 'dried') emit('done')
113+
return
114+
}
115+
if (next === 'dried') {
112116
setPhase('dried')
113-
if (wasDried) emit('done')
114117
return
115118
}
116119
setPhase(next)

frontend/taskdeck-web/src/tests/components/paper/InkBleed.spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,15 @@ describe('InkBleed', () => {
118118
expect(wrapper.emitted('done')).toHaveLength(1)
119119
})
120120

121+
it('does not emit done for an idempotent reduced-motion dried phase', async () => {
122+
installMatchMedia(true)
123+
const wrapper = mount(InkBleed, { props: { phase: 'dried' } })
124+
await wrapper.vm.$nextTick()
125+
126+
expect(wrapper.classes()).toContain('ink-bleed--dried')
127+
expect(wrapper.emitted('done')).toBeUndefined()
128+
})
129+
121130
it('honors controlled phase changes under reduced motion', async () => {
122131
installMatchMedia(true)
123132
const wrapper = mount(InkBleed, { props: { phase: 'drop' } })

0 commit comments

Comments
 (0)