style: simplify mobile task views
ci / gitleaks (push) Successful in 1m24s
ci / docker (push) Successful in 6m1s

This commit is contained in:
2026-09-16 22:11:01 +08:00
parent 6c234d7d82
commit bdf2a53fa9
11 changed files with 343 additions and 39 deletions
+17 -11
View File
@@ -36,7 +36,7 @@ describe('unified task due display', () => {
expect(app).toContain('</span><span v-if="activeView===\'trash\'" class="task-actions">')
expect(app).not.toContain('restoreTask(subtask)')
expect(app).not.toContain('purgeTask(subtask)')
expect(app).toContain('<span v-else class="task-actions"><button class="icon ghost task-detail-trigger"')
expect(app).not.toContain('task-detail-trigger')
expect(app).toContain('<span v-if="node.task.priority" class="priority"')
expect(app).toContain('v-if="node.subtasks.length" class="meta"')
expect(app).toContain('<span class="meta-item"><ListChecks/>')
@@ -218,24 +218,26 @@ describe('solid cream material system', () => {
})
describe('approved UI detail direction', () => {
it('uses one More detail entry for ordinary parent rows while preserving Trash and overdue actions', () => {
it('opens ordinary and overdue task details from the task body while preserving Trash actions', () => {
const ordinaryStart = app.indexOf('<section :id="activeView===\'today\' ? \'today-tasks\' : undefined"')
const ordinaryRows = app.slice(ordinaryStart, app.indexOf('</section>', ordinaryStart))
expect(ordinaryRows.match(/aria-label="打开任务详情"/g)).toHaveLength(1)
expect(ordinaryRows).toContain('@click.stop="selectTask(node.task)"><Ellipsis/>')
expect(ordinaryRows).toContain("selectTaskUnlessSwiped(node.task)")
expect(ordinaryRows).not.toContain('task-detail-trigger')
expect(ordinaryRows).not.toContain('selectTask(subtask)')
expect(ordinaryRows).not.toContain('aria-label="删除任务"')
expect(ordinaryRows).toContain('v-if="activeView===\'trash\'" class="task-actions"')
expect(ordinaryRows).toContain('restoreTask(node.task)')
expect(ordinaryRows).toContain('purgeTask(node.task)')
const overdue = app.slice(app.indexOf('<section v-if="overdueTaskTree.length"'), app.indexOf('id="today-tasks-heading"'))
expect(overdue).toContain('selectTaskUnlessSwiped(node.task)')
expect(overdue).not.toContain('aria-label="打开任务详情"')
})
it('keeps the parent due tail immediately before the More detail entry', () => {
expect(app).toContain('</span><span v-else class="task-actions"><button class="icon ghost task-detail-trigger" aria-label="打开任务详情" @click.stop="selectTask(node.task)"><Ellipsis/></button></span>')
expect(app).not.toContain('@click.stop="selectTask(subtask)"><Ellipsis/>')
expect(css).toContain('.task-detail-trigger:hover{color:var(--text-primary);background:#fff7eb}')
it('keeps the due tail as the final parent-row control and opens details from the task body', () => {
expect(app).toContain('@click="activeView===\'trash\'?undefined:selectTaskUnlessSwiped(node.task)"')
expect(app).toContain('<span v-if="node.task.due_at" class="task-tail">')
expect(app).not.toContain('task-detail-trigger')
expect(css).not.toContain('.task-detail-trigger')
})
it('keeps task details on a 12px rhythm with fixed labels and right-aligned controls', () => {
@@ -986,17 +988,21 @@ describe('mobile touch targets', () => {
})
describe('approved habit safety and U2 title hierarchy', () => {
it('uses one page title and continuous settings section headings', () => {
it('uses one page title and continuous settings section headings without slogan strips', () => {
expect(mvpPanel).not.toContain('<h2>习惯</h2>')
expect(mvpPanel).not.toContain('<h2>设置与数据</h2>')
for (const title of ['数据', '账户与安全', '登录设备', '活动', '危险操作']) expect(mvpPanel).toContain(`<h2>${title}</h2>`)
expect(mvpPanel).not.toContain('class="view-intro"')
for (const title of ['数据', '账户与安全', '登录设备', '活动']) expect(mvpPanel).toContain(`<h2>${title}</h2>`)
expect(mvpPanel).not.toContain('<h2>危险操作</h2>')
expect(mvpPanel).toContain('class="settings-sections"')
expect(mvpPanel).not.toContain('class="settings-grid"')
expect(mvpPanel).not.toContain('class="tool-card')
expect(css).toContain('.settings-sections{width:min(100%,760px);')
expect(css).toContain('.settings-row{min-height:56px;')
expect(css).toContain('.backup-preflight .danger-button{min-height:44px}')
expect(css).toContain('.backup-preflight.invalid,.settings-danger{background:#fff2ef;')
expect(css).toContain('.backup-preflight.invalid{background:#fff2ef;')
expect(mvpPanel).toContain("v-if=\"restoreMode==='replace'\" class=\"restore-replace-warning\"")
expect(mvpPanel).toContain('替换恢复会覆盖当前数据,请先导出完整备份。')
})
it('keeps invalid forms visible, disables save, and still shows the reason', () => {