feat(board): 已完成列按完成时间倒序排列
CI / verify (push) Successful in 1m45s
CI / 部署到服务器 (push) Successful in 27s

- 已完成列的展示顺序改由 completedAt 倒序决定(新增 sortCompletedDesc 纯函数),
  最近完成的永远在最上面;缺 completedAt 的旧数据排在有完成时间的任务之后,
  彼此退回 sortOrder 倒序
- 该列停用列内排序:拖拽与 ↑↓ 只能跨列,列头标注「按完成时间倒序」说明口径
- 数据层不动:不迁移 sortOrder,导入导出、快照结构与 schemaVersion 均不变,
  倒序只在 BoardView.visibleColumns 单点发生
- 新增 ADR-009,并在 ADR-008 的否决项里标注被部分推翻
- 单测 705 → 738(sortOrder +5、BoardView +5、BoardColumn +1),README 同步
This commit is contained in:
chenshoulin
2026-10-22 13:15:25 +08:00
parent b39267fba7
commit 51235a59a2
8 changed files with 228 additions and 5 deletions
+18
View File
@@ -77,6 +77,24 @@ describe('BoardColumn 渲染', () => {
const { wrapper } = setup([])
expect(wrapper.find('input[aria-label="添加任务"]').exists()).toBe(true)
})
it('已完成列标注排序口径,其它列不标注', () => {
const pinia = createPinia()
setActivePinia(pinia)
const store = useTaskStore()
store.init({ repository: createMemoryTaskRepository(), crossTab: false })
const mountWith = (column: ColumnDef) =>
mount(BoardColumn, {
props: { column, tasks: [], sortDisabled: column.id === 'done' },
global: { plugins: [pinia] },
})
expect(mountWith({ id: 'done', title: '已完成' }).find('[data-role="column-sort-hint"]').text()).toBe(
'按完成时间倒序',
)
expect(mountWith(TODO_COLUMN).find('[data-role="column-sort-hint"]').exists()).toBe(false)
})
})
describe('BoardColumn 拖拽契约', () => {
+8
View File
@@ -72,6 +72,14 @@ useDraggable(listRef, {
<header class="flex items-center gap-2 px-3 pt-3 pb-2">
<span class="size-1.5 shrink-0 rounded-full" :class="dotClass" aria-hidden="true" />
<h2 class="text-sm font-medium text-slate-700 dark:text-zinc-300">{{ column.title }}</h2>
<span
v-if="column.id === 'done'"
data-role="column-sort-hint"
class="text-[11px] text-slate-400 dark:text-zinc-500"
title="已完成列固定按完成时间倒序,最近完成的在最上面,不支持手动调序"
>
按完成时间倒序
</span>
<span
data-role="column-count"
class="ml-auto rounded-full border border-slate-200 bg-white px-2 py-0.5 text-xs font-medium text-slate-500 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-400"