feat: align upcoming with list layout
ci / gitleaks (push) Successful in 1m3s
ci / docker (push) Successful in 4m48s

This commit is contained in:
2026-09-19 19:43:32 +08:00
parent 915d690397
commit 0cf1c49094
6 changed files with 124 additions and 28 deletions
+8 -5
View File
@@ -73,21 +73,24 @@ describe('approved five-detail polish', () => {
expect(css).toMatch(/@media\(max-width:930px\)\{[\s\S]*?\.countdown-focus\{[^}]*height:140px/)
})
it('uses approved Today-sourced page headers for task lists without changing Trash IA', () => {
expect(app).toContain('v-if="activeView===\'tasks\'" class="list-page-context"')
it('uses approved Today-sourced page headers for task lists and Upcoming without changing Trash IA', () => {
expect(app).toContain('v-if="activeView===\'tasks\' || activeView===\'upcoming\'" class="list-page-context"')
expect(app).toContain('<h1 class="list-page-title" :title="activeName">{{ activeName }}</h1>')
expect(app).toContain('<p class="list-page-summary">{{ taskOpenTotal === null ? \'待完成统计暂不可用\' : `还有 ${taskOpenTotal} 项待完成` }}</p>')
expect(app).toContain('<CompletedFilterPill v-model="showCompleted" class="list-inline-filter" />')
expect(app).toContain('id="task-list-heading" class="list-section-heading"')
expect(app).toContain("v-if=\"activeView==='tasks' || activeView==='upcoming'\" id=\"task-list-heading\" class=\"list-section-heading\"")
expect(app).toContain('<span id="task-list-title" class="list-section-title">任务</span>')
expect(app).toContain("v-if=\"activeView==='tasks' && taskReorderAvailable\"")
expect(app).toContain('<span class="list-section-count">{{ totalTasks }}</span>')
expect(app).toContain("v-if=\"activeView==='tasks' && totalPages > 1\" class=\"list-page-meta\"")
expect(app).toContain("if (activeView.value === 'upcoming') { openParams.set('due_from', isoAtLocalDayOffset(0)); openParams.set('due_to', isoAtLocalDayOffset(8)) }")
expect(app).toContain("new Date(task.due_at) >= startOfLocalDay(0) && new Date(task.due_at) < startOfLocalDay(8)")
expect(app).toContain('v-if="query" class="list-search-clear"')
expect(app).not.toContain("activeView==='tasks' && (totalPages > 1 || totalTasks > 0)")
expect(app).toContain("activeView==='tasks' ? 'task-list-title' : undefined")
expect(app).toContain(":aria-labelledby=\"activeView==='today' ? 'today-tasks-heading' : (activeView==='tasks' || activeView==='upcoming') ? 'task-list-title' : undefined\"")
const taskTopbar = app.slice(app.indexOf('<header class="topbar"'), app.indexOf('</header>'))
expect(taskTopbar).not.toContain('CompletedFilterPill v-if="activeView!==\'today\'"')
expect(app).toContain('v-if="activeView!==\'today\' && activeView!==\'tasks\'" class="list-toolbar"')
expect(app).toContain('v-if="activeView===\'trash\'" class="list-toolbar"')
expect(css).toContain('.list-page-context{width:min(100%,630px);margin:0 auto 0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:0 16px}')
expect(css).toContain('.list-page-title{margin:0;font-size:34px;line-height:1.15;font-weight:700;letter-spacing:-.035em}')
expect(css).toContain('.list-page-summary{margin:8px 0 18px;color:var(--muted);font-size:13px}')