Feedback dialog: keep the draft on a stray release, lock it while sending, and cancel on close - #1925
Merged
Merged
Conversation
A click goes to the nearest element its press and its release share, so dragging a selection out of the message and letting go over the scrim reached the backdrop as a click of its own and closed the dialog, with the message, the contact and the screenshots. The backdrop now closes only on a press that went down on the scrim and came up there, through a useScrimDismiss helper any modal can spread.
The kinds are radios inside the form, and a browser submits a form on a bare Enter in a radio, so choosing a kind with the arrows and pressing Enter sent the report before a screenshot or a contact could be added. A bare Enter on a kind now does nothing, as in the contact field; Send and the shortcut stay the only ways a report leaves.
Cancel, Esc or the × pressed during "Sending…" only took the dialog away: the send went on waiting for its images and then posted, so a report the person had just cancelled could start uploading after the dialog was gone, and a failure of it was shown to nobody. Closing now aborts a post under way, a send still waiting on its images never posts, and neither says anything afterwards. fake-react gains an unmount to test it.
The request is built from the form when Send is pressed, yet a paste or a drop still attached an image while it was out, and the strip's remove and the message stayed live: a screenshot removed mid-send was said to be gone and went anyway, one pasted was said to be added and did not go, and words typed meanwhile closed with the dialog. Everything above Cancel and Send is now inert until the answer and no image is taken; focus in there moves to Send and comes back if the send fails.
Send waits for every image still being redrawn to fit. One that then could not be read or shrunk was taken off the strip and refused beside it, and the report went without it: the thanks covered the refusal and the dialog closed, so the person never learnt the screenshot had not gone. A refusal said while Send waits now stops it, and the dialog stays open saying that nothing was sent and the images need a look.
BarganConstantin
force-pushed
the
fix/feedback-dialog
branch
from
October 4, 2026 20:15
2b04f61 to
25d596f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
useScrimDismissinuse-modal-dismiss.ts, ready for the other modals).Verification
npm run typecheck: clean.--maxWorkers=3 --minWorkers=1): 845 files, 11387 tests passed (exit 0).tarball-install-smoke.test.tspassed here too; it is known to time out in worktrees and pass in CI.developmentfor the reason in the finding before its fix:feedback-scrim-dismiss.test.ts: a press from the message released on the scrim calledonClose(3 of 4 failed before).feedback-sending-lock.test.ts: a paste and a drop during the send reachedimages.add, and the fields stayed live (4 of 6 failed before; two focus cases added with the fix).feedback-kind-enter.test.ts: a bare Enter on a kind was not prevented.feedback-send-cancel.test.ts: the post went out after unmount, and the fetch had no signal to abort.feedback-refused-while-sending.test.ts: the report posted after its image was refused during the wait.fake-react.tsgainsunmount()(runs effect cleanups; later state sets draw nothing). Two existing source pins were repointed for the backdrop's spread handlers and the Send button's ref.POST /api/feedbackanswered bypage.route): 22/22 checks passed. Drag-select over the scrim keeps the dialog and the text, and a plain scrim click still closes it. While sending, the fields are inert, the remove × and a paste change nothing, Cancel stays live, focus goes to Send and comes back to the message after a failure. Enter on a kind posts nothing, and Ctrl+Enter from it posts kindidea. Cancel during an upload aborts the request, and Esc while an image is resizing posts nothing. A damaged PNG refused while Send waits posts nothing and shows the failure and the refusal, and Send again posts the remaining image.