fix: collapse subtasks when opening lists
ci / gitleaks (push) Successful in 48s
ci / docker (push) Successful in 3m53s

This commit is contained in:
2026-09-08 17:43:56 +08:00
parent 1872079571
commit ba08a2fd34
2 changed files with 18 additions and 2 deletions
+7
View File
@@ -90,6 +90,13 @@ describe('task and habit row decoration', () => {
expect(app).toContain(':aria-expanded="!collapsedTaskIds.has(node.task.id)"')
})
it('starts parent tasks collapsed when entering a task list', () => {
expect(app).toContain('function collapseLoadedTaskChildren()')
expect(app).toContain("else if (isTaskView(activeView.value)) {\n await loadAll()\n if (activeView.value === 'tasks') collapseLoadedTaskChildren()")
expect(app).toContain("else {\n await loadAll()\n if (view === 'tasks') collapseLoadedTaskChildren()")
expect(app).toContain('tasks.value.filter((task) => task.subtasks?.length).map((task) => task.id)')
})
it('shows visible completion buttons for tasks and subtasks while keeping swipe shortcuts', () => {
expect(app).not.toContain('class="sr-only" :aria-label="node.task.completed')
expect(app).not.toContain('class="sr-only" :aria-label="subtask.completed')