Issues tab: default to showing open issues only (currently open + closed) #323
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub#323
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
What's requested
The Issues tab (
/:owner/:name/issues) should default to showing open issues only. Today it shows open and closed together; a user wanting the closed ones opts in via the State filter.Current state (code evidence)
web/src/pages/Issues.jsx:31-37— the list query readsstate: search.state || "", and the server treats an emptystateas "open + closed" (the filter select's own labels confirm it: empty option reads "open + closed",Issues.jsx:96-101).?state=param) fetches and renders both states intermixed.search.state(:100), so it will naturally show "open" as the selected option once the default flips — verify that binding reflects the effective default rather than the raw param.Proposed change
stateto"open"when the URL carries nostateparam:state: search.state ?? "open"is NOT enough (empty string is a legitimate "both" choice from the select) — the right shape is: treat absent param asopen, keep explicit?state=(including a possible "both" representation) honored as-is. Implementation detail for the implementer: either reservestate=all/bothas the explicit both-value and migrate the select's "open + closed" option to it, or treatundefinedas open and""as both — pick one, keep the URL honest, and note it in the PR.?milestone=<id>from the milestones page "View issues" button, #314) — they inherit the query default, so they'll show open-only too. That matches GitHub behavior; call it out in the PR so it's a decision, not an accident.Pulls.jsx) is NOT in scope of this request — leave as-is unless the user says otherwise (flag the inconsistency in the PR body for a follow-up decision).Acceptance criteria
/:owner/:name/issueswith no state param shows only open issues; the State select visibly reads "open".?state=closed, etc.) are honored exactly.?milestone=) default to open-only as well.aftercursor behavior unaffected (key already includes the query JSON).Fix ready for review: PR #330 (#330) — issues list defaults to open-only; explicit both-choice is
?state=all(URL-honest, wire-omitted, no backend change); milestone-filtered views deliberately inherit; Pulls.jsx untouched and flagged for follow-up. Not merged.Review of PR #330 (fix/issue-323) — verified in scratch worktree /tmp/pr330 @
6757752(main worktree untouched, still clean on main).All #323 acceptance criteria hold:
Wire safety verified against server code: listIssues 400s on anything but open|closed and treats absent as both (internal/issues/http.go:376-382), so mapping all->"" (omitted via SDK qs() skip-empty, web/sdk/src/issues.js:90-97) means the endpoint never sees 'all' — no 400 path, no backend change needed. Unknown passthrough (?state=bogus -> 400 tray error) matches pre-change behavior. Doc contrast with milestones endpoint (accepts all natively, http.go:781-785) verified accurate.
Scope/discipline: Pulls.jsx untouched + flagged; no new deps (package.json unchanged, law 1); no Go changes (laws 7/8 vacuous); doc decision appended same-change (law 12).
Tests: node --test web/test/unit/issue-state.test.js 6/6 pass; full web/test/unit/*.test.js 612 pass / 0 fail (smoke.test.js cancelled — hangs on squatted :8080 in this sandbox, pre-existing environmental as disclosed in PR body); vite build clean (2.06s). No browser drive per task constraints (query/select binding verified headless + by reading).
Nits (non-blocking, no push): doc hunk re-indents one adjacent continuation line ('slot for other surfaces.'); PR body phrase 'pulls already defaults to open' describes the tab highlight only — strictly, Pulls.jsx empty-state sends omitted state and ListPRs with empty State returns BOTH (service.go:782), so the open-highlighted pulls tab may show both. Pre-existing, out of scope, but worth a follow-up issue.
MERGE RECOMMENDATION: ready to merge.
Fixed by PR #330 (review clean; resolver + wire mapping + cache interplay verified; 612/612), merged. Closing.