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

#1016, #1274 Aligned the "Save your sketch" dialog behavior #1351

Merged
merged 13 commits into from
Aug 26, 2022
Merged

Conversation

kittaakos
Copy link
Contributor

@kittaakos kittaakos commented Aug 24, 2022

Motivation

Change description

Other information

Closes #1016
Closes #1274
Closes #1026
Closes #660
Closes #1034
Closes #994

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 changed the title #1016, #1274 Aligned the "Save your sketch" dialog behavior. #1016, #1274 Aligned the "Save your sketch" dialog behavior Aug 24, 2022
@kittaakos kittaakos added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Aug 24, 2022
@per1234 per1234 linked an issue Aug 26, 2022 that may be closed by this pull request
3 tasks
@ubidefeo
Copy link

@kittaakos
I have found that when launching this build the automatically opened sketch is the first one listed in my Sketchbook.
The last one I had opened was an example (which I did not save, of course).
In case no previously open sketch is available to open again, it should do as IDE 1.x does: open a new Sketch

@kittaakos
Copy link
Contributor Author

this build the automatically opened sketch is the first one listed in my Sketchbook.
In case no previously open sketch is available

@ubidefeo, but there is a sketch to open 👆 , the first one from the Sketchbook. If you delete ~/.arduinoIDE/recent-sketches.json and ~/.arduinoIDE/recentworkspace.json, the IDE2 should open a new temp sketch.

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

Sketch tab becomes closable after rename.

To reproduce

  1. Click the ●●● icon on the right side of the editor toolbar.
  2. Select "New Tab" from the menu.
  3. In the "Name for new file" field, type foo
  4. Click the OK button.
    🙂 The "foo.ino" tab does not have an X icon.
  5. Click the ●●● icon on the right side of the editor toolbar.
  6. Select "Rename" from the menu.
  7. In the "New name for file" field, type bar.ino
    🐛 The "bar.ino" tab has an X icon.

image

Arduino IDE version

2.0.0-rc9.2.snapshot-948a6ed (tester build for 9a2d13f)

Operating system

Windows 10

@kittaakos
Copy link
Contributor Author

kittaakos commented Aug 26, 2022

The last one I had opened was an example (which I did not save, of course).
In case no previously open sketch is available to open again, it should do as IDE 1.x does: open a new Sketch

I have tried it, and the IDE (1.x) opens the example. Steps to reproduce:

  • Open IDE (1.x),
  • Open an example (I picked the File > Examples > 01. Basic > AnalogReadSerial),
  • Close all other sketches if you have any but the AnalogReadSerial,
  • Quit the IDE (1.x),
  • Open the IDE (1.x),
  • You have the AnalogReadSerial sketch opened.

The IDE2 never behaved like this 👆 .

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

Regression of #831

Closability of tabs for files in the src subfolder was lost.

To reproduce

  1. Put this "HasSrcFolder" sketch to your sketchbook: HasSrcFolder.zip
  2. Open the "HasSrcFolder" sketch in the Arduino IDE.
  3. Select File > Preferences... from the Arduino IDE menus.
  4. Check the box next to "☐ Show files inside Sketches".
  5. Click the OK button.
  6. Open the "Sketchbook" view.
  7. Click on HasSrcFolder/src/InSrcFolder.cpp
    🐛 There is no X icon on the InSrcFolder.cpp tab.

image

Expected behavior

Tabs for files in the src subfolder are closable, as is the behavior of the IDE build from the main branch:

image

Arduino IDE version

2.0.0-rc9.2.snapshot-948a6ed (tester build for 9a2d13f)

Operating system

Windows 10

Additional context

See #831 for details on why closability of these files specifically is needed.

See #946 for the original code change that enabled this closability.

@ubidefeo
Copy link

@kittaakos
I checked and there's a misalignment of behaviour.
IDE 1.x still allows you to have the app open without any workspaces.
If you close the example (not quitting the IDE) so that no windows are open, once you quit the IDE and relaunch it you get a new sketch.
I think opening anything that was available at quit is a good behaviour, but if nothing was then it should not pick the first sketch from the sketchbook but rather create a new sketch

@per1234
Copy link
Contributor

per1234 commented Aug 26, 2022

IDE 1.x still allows you to have the app open without any workspaces.

Is this behavior specific to macOS @ubidefeo? #487

@kittaakos
Copy link
Contributor Author

7. In the "New name for file" field, type bar.ino
🐛 The "bar.ino" tab has an X icon.

Closability of tabs for files in the src subfolder was lost.

Thank you for the steps, Per. Both issues should be fixed now.

Akos Kitta added 13 commits August 26, 2022 12:18
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
and then the window.

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Closes #660

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Closes #1034.

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Copy link
Contributor

@per1234 per1234 left a comment

@kittaakos kittaakos marked this pull request as ready for review August 26, 2022 11:47
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
4 participants