Skip to content
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

#53 Refresh menus when opening example/recent fails. #1333

Merged
merged 1 commit into from
Oct 4, 2022
Merged

Conversation

kittaakos
Copy link
Contributor

Motivation

IDE2 must notify the user about missing/invalid sketches and update the menus when opening the sketch has failed. This is the expected behavior when opening from File > Open Recent, File > Sketchbook, and File > Examples.

Change description

Other information

Closes #53

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

@kittaakos kittaakos requested a review from AlbyIanna August 18, 2022 08:44
@kittaakos kittaakos added topic: code Related to content of the project itself status: on hold Do not proceed at this time type: imperfection Perceived defect in any part of project labels Aug 18, 2022
@kittaakos kittaakos force-pushed the #53-signed branch 2 times, most recently from 949dcce to 095c1d6 Compare September 13, 2022 12:20
@kittaakos kittaakos removed the status: on hold Do not proceed at this time label Sep 13, 2022
@kittaakos kittaakos marked this pull request as ready for review September 13, 2022 12:22
Copy link
Contributor

@AlbyIanna AlbyIanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@kittaakos
Copy link
Contributor Author

I have rebased the PR from the main. Please review it. Thank you!

@AlbyIanna
Copy link
Contributor

Still working for me ✅

Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UPDATE: resolved by https://github.com/arduino/arduino-ide/compare/c8388a78582727a0bf0b869c097714aad1fd8eca..bc85ea62d6e7b6cc80ffbe78a98f898d76ce8a76

Describe the problem

File > New has no effect.

To reproduce

  1. Select File > New from the Arduino IDE menus.

🐛 Nothing at all happens.

Expected behavior

A new sketch opens in an additional Arduino IDE window after selecting File > New

Arduino IDE version

2.0.1-snapshot-0359e42 (tester build for 0359e42)

Operating system

Windows, Linux

Operating system version

Windows 10, Ubuntu 20.04

Additional context

The problem does not occur when using the latest build from the main branch (2.0.1-snapshot-96cf09d)

Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UPDATE: resolved by https://github.com/arduino/arduino-ide/compare/c8388a78582727a0bf0b869c097714aad1fd8eca..bc85ea62d6e7b6cc80ffbe78a98f898d76ce8a76

Describe the problem

IDE fails to start if no sketch was opened previously.

To reproduce

  1. Select File > Quit from the Arduino IDE menus if it is running.
  2. Rename or delete (:warning: cautiously) the following folders to simulate the environment of a first run:
    • Windows:
      C:\Users\<username>\.arduinoIDE
      
      C:\Users\<user name>\AppData\Roaming\arduino-ide
      
    • Linux:
      ~/.arduinoIDE
      
      ~/.config/arduino-ide
      
    • macOS:
      ~/.arduinoIDE
      
      ~/Library/Application Support/arduino-ide
      
  3. Start the build of the Arduino IDE for this PR.
    🐛 The IDE hangs forever at the startup animation.
  4. Close the Arduino IDE window.
  5. Start a previous version (e.g., 2.0.0) of the Arduino IDE 2.x.
  6. Select File > Save As... from the Arduino IDE menus.
    This is done to cause a previously open sketch to be recorded for restoration the next time the IDE is opened. You could do the same by opening any previously saved sketch.
  7. Select File > Quit from the Arduino IDE menus.
  8. Start the build of the Arduino IDE for this PR.
    🙂 The IDE startup finishes.

Expected behavior

Arduino IDE starts even when there is no previously opened sketch.

Arduino IDE version

2.0.1-snapshot-0359e42 (tester build for 0359e42)

Operating system

Windows, Linux

Operating system version

Windows 10, Ubuntu 20.04

Additional context

The problem does not occur when using the latest build from the main branch (2.0.1-snapshot-96cf09d)

@kittaakos
Copy link
Contributor Author

Thank you for the review, Per. I have fixed the bug with the new sketch creation; it should solve both issues you had during the verification.

Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Describe the problem

File > Open Recent never populates if no sketch was opened previously.

To reproduce

  1. Select File > Quit from the Arduino IDE menus if it is running.
  2. Rename or delete (:warning: cautiously) the configuration folder to adequately simulate the environment of a first run:
    • Windows:
      C:\Users\<username>\.arduinoIDE
      
    • Linux:
      ~/.arduinoIDE
      
    • macOS:
      ~/.arduinoIDE
      
  3. Start the build of the Arduino IDE for this PR.
  4. Select File > Save As... from the Arduino IDE menus.
  5. Save the sketch to any convenient name and location.
  6. Open the File menu.
    🐛 There is no Open Recent menu item
  7. Select File > Quit from the Arduino IDE menus.
  8. Start a previous version (e.g., 2.0.0) of Arduino IDE 2.x.
  9. Open the File menu.
    🙂 There is an "Open Recent" menu item
  10. Select File > Quit from the Arduino IDE menus.
  11. Start the build of the Arduino IDE for this PR.
  12. Open the File menu.
    🙂 There is an "Open Recent" menu item

Expected behavior

File > Open Recent menu is populated with the recently opened sketch.

Arduino IDE version

2.0.1-snapshot-6888b6c (tester build for bc85ea6)

Operating system

Windows, Linux

Operating system version

Windows 10, Ubuntu 20.04

Additional context

The problem does not occur when using the ~latest build from the main branch (2.0.1-snapshot-96cf09d)

@kittaakos
Copy link
Contributor Author

  • Start the build of the Arduino IDE for this PR.
  • Select File > Save As... from the Arduino IDE menus.

After wiping the config folder and starting the IDE2, would you expect to see File > Open Recent > Foo, assuming that the Foo sketch was the last IDE2 restored? Thank you!

@per1234
Copy link
Contributor

per1234 commented Sep 28, 2022

would you expect to see File > Open Recent > Foo, assuming that the Foo sketch was the last IDE2 restored?

No, but I also wouldn't be surprised to see that, so either way is fine. I only expect that any sketches I open after that to be added to the menu.

@kittaakos
Copy link
Contributor Author

I also wouldn't be surprised to see that, so either way is fine

Thank you!

IDE2 will show it. Steps to reproduce:

  • Open IDE2, create a sketch, and save it to Sketchbook, File > Quit the app,
  • Wipe ~/.arduinoIDE/recent-sketches.json (or rename it),
  • Start IDE2. If IDE2 could restore a non-temp sketch, the File > Open Recent should contain the corresponding submenu item.

I fixed another use case. It wasn't working. Steps:

  • Open IDE2, open 3-4 valid sketches from the Sketchbook, File > Quit the app,
  • Wipe ~/.arduinoIDE/recent-sketches.json (or rename it),
  • Start IDE2. IDE2 should restore all previously opened sketches. Go to File > Quit > all opened sketches must have a corresponding submenu item.

Thank you so much for doing the PR review, again and again, Per. All issues you have noticed during the verification should be fixed now.

Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is working perfectly for me now.

Thanks for this very nice improvement to the user experience Akos!

@kittaakos kittaakos merged commit da22f1e into main Oct 4, 2022
@kittaakos kittaakos deleted the #53-signed branch October 4, 2022 06:10
@per1234 per1234 mentioned this pull request Oct 28, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attempt to open deleted sketch from Sketchbook or Examples menus fails silently
3 participants