feat: complete issue list filters, sort, and fields (task 0002) #5
Reference in New Issue
Block a user
Delete Branch "task-0002-issue-list-filters-and-fields"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Task:
.claude/tasks/0002-issue-list-filters-and-fields.mdCompletes the
issue listflag surface left minimal by the tracer slice.--label(comma-separated names, passed through),--assignee,--author,--milestone, mapped to Gitea'slabels,assigned_by,created_by,milestonesparams. All four filter server-side in a single request, alongside the existingtype=issuesguard.--sort <created|updated|comments>— always descending, over the fully paginated set (ADR 0005). The count line keepsTfromX-Total-Count, since sorting reorders without changing membership.--fields <a,b,c>— appendsbody,closedAt,labels,milestone,updatedAt,urlvia the FieldDef extractors.--searchis refused with aVALIDATION_ERROR(exit 2) redirecting tosearch issues, in its valued, inline, and bare forms.Deviations
Exhaustive pagination landed as a shared
src/paginate.tsrather than a detail of this command, because ADR 0005 makes it a policy thatpr listand the dashboard will reuse.lookup.ts'slistAllLabelshand-rolled the same loop and now calls the shared helper. The helper carries the 20-page cap those local constants encoded, matching the 1000-item ceiling Principle 8 sets on exhaustive pagination — without it, a server that ignores paging would loop forever.Two count-line details the acceptance criteria did not spell out. Under
--sort,--limitcaps the sorted result rather than the fetch, so pages are read at the full page size of 50 and the limit selects the top N by the sort key. Also under--sort, when an instance omitsX-Total-Count, the total falls back to the size of the fully paginated set rather than degrading tocount: N (showing first N)— everything was fetched in order to sort it, so the total is known, and Principle 4 says a total is always reported.--stateand--sortshared an enum-parsing shape, now extracted asparseEnumFlaginflags.ts.Review
Risk
Overall: Medium
issue listplus a newpaginate.ts; the one existing caller changed (lookup.ts) keeps its behaviour.--limitinteraction,--fields, and the--searchrefusal in all three flag forms.issueListnow branches between a single-page and a fetch-everything path, whose sort and limit semantics differ.issue listis a primary command, and--sortwalks every page on a large repo (now bounded at 20 pages).Unaddressed findings
Spec —
--fields bodyrenders raw and untruncated. This is what the task and the spec's command surface ask for ("body(raw)"), and it matches the already-mergedissue create --fields body. It contradicts Principle 3 ("Body text is truncated at 500 characters in all contexts (list and detail alike)"): a 30-row list with--fields bodycan now emit 30 full bodies, the exact cost Principle 3 exists to prevent. Left as specified rather than fixed here, because truncating inissue listalone would make it disagree withissue create— the conflict wants one ruling applied to both commands, not a silent divergence in this slice.