arduino / arduino-ide

Arduino IDE 2.x
https://www.arduino.cc/en/software
GNU Affero General Public License v3.0
2.28k stars 388 forks source link

Pressing "Upload" button while compiling will give a technical error message #1299

Open Lorandil opened 2 years ago

Lorandil commented 2 years ago

Describe the problem

Hi all,

great work so far :) I found an imperfection which might confuse a beginner:

To reproduce

The error message reads:

arduino-verify-sketch

Expected behavior

The best solution would be to disabled all buttons that are not valid at a given time. The second best would be to produce a helpful error message.

Arduino IDE version

Arduino IDE 2.0.0-rc9.1

Operating system

Windows

Operating system version

10 21H2

Additional context

No response

Issue checklist

kittaakos commented 1 year ago

The best solution would be to disabled all buttons that are not valid at a given time.

What are the valid and invalid commands when another command is running, @per1234? Could you please help?

Does IDE2 want...

Please let me know if you have any other ideas on refining the enablement of the commands (verify, upload, monitor, firmware uploader, etc.?).

Thank you!

per1234 commented 1 year ago

@kittaakos from a usability standpoint, I don't think there is a reason to prevent any of these actions when another is in progress. So I would only disable them if there is a technical reason why it is not possible for Arduino IDE to handle it.

to disable upload when the user clicks on verify?

As a user, my expectation would be that if I initiate an "Upload" operation (by clicking the button, Sketch > Upload, or keyboard shortcut) while a "Verify/Compile" operation is in progress, Arduino IDE would cancel the in progress "Verify/Compile" operation and start an "Upload" operation.

Canceling the process (related: https://github.com/arduino/arduino-ide/issues/1199) might be challenging, so an alternative reasonable behavior would be for the IDE to wait until the in-progress "Verify/Compile" operation finishes and then start the queued "Upload" operation.

But I also don't think the ability for the user to trigger an "Upload" operation while a "Verify/Compile" operation is in progress is very important, so I think it is perfectly fine to disable the triggering of an "Upload" operation while "Verify/Compile" operation is in progress if that is easier to implement. My main goal would be to find an easy way for the IDE to handle this condition more gracefully than it is now (though even the current behavior is already reasonably user friendly).

  • to disable the monitor/plotter when an upload is in progress?
  • to disable the monitor/plotter when the verify part of an upload is running?

I think it is a bad idea. This is a common use pattern (the user is anticipating the serial output from the sketch after uploading and getting the monitor set up while waiting for the upload to finish) and as far as I know the IDE already handles these conditions perfectly.

firmware uploader

I suspect it is possible to experience a failed firmware update if the user attempts one while an upload is in progress, but I think it is very unlikely to occur because the timing is pretty tight. I think the user would just try the firmware update again and it would be successful the second time. So I wouldn't bother with this unless we see real world evidence it is needed.