feat: an ordered backlog

A Backlog tab lists the tickets still to start in the order the team will
take them; drag them, or use the arrows, to reorder. Moving a ticket only
rewrites that ticket's rank, read from the event store, and board columns
follow the same order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 14:01:44 +02:00
parent d4da33d4e8
commit 0606f53026
53 changed files with 1599 additions and 32 deletions

View File

@@ -29,7 +29,18 @@ export function matchesFilter(
return true;
}
/** Removes the issue wherever it is and puts `next` (if any) on top of its status column. */
/** `issues` (in backlog order) with `issue` at its place by rank. */
export function insertByRank(
issues: IssueSummary[],
issue: IssueSummary,
): IssueSummary[] {
const at = issues.findIndex((i) => i.rank > issue.rank);
return at === -1
? [...issues, issue]
: [...issues.slice(0, at), issue, ...issues.slice(at)];
}
/** Removes the issue wherever it is and puts `next` (if any) at its place by rank in its status column. */
export function placeIssue(
columns: BoardColumn[],
issueId: string,
@@ -42,7 +53,7 @@ export function placeIssue(
: column.issues;
let total = column.total - (had ? 1 : 0);
if (next && next.status === column.status) {
issues = [next, ...issues];
issues = insertByRank(issues, next);
total += 1;
}
return had || issues !== column.issues