IssueReportPage: match the corrected row shape, assignees is a list

damocles caught it on the swarm-controller PR: forge's assignee field
is legacy single-value, assignees is the real multi-assignee list, and
this repo actually uses multiple. Widen the frontend's row type +
column to match -- rendered comma-joined the same way labels already
are.
This commit is contained in:
iris 2026-08-31 18:28:53 +02:00 committed by mara
commit f4b61db753

View file

@ -34,13 +34,17 @@ interface IssueReportRow {
number: number; number: number;
title: string; title: string;
labels: string[]; labels: string[];
assignee: string | null; // `string[]`, not a single `assignee` — forge's own `assignee` field is
// the legacy single-value one; `assignees` is the real multi-assignee
// list, and this repo actually uses multiple (caught against an
// earlier draft of this row shape that had it singular).
assignees: string[];
html_url: string | null; html_url: string | null;
blocked: boolean; blocked: boolean;
depended_on_by_count: number; depended_on_by_count: number;
} }
type SortKey = 'repo' | 'number' | 'title' | 'assignee' | 'blocked' | 'depended_on_by_count'; type SortKey = 'repo' | 'number' | 'title' | 'assignees' | 'blocked' | 'depended_on_by_count';
type SortDir = 'asc' | 'desc'; type SortDir = 'asc' | 'desc';
// Sentinel `<select>` value for "every repo" — `''` can't collide with a // Sentinel `<select>` value for "every repo" — `''` can't collide with a
@ -61,8 +65,8 @@ function compareRows(a: IssueReportRow, b: IssueReportRow, key: SortKey): number
return a.number - b.number; return a.number - b.number;
case 'title': case 'title':
return a.title.localeCompare(b.title); return a.title.localeCompare(b.title);
case 'assignee': case 'assignees':
return (a.assignee ?? '').localeCompare(b.assignee ?? ''); return a.assignees.join(', ').localeCompare(b.assignees.join(', '));
case 'blocked': case 'blocked':
return Number(a.blocked) - Number(b.blocked); return Number(a.blocked) - Number(b.blocked);
case 'depended_on_by_count': case 'depended_on_by_count':
@ -216,9 +220,11 @@ export function IssueReportPage() {
render: (r) => (r.labels.length ? r.labels.join(', ') : '—'), render: (r) => (r.labels.length ? r.labels.join(', ') : '—'),
}, },
{ {
key: 'assignee', key: 'assignees',
header: <SortHeader label="assignee" sortKey="assignee" activeKey={sortKey} dir={sortDir} onSort={onSort} />, header: (
render: (r) => r.assignee ?? '—', <SortHeader label="assignees" sortKey="assignees" activeKey={sortKey} dir={sortDir} onSort={onSort} />
),
render: (r) => (r.assignees.length ? r.assignees.join(', ') : '—'),
}, },
{ {
key: 'blocked', key: 'blocked',