Fix #566: inline draft composers dismissable (visible Cancel + Escape) #569
No reviewers
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 milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub!569
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/issue-566"
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?
Fixes #566. Follow-up sweep filed separately as #568 (not bundled).
Option (b): small secondary .btn Cancel on both composers (canonical idiom, both themes, no new ui.css rule) + panel-level Escape dismissal with trigger refocus (SplitCloseMenu convention; focus-never-click, no toggle-fight; no document listener).
Verification: new composer-dismiss-566.test.js 17/17; related 87/87; full-minus-smoke 1352/1352 (smoke needs live server, pre-existing); vite build + esbuild SDK green, web/dist/.keep restored; go vet clean. 390px reasoned (no layout change — same panel, button-sized Cancel). Docs: FIXED (Forgejo #566) amendment in docs/go/12_web_ui.md, same commit (law 12).
APPROVE — independent review of fix/issue-566 (
9f22490) against #566. All acceptance criteria hold; no fix commits needed (working tree clean on the branch).What I verified:
btn ml-2 px-2 py-0.5 text-xs(Pull.jsx draft composer, PullFiles.jsx staged composer)..btnis the canonical Controls idiom (guideline §2) and ships its owndark:variants (ui.css:78-80), so no per-call-site theme code and no new ui.css rule — option (b) as prescribed.onKeyDown(Escape-only, preventDefault + stopPropagation) callingcloseDraft(key)/dismissStaged(true). No document listener, so no onCleanup needed (pinned by test). Textarea Escape reaches the panel becauseonSubmitKeysreturns early for non-Enter keys — verified in submitKeys.js. No toggle-fight: refocus isfocus()only, neverclick(), on both surfaces.triggerRefsMap fed by the gutter '+'refunder its own draft key; Files-tab queries[aria-label^="Comment on selected lines"], which matches the DiffBody trigger (DiffTable.jsx:329). Stale Map entries are focus-no-ops, as commented.closeDraftdeletes exactly one Map key (no clear/wipe);dismissStagedtouches onlysetStaged(null)—getCreateduntouched (grep-confirmed), noonStage/replay, no POST/invalidate near any dismiss path. Re-stage remounts under the same Show gates with a fresh empty CommentComposer body; no draft-text stash..linkuses intact (Pull.jsx 5+, PullFiles.jsx 2+), ui.css gains no.linkrule, and #568 exists (open) covering the systemic sweep.go vetclean. Fail-pre-fix confirmed: origin/main hasclass="link ml-2"cancel (2x Pull.jsx, 1x PullFiles.jsx) and zero Dismissable markers, so the new pins fail there. The single smoke failure (smoke.test.js, 403 from whatever answers on :8080 here) is environmental and pre-disclosed — no walhub server running in this sandbox.No defects found — nothing to fix, working tree untouched.