issue-report: add transitively-blocks count alongside direct depended-on-by count

This commit is contained in:
damocles 2026-08-31 21:33:46 +02:00 committed by mara
commit 361121c7f6
2 changed files with 101 additions and 8 deletions

View file

@ -5,9 +5,9 @@
// swarm-controller's `GET /api/repos` (dropdown source, only repos with
// an open issue), `GET /api/issue-report` (default — every repo
// combined) and `GET /api/repos/{org}/{repo}/issue-report` (once a
// specific repo is picked) — `blocked` and `depended_on_by_count` both
// arrive pre-resolved per row, so nothing here does its own
// dependency-graph walk.
// specific repo is picked) — `blocked`, `depended_on_by_count` and
// `transitively_blocks_count` all arrive pre-resolved per row, so
// nothing here does its own dependency-graph walk.
//
// Sorting and the label/hide-blocked filters are client-side over
// whatever's currently loaded — only the repo selection re-fetches.
@ -42,9 +42,17 @@ interface IssueReportRow {
html_url: string | null;
blocked: boolean;
depended_on_by_count: number;
transitively_blocks_count: number;
}
type SortKey = 'repo' | 'number' | 'title' | 'assignees' | 'blocked' | 'depended_on_by_count';
type SortKey =
| 'repo'
| 'number'
| 'title'
| 'assignees'
| 'blocked'
| 'depended_on_by_count'
| 'transitively_blocks_count';
type SortDir = 'asc' | 'desc';
// Sentinel `<select>` value for "every repo" — `''` can't collide with a
@ -71,6 +79,8 @@ function compareRows(a: IssueReportRow, b: IssueReportRow, key: SortKey): number
return Number(a.blocked) - Number(b.blocked);
case 'depended_on_by_count':
return a.depended_on_by_count - b.depended_on_by_count;
case 'transitively_blocks_count':
return a.transitively_blocks_count - b.transitively_blocks_count;
}
}
@ -269,6 +279,20 @@ export function IssueReportPage() {
ariaSort: ariaSortFor('depended_on_by_count'),
render: (r) => r.depended_on_by_count,
},
{
key: 'transitively_blocks_count',
header: (
<SortHeader
label="transitively blocks"
sortKey="transitively_blocks_count"
activeKey={sortKey}
dir={sortDir}
onSort={onSort}
/>
),
ariaSort: ariaSortFor('transitively_blocks_count'),
render: (r) => r.transitively_blocks_count,
},
];
return (