feat: 补齐今日视图待办组、卡片键盘操作、深色模式

今日视图
- 补上「待办」组。此前只收 逾期 / 今天到期 / 进行中,导致待办列里没设
  截止日期的任务在今日视图里完全消失 —— 用户明明有一堆事没做,却看到
  「今天没有待办事项」。现在只要任务未完成且未归档,就必定出现在某个
  分组里(归属优先级:逾期 > 今天到期 > 进行中 > 待办)。
- 统计卡片改为与分组一一对应(逾期 / 今天到期 / 进行中 / 本周完成),
  不再用「今日待办」这种把四组混在一起、与列表长度对不上的指标。

键盘操作(可访问性)
- 卡片可聚焦(Tab / 点击),← → 换列、↑ ↓ 列内调序、Enter 打开详情。
- 换列时追加到目标列末尾:用全量长度而不是可见下标,筛选态下也安全;
  列内调序要求该列渲染的是全量,否则禁用(与拖拽的规则一致)。
- 移动后手动恢复焦点 —— 卡片跨列会被重建,不恢复的话连续按键会失效。

深色模式
- 三态:跟随系统 / 浅色 / 深色,选择持久化到 localStorage。
- index.html 内联脚本在首帧之前应用主题,避免深色下闪白。
- 用 @custom-variant dark 做 class 控制(而不是纯 media query),
  才能支持「强制浅色」;html 的 color-scheme 让原生控件与滚动条跟随。

验证:单元测试 480 个、端到端测试 25 个全部通过,lint 与构建无错误。
截图脚本新增深色与移动端深色两组,便于后续对照。
This commit is contained in:
chenshoulin
2026-10-18 17:48:55 +08:00
parent 442cbbd734
commit 8721e8ab0b
32 changed files with 1022 additions and 158 deletions
+11 -6
View File
@@ -85,21 +85,23 @@ onBeforeUnmount(stopListening)
<template>
<Teleport to="body">
<div v-if="open" class="fixed inset-0 z-40">
<div class="absolute inset-0 bg-slate-900/40" @click="emit('close')" />
<div class="absolute inset-0 bg-slate-900/40 dark:bg-black/60" @click="emit('close')" />
<aside
ref="panelRef"
class="absolute inset-y-0 right-0 flex w-full max-w-md flex-col bg-white shadow-xl outline-none"
class="absolute inset-y-0 right-0 flex w-full max-w-md flex-col bg-white shadow-panel outline-none dark:bg-slate-900"
role="dialog"
aria-modal="true"
:aria-label="title"
tabindex="-1"
>
<header class="flex items-center justify-between border-b border-slate-200 px-4 py-3">
<h2 class="text-base font-medium text-slate-800">{{ title }}</h2>
<header
class="flex items-center justify-between border-b border-slate-200 px-4 py-3 dark:border-slate-800"
>
<h2 class="text-base font-medium text-slate-800 dark:text-slate-100">{{ title }}</h2>
<button
type="button"
class="rounded px-2 py-1 text-slate-400 transition hover:bg-slate-100 hover:text-slate-600"
class="rounded px-2 py-1 text-slate-400 transition hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-slate-800 dark:hover:text-slate-200"
aria-label="关闭"
@click="emit('close')"
>
@@ -111,7 +113,10 @@ onBeforeUnmount(stopListening)
<slot />
</div>
<footer v-if="$slots.footer" class="border-t border-slate-200 px-4 py-3">
<footer
v-if="$slots.footer"
class="border-t border-slate-200 px-4 py-3 dark:border-slate-800"
>
<slot name="footer" />
</footer>
</aside>