fix(KB-186): add ID-based tiebreaker to sort comparators for stable ordering
- Add numeric ID tiebreaker to TaskStore.listTasks() when createdAt timestamps match - Add same tiebreaker to InlineCreateCard and TaskDetailModal dependency dropdown sorts - Add store-sort integration test verifying ascending ID order with identical timestamps - Add InlineCreateCard tests for identical-timestamp dropdown ordering and search filtering - Add TaskDetailModal test for identical-timestamp dependency dropdown ordering
This commit is contained in:
@@ -249,7 +249,13 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
|
||||
}
|
||||
}
|
||||
|
||||
return tasks.sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
||||
return tasks.sort((a, b) => {
|
||||
const cmp = a.createdAt.localeCompare(b.createdAt);
|
||||
if (cmp !== 0) return cmp;
|
||||
const aNum = parseInt(a.id.slice(a.id.lastIndexOf("-") + 1), 10) || 0;
|
||||
const bNum = parseInt(b.id.slice(b.id.lastIndexOf("-") + 1), 10) || 0;
|
||||
return aNum - bNum;
|
||||
});
|
||||
}
|
||||
|
||||
async moveTask(id: string, toColumn: Column): Promise<Task> {
|
||||
|
||||
Reference in New Issue
Block a user