Issue close controls: split buttons — one-click Close (completed) with not-planned dropdown segment; Comment and Close likewise; outside-click dismisses the menu #311
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#311
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
Rework the close affordances on an issue into split buttons (primary action + dropdown segment), matching GitHub's pattern:
Current state (code evidence)
Everything lives in
web/src/components/CommentComposer.jsx:ChooserMenu(:23-110) is the dropdown primitive. WhencloseChooseris set, both Close and Comment and Close render as pure chooser buttons (:236-262) — you must open the menu and pick a reason to close at all. There is no one-click path.CLOSE_COMPLETED = "completed"andCLOSE_NOT_PLANNED = "not_planned"(web/src/lib/issue-events.js:29-30), validated client-side (:103) and carried asstate_reasonserver-side (internal/issues/model.go:70). The user's "incomplete" maps to the existingnot_planned— no backend or reason-vocabulary change is needed; verify the event-text rendering (issue-events.js:82) reads sensibly for both paths.onMenuKey) and Tab-out; no document-level outside-click listener. The repo already has the standard pattern to copy —RefPicker/TasksOverlayinweb/src/pages/Repo.jsx(document click +!root.contains(e.target)+onCleanupremoval), and #255 fixed the clone menu with the same shape.bottom-full, :92) beneath the composer — keep that.Proposed design
[primary label][▾]as one visually joined control. Primary click = default action; ▾ segment opens the menu.Close→runClose(CLOSE_COMPLETED); menu item =Close as not planned→runClose(CLOSE_NOT_PLANNED). Menu no longer needs a "Close as completed" item (the button IS that), but keeping it harms nothing — implementer's call, note it in the PR.runClose(CLOSE_COMPLETED)(via the existingcommentAndClose(body, reason)— body may be empty; preserve current semantics where an empty body still closes); menu item = "Comment and close as not planned".closeChooser=falsefallback (plain button) for callers that don't opt into reasons (PR close has no reasons today) — only the chooser path changes.onCleanup. Must not close-then-reopen when clicking the ▾ segment itself (segment is inside the boundary).aria-haspopup,aria-expanded, menu role, arrow-key navigation, Escape-with-focus-return (all exist inChooserMenu— carry them into the split variant). The primary segment needsaria-labeldistinguishing it from the menu toggle.getBusy()— keep single-flight).Acceptance criteria
state_reason: not_planned.PR #315 (fix/issue-311) implements the split-button close controls — ready for review, not merged.
PR #315 review (split-button close controls) — verified in scratch worktree, fix pushed as
a9a3911.ACCEPTANCE (all pass, CommentComposer.jsx):
ONE FINDING (fixed, pushed
a9a3911): 08_ui_sdk.md claimed an 'incidental fix' where the Comment-and-Close chooser passed props.disabled (always undefined) instead of getBusy() — inaccurate: main already passed disabled={getBusy()} to BOTH chooser menus. Doc now states the kept behavior (all three split controls disable from getBusy(), as the choosers did). Code was already correct; no behavior change.VERIFY: full node suite in scratch 595/595 pass (588 existing + 7 new split-close); vite build clean in 2s (chunk-size warning is pre-existing). No browser (per instructions; change is headless-testable + reasoned). Main worktree untouched.
MERGE RECOMMENDATION: ready to merge.
Fixed by PR #315 incl. review doc fix (one-click completed + not-planned segments + outside-click; 595/595), merged. Closing.