fix: remove swipe backgrounds and smooth habit swipe updates
ci / docker (push) Successful in 3m24s

This commit is contained in:
2026-09-07 13:30:57 +08:00
parent ef3d659889
commit 593ee6bbf3
4 changed files with 38 additions and 12 deletions
+16
View File
@@ -30,6 +30,22 @@ describe('task and habit row decoration', () => {
expect(mvpPanel.match(/@pointercancel="cancelHabitPointer/g)?.length).toBe(2)
})
it('updates habit rows locally after swiping instead of refreshing the whole Today section', () => {
expect(mvpPanel).toContain('setLocalHabitValue(h, next)')
const applyBlock = mvpPanel.slice(mvpPanel.indexOf('async function applyHabitSwipe'), mvpPanel.indexOf('async function finishHabitSwipe'))
expect(applyBlock).not.toContain('await loadHabits()')
expect(applyBlock).toContain('setLocalHabitValue(h, next)')
expect(applyBlock).toContain('setLocalHabitValue(h, previous)')
})
it('keeps swipe behavior without rendering the swipe background layer', () => {
expect(app).not.toContain('swipe-bg')
expect(mvpPanel).not.toContain('swipe-bg')
expect(css).not.toContain('.swipe-bg')
expect(app).toContain('shouldToggleRowSwipe')
expect(mvpPanel).toContain('shouldToggleRowSwipe')
})
it('does not draw a left border on task or habit rows', () => {
expect(css).toContain('.task-row{border-left:0;')
expect(css).toContain('.habit-row{border-left:0;')