feat: simplify today into plain list
ci / gitleaks (push) Successful in 10s
ci / docker (push) Successful in 7m27s

This commit is contained in:
2026-09-17 18:04:40 +08:00
parent 73aca652f1
commit 66589dd458
9 changed files with 228 additions and 143 deletions
+8 -9
View File
@@ -29,6 +29,10 @@ describe('Today independent collapsible sections', () => {
expect(app).toContain(`aria-labelledby="today-${section}-heading"`)
}
}
expect(app).toContain('<span class="today-section-title">逾期</span>')
expect(app).toContain('<span class="today-section-title">今天</span>')
expect(app).toContain('<span class="today-section-title">习惯</span>')
expect(app).not.toMatch(/today-section-title"><(?:CalendarDays|ListTodo|Repeat2)\/>/)
expect(app.match(/class="today-section-toggle(?: today-section-anchor)?"/g)).toHaveLength(3)
expect(app).toContain('<span class="today-section-summary">{{totalTasks}} 项</span>')
expect(app).not.toContain('<span class="today-section-summary">{{taskTree.length}} 项</span>')
@@ -45,14 +49,9 @@ describe('Today independent collapsible sections', () => {
expect(habits).not.toContain('v-if="!todaySectionCollapse.habits"')
})
it('expands a collapsed destination before next-tick scrolling and focus, respecting reduced motion', () => {
expect(app).toContain("async function navigateTodaySection(section: 'tasks' | 'habits')")
expect(app).toContain('todaySectionCollapse.value[section] = false')
expect(app).toContain('await nextTick()')
expect(app).toContain('await new Promise<void>((resolve) => requestAnimationFrame(() => resolve()))')
expect(app).toContain('heading?.focus({ preventScroll: true })')
expect(app).toContain("window.matchMedia('(prefers-reduced-motion: reduce)').matches ? 'auto' : 'smooth'")
expect(app).toContain("@click=\"navigateTodaySection('tasks')\"")
expect(app).toContain("@click=\"navigateTodaySection('habits')\"")
it('keeps section navigation local to each collapse toggle', () => {
expect(app).not.toContain("async function navigateTodaySection(section: 'tasks' | 'habits')")
expect(app).toContain("@click=\"toggleTodaySection('tasks')\"")
expect(app).toContain("@click=\"toggleTodaySection('habits')\"")
})
})