feat: name filtered state in issue list count line (task 0033)
Some checks failed
CI / test (pull_request) Failing after 54s

Make the `issue list` count line name the state it filtered on, so the
answer to "how many issues are open?" is present on the summary line
rather than only inferable from each row. The count line now renders
`count: 5 open of 5 total`; the command composes the state into a generic
optional qualifier while `formatCountLine` stays state-agnostic, so
`pr list`, `search`, and `dashboard` are unaffected. `--state all` imposes
no narrowing and stays unqualified.

The wording is chosen so an agent quoting the summary lands on a phrase the
benchmark read-checker already accepts (`5 open`), closing the accuracy gap
this feature targets. Pairs with the report persistence in task 0032.
This commit is contained in:
2026-07-17 10:09:50 -04:00
parent 4cbed21ff3
commit 1166a48130
5 changed files with 77 additions and 12 deletions

View File

@@ -460,11 +460,19 @@ async function issueList(deps: CliDeps, args: string[]): Promise<string> {
return renderList({
noun: "issues",
rows,
countLine: formatCountLine(rows.length, total, rows.length >= limit),
countLine: formatCountLine(rows.length, total, rows.length >= limit, countStateQualifier(state)),
help: issueListSuggestions(context, state, rows.length, total),
});
}
// The count line names the state the list was filtered to, so the answer to
// "how many are open?" is on the summary line rather than only inferable from
// each row. `all` imposes no narrowing and has no natural one-word name, so it
// adds no qualifier and the generic count line stands.
function countStateQualifier(state: IssueState): string | undefined {
return state === "all" ? undefined : state;
}
// The default detail fields reuse the same declarative extraction as the list
// path; only `body` (truncation) and `comment_count` need bespoke handling.
const ISSUE_VIEW_FIELDS: FieldDef<Issue>[] = [