Skip to content

fix: confirm before discarding non-empty comment drafts on Esc#157

Merged
tomasz-tomczyk merged 1 commit intomainfrom
esc-confirm-discard
May 1, 2026
Merged

fix: confirm before discarding non-empty comment drafts on Esc#157
tomasz-tomczyk merged 1 commit intomainfrom
esc-confirm-discard

Conversation

@tomasz-tomczyk
Copy link
Copy Markdown
Owner

@tomasz-tomczyk tomasz-tomczyk commented May 1, 2026

Summary

  • Esc on a non-empty comment form now prompts Discard comment? instead of silently throwing away the draft. Empty form → silent close (unchanged).
  • Cancel button discards immediately (matches GitHub) — explicit user intent doesn't need a confirm.
  • Reported by a user who lost a detailed draft to a reflexive Esc.

Test plan

  • New e2e covering Esc-with-content (accept/dismiss), Esc-empty (no dialog), Cancel-button (no dialog).
  • Existing comment / editing / reply-editing / templates / draft-autosave suites green (116/117 — the one failure is a pre-existing dark-theme contrast flake unrelated to this change).
  • See also: fix: confirm before discarding non-empty comment draft on Escape crit#415

🤖 Generated with Claude Code

Pressing Esc on a comment form with content now prompts a native
confirm("Discard comment?") so a detailed draft isn't lost in one
keystroke. Empty forms still close silently. The Cancel button is an
explicit, labeled discard and is intentionally not gated. Applies to
new comments, edits, and reply edits.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.28%. Comparing base (81770de) to head (b47e703).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #157   +/-   ##
=======================================
  Coverage   77.28%   77.28%           
=======================================
  Files          55       55           
  Lines        1651     1651           
=======================================
  Hits         1276     1276           
  Misses        375      375           
Flag Coverage Δ
unit 77.28% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tomasz-tomczyk tomasz-tomczyk merged commit 8330c62 into main May 1, 2026
4 checks passed
@tomasz-tomczyk tomasz-tomczyk deleted the esc-confirm-discard branch May 1, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant