-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow custom binary editors to opt out of auto save #115404
Comments
Throughout our custom editor discussions we explicitly wanted all custom editors to behave exactly like normal editors and that includes support for auto save as well as hot-exit. If the custom editor is not performant saving every one second, then maybe it could buffer the requests and simply delay the save to every 2s or even 5s? |
@bpasero images could take much longer than 5 seconds to save depending on the size, right now this is not an option because worker support is not there which means a save locks up the tab. You can see the webview freeze happening on a relatively small image below due to a hot exit backup: Getting web worker support in webviews (#87282), postMessage to support transferables (#115411) and control over context loss (#113705) would go a long way in making this nicer (and fixing the hot exit issue completely), but it still wouldn't fix points 2 and 3 above which are about data loss when saving an image. Some examples:
|
I have a workaround now that warns people. From release notes: Would be better to not need to do this though. Please close if it's not going to happen since I see @bpasero gave it a 👎 |
We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider. If you wonder what we are up to, please see our roadmap and issue reporting guidelines. Thanks for your understanding, and happy coding! |
I've discovered Luna Paint has some issues with auto save, I've fixed some of the problems that can be seen in the existing stable release like reloading and losing history when a save occurs and preventing operations from finishing when auto save is enabled (which doesn't feel great), but some I don't see a way forward on.
I tried to workaround this by suggesting in the readme to do something like this:
But that has several problems:
[*.png]
isn't supported to target extensions onlyMy proposal is to allow throwing or rejecting somehow during
CustomEditorProvider.saveCustomDocument
and to add an indicator on whether this was an autosave so I know which ones to respect and which to reject. That way I can support auto save for small images and/or when the image encoding is lossless, I can stop respecting auto save just like I do with hot exit.It would be ideal if auto save continued to try as well, that way for example I could reject an auto save when a "Draw Rectangle/Line", etc. action is made which doesn't commit any pixels to the image yet, and resolve the save when "Finish Rectangle/Line" happens.
The text was updated successfully, but these errors were encountered: