Skip to content

fix: Ctrl+Enter to save when editing replies#386

Merged
tomasz-tomczyk merged 1 commit intomainfrom
fix/382-ctrl-enter-edit-comment
Apr 29, 2026
Merged

fix: Ctrl+Enter to save when editing replies#386
tomasz-tomczyk merged 1 commit intomainfrom
fix/382-ctrl-enter-edit-comment

Conversation

@tomasz-tomczyk
Copy link
Copy Markdown
Owner

Summary

  • editReply built an inline textarea with Save/Cancel buttons but never attached a keydown listener — Ctrl+Enter was silently ignored once you hit the pencil on a reply.
  • Match the pattern from createCommentFormUI (and crit-web's editReply which already had this): Ctrl/Cmd+Enter clicks Save, Escape clicks Cancel.
  • Top-level comment edit already worked via createCommentFormUI; added a regression test for it alongside the new reply-edit test.

Review

  • Code review: passed
  • Parity audit: passed (crit-web document-renderer.js:2917-2928 already had this handler)

Test plan

  • New regression tests in e2e/tests/comments.spec.ts (top-level comment edit) and e2e/tests/threading.spec.ts (reply edit) — both fail on main without the fix, pass with it.
  • Full comments.spec.ts + threading.spec.ts suites green (42/42).
  • go test ./... green.

Closes #382

editReply built an inline textarea with Save/Cancel buttons but no
keydown handler, so Ctrl+Enter was silently ignored once the user
hit the pencil on a reply. Match the pattern from createCommentFormUI:
Ctrl/Cmd+Enter clicks Save, Escape clicks Cancel.

Top-level comment edit already worked via createCommentFormUI; added
a regression test for it alongside the new reply-edit test.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.59%. Comparing base (6cbb4dd) to head (6a3761b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #386      +/-   ##
==========================================
+ Coverage   66.56%   66.59%   +0.03%     
==========================================
  Files          19       19              
  Lines        8176     8176              
==========================================
+ Hits         5442     5445       +3     
+ Misses       2311     2309       -2     
+ Partials      423      422       -1     
Flag Coverage Δ
e2e 34.19% <ø> (+0.37%) ⬆️
unit 62.61% <ø> (+0.03%) ⬆️

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 7fedb7a into main Apr 29, 2026
5 of 6 checks passed
@tomasz-tomczyk tomasz-tomczyk deleted the fix/382-ctrl-enter-edit-comment branch April 29, 2026 09:22
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.

CTRL + Enter does not submit save a comment when editing

1 participant