Skip to content

fix: auto-close empty comment forms when opening another#124

Merged
tomasz-tomczyk merged 1 commit intomainfrom
fix-reply-form-state
Apr 26, 2026
Merged

fix: auto-close empty comment forms when opening another#124
tomasz-tomczyk merged 1 commit intomainfrom
fix-reply-form-state

Conversation

@tomasz-tomczyk
Copy link
Copy Markdown
Owner

@tomasz-tomczyk tomasz-tomczyk commented Apr 26, 2026

Summary

  • Opening a new comment form now closes other open forms that are empty (forms with text or in-edit are kept).
  • Adds a regression test that the reply form collapses and clears after a successful submit (already correct in this repo).

Review

  • Code review: passed (no blockers)
  • Parity audit: in sync with crit/

Test plan

  • e2e/comments.spec.ts — empty form closes on new form open; non-empty stays
  • e2e/threading.spec.ts — reply collapses after submit
  • All existing comment + threading e2e specs pass

See also: tomasz-tomczyk/crit#366

🤖 Generated with Claude Code

Opening a new comment form now closes other open forms that are empty
(forms with text or in-edit are kept). Adds regression test for reply
form collapse-after-submit (already correct in this repo).

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

codecov Bot commented Apr 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.87%. Comparing base (818ad8d) to head (7528116).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #124   +/-   ##
=======================================
  Coverage   75.87%   75.87%           
=======================================
  Files          52       52           
  Lines        1513     1513           
=======================================
  Hits         1148     1148           
  Misses        365      365           
Flag Coverage Δ
unit 75.87% <ø> (ø)

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 ff79830 into main Apr 26, 2026
4 checks passed
@tomasz-tomczyk tomasz-tomczyk deleted the fix-reply-form-state branch April 26, 2026 19:14
tomasz-tomczyk added a commit that referenced this pull request Apr 26, 2026
)

Parity port from crit/ PR #366. closeEmptyForms was already wired into
openForm (line-scope) via PR #124, but the file-scope and review-scope
paths (openFileCommentForm / openReviewCommentForm) were missed.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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