Inline comment composer: move Cancel from header row to bottom action row (lower left, opposite Stage comment) #587
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#587
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 inline (staged-draft) comment composer keeps its Cancel button in the header row, next to the "commenting on …" anchor label. Move Cancel out of the header and into the composer's bottom action row, lower left, opposite the right-aligned primary submit ("Stage comment" / "Save" / "Start thread").
Evidence (current tree,
git pullfresh at filing time)Both instances of the pattern share the same defect:
web/src/pages/Pull.jsx:594-599— the dismissable draft composer (Forgejo #566, rendered under a diff line): the header<p>iscommenting on <anchor>followed immediately by the small secondaryCancelbutton (btn ml-2 px-2 py-0.5 text-xs), then theCommentComposerat line 600 renders its own bottom action row (web/src/components/CommentComposer.jsx:262):flex flex-wrap items-center justify-end gap-2with the primary submit right-aligned. The action being about the whole draft sits next to an informational label, disconnected from the row the user submits from.web/src/pages/PullFiles.jsx:109-114— the Files-tab staged composer (same #566 idiom): identical header-anchored Cancel above aCommentComposerwhose submit is "Start thread".Header comment/idiom refs: the header row is purely informational (
commenting on <anchorLabel>); the Cancel behavior (drops only the keyed draft, Escape equivalence, refocus) is documented atweb/src/pages/Pull.jsx:572-592andweb/src/pages/PullFiles.jsx:94-99.Architecture notes
CommentComposer(web/src/components/CommentComposer.jsx:262-316) and is shared by every surface (issues, PR conversation, review). Cleanest shape: add an optionalonCancel/cancelLabelprop pair toCommentComposerthat renders the Cancel button at the left of that row (e.g.justify-between, left slot = Cancel, right slot = existing close/submit cluster). Both call sites above then drop their header-row button and pass the handler instead — one mechanism, no per-page fork of the row.<p>keeps only the anchor label.onStage, no POST), and refocuses the staging trigger (refocusTriggerpath in Pull.jsx). Update the comments at both call sites that currently describe the button as header-row ("Cancel wears the small secondary .btn treatment" etc.) so they describe the new position..btnclasses — no new CSS.Acceptance criteria
commenting on <anchor>label — no button.CommentComposerconsumers withoutonCancelrender exactly as before.<p>contains no<button>), and/or screenshot review.Fixed by #590 (merged): CommentComposer gains optional onCancel/cancelLabel rendering Cancel lower-left opposite the submit cluster; both inline composers pass their existing handlers verbatim (behavior identical, incl. refocus semantics); no-onCancel consumers byte-identical. Verified: 1470 unit tests green (smoke excluded, pre-existing), vite/esbuild green, independent review APPROVE.