Skip to content

fix: collapse reply form after submit; auto-close empty comment forms#366

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

fix: collapse reply form after submit; auto-close empty comment forms#366
tomasz-tomczyk merged 1 commit intomainfrom
fix-reply-form-state

Conversation

@tomasz-tomczyk
Copy link
Copy Markdown
Owner

Summary

  • Reply form now collapses and clears on successful submit instead of restoring with the just-sent text on re-render. Cause: saveOpenFormContent re-saved the still-expanded form's text into activeReplyForms after the submit handler deleted it; the new render then restored from that saved state.
  • Opening a new comment form now closes other open forms that are empty (forms with text or in-edit are kept).

Review

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

Test plan

  • e2e/tests/threading.spec.ts — new "collapses and clears after successful submit" test, plus reply auto-close-empty / keep-with-text
  • e2e/tests/multi-form.spec.ts — new "closes existing empty form" test
  • All existing multi-form / threading / comments e2e specs pass

See also: tomasz-tomczyk/crit-web#124

🤖 Generated with Claude Code

Reply form now collapses on successful submit instead of restoring with
the just-sent text on re-render. Opening a new comment form closes other
empty open forms (forms with text or in-edit are kept).

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 66.92%. Comparing base (c6b7484) to head (20f9d69).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #366      +/-   ##
==========================================
+ Coverage   66.86%   66.92%   +0.06%     
==========================================
  Files          18       18              
  Lines        7807     7807              
==========================================
+ Hits         5220     5225       +5     
+ Misses       2194     2191       -3     
+ Partials      393      391       -2     
Flag Coverage Δ
e2e 34.89% <ø> (ø)
unit 62.75% <ø> (+0.06%) ⬆️

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 d676a68 into main Apr 26, 2026
6 checks passed
@tomasz-tomczyk tomasz-tomczyk deleted the fix-reply-form-state branch April 26, 2026 19:14
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