Skip to content

Conversation

pory-gone
Copy link
Contributor

@pory-gone pory-gone commented Oct 1, 2025

Description

fix #2568

Implemented confirmation prompt when canceling comment edit.

  • Created reusable ConfirmModal component with presets for different confirmation types.
  • Added confirmation modal logic to comment.js eoggleEdit function that checks for unsaved changes in localStorage.
  • Updated both comment.js and reply.js to use the new reusable component.
  • Added storageKeyPrefix to comment-edit.js to properly track form changes

Screenshots

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.

@pory-gone pory-gone marked this pull request as ready for review October 1, 2025 16:55
@adlai
Copy link

adlai commented Oct 2, 2025

Thank you for the shout-out; and was my own limited human bafflement by the nightmare of modern client-side HTML5 codebases helpful in any way, given that you also had an AI tool review the entire codebase?

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.

Cancel on edit does not prompt for confirmation
2 participants