onlook icon indicating copy to clipboard operation
onlook copied to clipboard

fix: add prompt to save changes when closing an edited file

Open Nithishvb opened this issue 5 months ago • 1 comments

Description

Related Issues

Closes: #2070

Type of Change

  • [x] Bug fix
  • [ ] New feature
  • [ ] Documentation update
  • [ ] Release
  • [ ] Refactor
  • [ ] Other (please describe):

Testing

Screenshots (if applicable)

Additional Notes


[!IMPORTANT] Adds prompt to save or discard changes when closing an edited file, with state management and function updates in index.tsx and IDEManager.

  • Behavior:
    • Adds prompt to save or discard changes when closing an edited file in index.tsx.
    • Handles unsaved changes when closing all files.
  • State Management:
    • Introduces showUnsavedDialog and pendingCloseAll state variables in index.tsx.
  • Functions:
    • Adds discardChanges() in index.tsx to discard unsaved changes.
    • Updates closeFile() and closeAllFiles() in index.tsx to handle unsaved changes.
    • Adds discardFileChanges() in IDEManager in index.ts to reset file content and dirty state.

This description was created by Ellipsis for 45cb182b2dc3b081e54c0d7c3d4a25e44c952b80. You can customize this summary. It will automatically update as commits are pushed.

Nithishvb avatar Jun 05 '25 20:06 Nithishvb