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.
Description
fix #2568
Implemented confirmation prompt when canceling comment edit.
ConfirmModal
component with presets for different confirmation types.comment.js eoggleEdit
function that checks for unsaved changes inlocalStorage
.comment.js
andreply.js
to use the new reusable component.storageKeyPrefix
tocomment-edit.js
to properly track form changesScreenshots
2025-10-01-18-08-22.mp4
Additional Context
The implementation follows the exact same pattern used in
reply.js
to maintain consistency.the confirmation logic is handled at the parent component level
comment.js
This implementation DOES NOT fix the multi-tab problem highlighted by @adlai, a broader refactor of the editing system would be needed, which goes beyond the scope of this issue.
Checklist
Are your changes backward compatible? Please answer below:
Yes
On a scale of 1-10 how well and how have you QA'd this change and any features it might affect? Please answer below:
7/10
For frontend changes: Tested on mobile, light and dark mode? Please answer below:
NaN
Did you introduce any new environment variables? If so, call them out explicitly here:
No
Did you use AI for this? If so, how much did it assist you?
I used AI to analyze the existing codebase and find interested files
Note
Cursor Bugbot is generating a summary for commit c4b2bd6. Configure here.