这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@srini-abhiram
Copy link
Contributor

Description
This PR prevents accidental data loss in the file editor by introducing a confirmation prompt when a user tries to exit with unsaved changes. Currently, a user can edit a file and close the tab or navigate away without any warning, causing all modifications to be permanently lost.

This change implements the behavior suggested in issue #1241.

Now, the editor tracks if the content has been modified. If a user with unsaved changes attempts to leave the page, a confirmation dialog will appear, asking if they want to save their work before exiting.

Additional Details
Adds isDirty flag to track unsaved changes in the editor. Prompts the user to save changes before unmounting if there are unsaved edits. Refactors usage of req to originalReq for state synchronization and saving.

Adds isDirty flag to track unsaved changes in the editor. Prompts the user to save changes before unmounting if there are unsaved edits. Refactors usage of req to originalReq for state synchronization and saving.
@gtsteffaniak
Copy link
Owner

looks like a solid change! will test and merge if all looks good.

@gtsteffaniak
Copy link
Owner

ah uses the browser's alert to do the change. That needs cleaning up, but i can do that in a dev branch.

@gtsteffaniak gtsteffaniak changed the base branch from main to dev/v0.8.9 October 7, 2025 19:45
@gtsteffaniak gtsteffaniak merged commit 739b8f6 into gtsteffaniak:dev/v0.8.9 Oct 7, 2025
17 checks passed
@srini-abhiram
Copy link
Contributor Author

srini-abhiram commented Oct 8, 2025

I can change to notifications instead of browser API. Is there a package already being used for notifications? @gtsteffaniak

@gtsteffaniak gtsteffaniak mentioned this pull request Oct 17, 2025
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.

2 participants