-
-
Notifications
You must be signed in to change notification settings - Fork 397
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
#1089: IDE falls back to new sketch if opening failed #1152
Conversation
arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx
Outdated
Show resolved
Hide resolved
arduino-ide-extension/src/common/protocol/sketches-service-client-impl.ts
Outdated
Show resolved
Hide resolved
50cfe0d
to
1da6d7c
Compare
If IDE has the changes from arduino/arduino-cli#1805, then the error message will be the same for all three use-cases this PR covers: Please let me know if we need arduino/arduino-cli#1805 as-is for this PR. |
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.
There are two distinct reasons the IDE might attempt to open a sketch:
- Explicit action by user (e.g., selecting a sketch from File > Sketchbook)
- Restore state from previous session (Restore open sketches on startup #780)
The IDE must gracefully handle a failure of either operation (#1089). However, I feel the need to communicate about the failure to the user differs between them.
If an operation triggered explicitly by the user fails, it is important to communicate this to the user. So I think showing a notification when the sketch opening fails is necessary in this case.
The situation is different when it comes to automatically opening sketches from the previous IDE session. This is only a convenience feature. If it is able to open the sketches, great. But if it is not able to open the sketches, I don't want to hear about it. I might have intentionally deleted that sketch. It might have been a new sketch that was staged in a temporary folder the OS cleaned up. In the latter case, the temporary path makes the error message especially cryptic:
So I suggest that no error notification be shown when the sketch opening fails during the restore operation (logging it is fine of course).
Thank you for the review!
Sure 👍 IDE2 (and the CLI) might fail to load the sketch due to two reasons:
As a user, do you expect that IDE2 will omit the error notification in both cases? |
In the case of a "restore" operation, yes. |
I have updated the PR not to show the error notification when restoring the previously opened sketch has failed (due to a missing or invalid sketch). I updated the screencasts too to show the expected IDE behavior. Please review. |
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.
It works perfectly. Excellent work Akos!
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.
LGTM.
I left some comments, but nothing important.
@inject(FrontendApplicationStateService) | ||
private readonly appStateService: FrontendApplicationStateService; | ||
|
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.
Since you're doing some clean-up, what do you think about making this class extend Contribution
so that we can get rid of some injected services (ILogger, MessageService, CommandService, FrontendApplicationStateService) and make use of the onReady
method?
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.
Good idea, but I do not want to introduce a hard dependency between contributions. Also, this service does not contribute any commands, menu items, .etc.
arduino-ide-extension/src/browser/contributions/first-start-installer.ts
Outdated
Show resolved
Hide resolved
Closes #1089 Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Closes #1067. Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]> #1067
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Signed-off-by: Akos Kitta <[email protected]>
Motivation
IDE must automatically open a new sketch (in the temp folder) if the sketch was deleted between the IDE stop/start cycle.
Requirements:
(
sketch_2
andsketch_3
have the same content assketch_1
).Preconditions:
sketch_1
is not loaded, opensketch_1
,sketch_1
is the only opened sketch in IDE the verification can start.1: Opening deleted sketch from
File
>Sketchbook
Sketchbook
submenu content.File
>Sketchbook
,sketch_3
is there,sketch_3
outside from IDE,File
>Sketchbook
>sketch_3
,File
>Sketchbook
,sketch_3
is not there.open_deleted_from_menu.mp4
sketch_1
in IDE,sketch_1
from the sketchbook,restore_deleted_sketch_on_start.mp4
sketch_2
in IDE,sketch_2/sketch_2.ino
,restotre_invalid_sketch_on_start.mp4
Change description
Other information
Closes #1089
Breaking: Optimize for Debugging now has its preference:
arduino.compile.optimizeForDebug
. The default value isfalse
. If you had Optimize for Debugging enabled before this IDE version, you must click on Optimized for Debugging again.Breaking: Changed
arduino.cloud.sketchSyncEnpoint
toarduino.cloud.sketchSyncEndpoint
(#1067). If you had a custom sketch sync endpoint defined, you must redefine it again with the version of the IDE.IDE uses the default spinner from Theia:
default_theia_spinner.mp4
Reviewer checklist