feat(HAI-100): add columnMovedAt timestamp and sort board tasks by move order

- Add columnMovedAt field to task types
- Set columnMovedAt on task creation and column moves in store
- Sort tasks by columnMovedAt descending in Board component
- Add store tests for columnMovedAt behavior
This commit is contained in:
Dustin Byrne
2026-03-26 20:12:30 -04:00
parent a8b767d6fc
commit 57e380bb0f
4 changed files with 58 additions and 3 deletions

View File

@@ -188,6 +188,7 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
steps: [],
currentStep: 0,
log: [{ timestamp: now, action: "Task created" }],
columnMovedAt: now,
createdAt: now,
updatedAt: now,
};
@@ -263,7 +264,8 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
const fromColumn = task.column;
task.column = toColumn;
task.updatedAt = new Date().toISOString();
task.columnMovedAt = new Date().toISOString();
task.updatedAt = task.columnMovedAt;
// Clear transient fields when moving to done (matches moveToDone behavior)
if (toColumn === "done") {
@@ -605,7 +607,8 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
task.worktree = undefined;
task.status = undefined;
task.blockedBy = undefined;
task.updatedAt = new Date().toISOString();
task.columnMovedAt = new Date().toISOString();
task.updatedAt = task.columnMovedAt;
await this.atomicWriteTaskJson(dir, task);