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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user