feat(KB-069): add Archive All Done feature

- Add archiveAllDone method to TaskStore with filtering and batch archive
- Add POST /tasks/archive-all-done API endpoint with tests
- Add useTasks hook support and API function for archiveAllDone
- Add Archive All button to done column header in Board UI
- Wire up onArchiveAllDone through Board component hierarchy
This commit is contained in:
gsxdsm
2026-03-30 16:50:34 -07:00
parent c71347930f
commit 360f3e03b3
11 changed files with 293 additions and 5 deletions

View File

@@ -875,6 +875,26 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
});
}
/**
* Archive all tasks currently in the "done" column.
* Returns an array of archived tasks.
*/
async archiveAllDone(): Promise<Task[]> {
const tasks = await this.listTasks();
const doneTasks = tasks.filter((t) => t.column === "done");
if (doneTasks.length === 0) {
return [];
}
// Archive all done tasks concurrently
const archivedTasks = await Promise.all(
doneTasks.map((task) => this.archiveTask(task.id))
);
return archivedTasks;
}
/**
* Archive a done task (move from done → archived).
* Logs the action and emits `task:moved` event.