-
-
Notifications
You must be signed in to change notification settings - Fork 431
Save dialog for closing temporary sketch and unsaved files #893
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
Conversation
f07c344
to
192b8c0
Compare
This doesn't seem to solve #595. Screen.Recording.2022-03-09.at.09.58.25.movAs you can see, no dialog appears when closing unsaved sketches, be they temporary or permanent sketches. |
I noticed another funny behaviour though. It appears that from the Menu bar there are 3 different ways of closing the IDE:
Screen.Recording.2022-03-09.at.10.18.38.mov
Notice that 2. File > Close and 3. File > Close Editor are bound to the same shortcut (CMD+W). When I use the shortcut CMD+W, the behaviour of 2. File > Close is performed. Consider also that I cannot see differences between this branch and the |
@AlbyIanna Thanks for looking into it. I'm confused, because it works as the requirements state on Windows: 2022-03-09.12-07-47.mp4The only way I can imagine this to break is if the
|
192b8c0
to
5564b91
Compare
Yes, I'll give it a try. In the meanwhile, @per1234 would you please test this on Linux? I wonder if it works there at this point. |
@msujew okay, now it gets interesting. I've just launched the IDE in debug mode and it worked (almost) perfectly. The build artifact from the CI is still broken though 🤔 |
@msujew I would suggest you try to download the build artifact produced in the GitHub workflow and see if it works on Windows. |
arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx
Outdated
Show resolved
Hide resolved
arduino-ide-extension/src/browser/dialogs/temp-sketch-dialog.ts
Outdated
Show resolved
Hide resolved
From #893 (comment):
This is tracked at #862 From #893 (comment)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RESOLVED!
I tested the latest CI build for this PR (Version: 2.0.0-rc4-snapshot-de6aa05) on Windows 10 and Ubuntu 20.04.
Unfortunately, it did not fix #595 for me:
- Select File > Preferences... from the Arduino IDE menus.
- Check the box next to "☐ Auto save".
- Click the OK button.
- Select File > New from the Arduino IDE menus.
- Make any change to the sketch.
- Use the standard window control (i.e., X or 🔴) to close the window.
🐛 The window closes without the expected confirmation of close with unsaved changes (If autosave is on, user is not prompted to "save as..." when closing a newly created sketch or edited example. #595). - Select File > New from the Arduino IDE menus.
- Make any change to the sketch.
- Select File > Quit from the Arduino IDE menus.
🐛 The window closes without the expected confirmation of close with unsaved changes (If autosave is on, user is not prompted to "save as..." when closing a newly created sketch or edited example. #595).
@msujew I downloaded the latest workflow build and now it doesn't work at all on MacOs. Have you tested the workflow build? |
@AlbyIanna downloaded the workflow build and it works as expected (on Windows) 2022-03-17.13-35-12.mp4I'll probably get to it next week, and ask some of my colleagues to test it for me. |
I'm happy to do another round of testing whenever you are ready for it. Just let me know. |
@msujew can I help somehow? |
@msujew do you have any clue why this does not work on the artifact version on mac? |
@AlbyIanna @fstasi I am making steady progress on it: It currently seems like the shutdown routine isn't called at all when using the MacOS artifact. I will change the build script a bit locally to leave more debug information in there, so that we can debug the final artifact. I'll keep you updated on that. |
0add813
to
84f033a
Compare
@per1234 @AlbyIanna I'm back from vacation and rewrote the whole feature. It should work now, even on Mac (tested with a colleague of mine). Please let me know if you find any issues with this approach. |
Hi @msujew. There was a notarization service outage yesterday which caused a spurious failure of the build workflow. Everything is back to normal today. Would you mind rebasing the PR on the |
9e96731
to
366a6de
Compare
@per1234 Oh, I didn't notice earlier. It took a bit (seems like GH Actions is still a bit slow), but the artifacts have finished building now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RESOLVED!
Describe the problem
🐛 The Arduino IDE window can not be closed.
To reproduce
- Click the standard window close control (i.e., X or 🔴) on the Arduino IDE window.
🐛 The IDE window does not close. - Select File > Close from the Arduino IDE menus.
🐛 The IDE window does not close. - Select File > Quit from the Arduino IDE menus.
🐛 The IDE windows do not close.
Expected behavior
IDE window(s) close via all the standard methods.
Arduino IDE version
2.0.0-rc6-snapshot-6f1f5e2
(tester build for 366a6de)
Operating system
Windows 10, Ubuntu 20.04
Additional context
The issue does not occur when using the build from the tip of the main
branch (522a5c6).
I see output like this in the terminal after attempting to close the window:
Marking workspace as a closed sketch. Workspace URI: file:///c%3A/Users/per/AppData/Local/Temp/.arduinoIDE-unsaved2022425-12916-3dhrhd.jb5c4/sketch_may25a. Date: 1653481012912.
@per1234 it seems like the Theia update broke the way I'm triggering the dialogs... Back to the drawing board, hopefully I'll have something by the start of next week (next two days are public holidays in Germany). |
366a6de
to
1c82e25
Compare
#862 works for me on macOS. I did the following from the sources:
|
1 similar comment
#862 works for me on macOS. I did the following from the sources:
|
@kittaakos Did you confirm this with the CI build or with a local dev instance? The last time, it didn't work when running the CI build, but building from sources worked correctly (macOS) |
There is no confirmation dialog when closing a dirty sketch. The sketch is under
|
Thanks for the heads-up, yes it was from sources so I downloaded the bundled app and kept testing that. I can confirm, from the bundled app, that the IDE2 quits without asking anything. Strange indeed, I will investigate. |
Yeah, that was an oversight. Using |
I found the problem; it's here: On my installation, the The The fix is to URI encode the |
@kittaakos Thanks! Finally, the mystery has been solved :D I'll create an issue in the Theia repo for this 👍 |
Thank you ❤️ |
Ref: eclipse-theia/theia#11226 Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Removed `electron` from the `nls-extract`. It does not contain app code. Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes #595 and #862 for me on my Windows and Linux machines.
Thanks for this important fix @msujew and @kittaakos!
* Use normal `OnWillStop` event * Align `CLOSE` command to rest of app * Fixed FS path vs encoded URL comparision when handling stop request. Ref: eclipse-theia/theia#11226 Signed-off-by: Akos Kitta <[email protected]> * Fixed the translations. Signed-off-by: Akos Kitta <[email protected]> * Fixed the translations again. Removed `electron` from the `nls-extract`. It does not contain app code. Signed-off-by: Akos Kitta <[email protected]> * Aligned the stop handler code to Theia. Signed-off-by: Akos Kitta <[email protected]> Co-authored-by: Akos Kitta <[email protected]>
* backend structure WIP * Scaffold interfaces and classes for pluggable monitors * Implement MonitorService to handle pluggable monitor lifetime * Rename WebSocketService to WebSocketProvider and uninjected it * Moved some interfaces * Changed upload settings * Enhance MonitorManager APIs * Fixed WebSocketChange event signature * Add monitor proxy functions for the frontend * Moved settings to MonitorService * Remove several unnecessary serial monitor classes * Changed how connection is handled on upload * Proxied more monitor methods to frontend * WebSocketProvider is not injectable anymore * Add generic monitor settings storaging * More serial classes removal * Remove unused file * Changed plotter contribution to use new manager proxy * Changed MonitorWidget and children to use new monitor proxy * Updated MonitorWidget to use new monitor proxy * Fix backend logger bindings * Delete unnecessary Symbol * coreClientProvider is now set when constructing MonitorService * Add missing binding * Fix `MonitorManagerProxy` DI issue * fix monitor connection * delete duplex when connection is closed * update arduino-cli to 0.22.0 * fix upload when monitor is open * add MonitorSettingsProvider interface * monitor settings provider stub * updated pseudo code * refactor monitor settings interfaces * monitor service provider singleton * add unit tests * change MonitorService providers to injectable deps * fix monitor settings client communication * refactor monitor commands protocol * use monitor settings provider properly * add settings to monitor model * add settings to monitor model * reset serial monitor when port changes * fix serial plotter opening * refine monitor connection settings * fix hanging web socket connections * add serial plotter reset command * send port to web socket clients * monitor service wait for success serial port open * fix reset loop * update serial plotter version * update arduino-cli version to 0.23.0-rc1 and regenerate grpc protocol * remove useless plotter protocol file * localize web socket errors * clean-up code * update translation file * Fix duplicated editor tabs (#1012) * Save dialog for closing temporary sketch and unsaved files (#893) * Use normal `OnWillStop` event * Align `CLOSE` command to rest of app * Fixed FS path vs encoded URL comparision when handling stop request. Ref: eclipse-theia/theia#11226 Signed-off-by: Akos Kitta <[email protected]> * Fixed the translations. Signed-off-by: Akos Kitta <[email protected]> * Fixed the translations again. Removed `electron` from the `nls-extract`. It does not contain app code. Signed-off-by: Akos Kitta <[email protected]> * Aligned the stop handler code to Theia. Signed-off-by: Akos Kitta <[email protected]> Co-authored-by: Akos Kitta <[email protected]> * fix serial monitor send line ending * refactor monitor-service poll for test/readability * localize web socket errors * update translation file * Fix duplicated editor tabs (#1012) * i18n:check rerun * Speed up IDE startup time. Signed-off-by: Akos Kitta <[email protected]> * override coreClientProvider in monitor-service * cleanup merged code Co-authored-by: Francesco Stasi <[email protected]> Co-authored-by: Silvano Cerza <[email protected]> Co-authored-by: Mark Sujew <[email protected]> Co-authored-by: David Simpson <[email protected]> Co-authored-by: Akos Kitta <[email protected]>
Motivation
Closes #595
Closes #862
Change description
When closing the app, it will check whether the current sketch is temporary and ask the user to save it somewhere else.
Other information
When disabling
autoSave
and editing a file in a temp sketch and trying to close the app, two dialogs will appear. This is an issue in upstream Theia, see eclipse-theia/theia#10860. A PR to fix this is linked.Reviewer checklist