-
-
Notifications
You must be signed in to change notification settings - Fork 433
Open the sketchbook sidebar at the right location #912
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
3f69418
to
c8ac751
Compare
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.
I believe that's a good approach for the issue at hand. I have a minor improvement/question to make it a bit leaner.
arduino-ide-extension/src/browser/theia/core/application-shell.ts
Outdated
Show resolved
Hide resolved
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.
Issues
I tried it on Windows and Linux and encountered a few different problems:
Remote sketchbook widget is never opened on Windows
To reproduce
- Open a sketch from the "Remote Sketchbook".
🐛 The "Sketchbook" view is opened in the Left Panel of the IDE window for the opened sketch, but it has the "Local Sketchbook" widget open.
Expected behavior
The "Remote Sketchbook" widget is open in the "Sketchbook" view of the IDE window for the opened sketch, with the sketch selected.
Additional context
The problem only occurs on Windows.
It doesn't work the first time the sketch is opened
- Select File > Quit from the Arduino IDE menus if it is running.
- Delete the "User data" folder:
- Windows:
-
C:\Users\<user name>\AppData\Roaming\arduino-ide\
-
- Linux:
-
~/.config/arduino-ide/
-
- macOS:
-
~/Library/Application Support/arduino-ide/
-
- Windows:
- Start the Arduino IDE.
- Open a sketch.
🐛 The "Sketchbook" view is not opened in the Left Panel of the IDE window for the opened sketch. - Close the sketch window.
- Open the same sketch again.
🙂 The "Sketchbook" view is opened in the Left Panel of the IDE window for the opened sketch, with the sketch selected.
Expected behavior
The "Sketchbook" view behavior is always the same regardless of whether it is the first time opening the sketch.
Additional context
After that first open, it does work as expected with local sketches. If I delete the "User data" folder then the problem repeats.
Both the local and remote sketchbooks have the behavior described above for me on Linux. On Windows, remote sketchbook is not working for me even on subsequent opens of the sketch, as I described previously.
Subfolder containing Sketches in subfolders are not selected
- Create a sketch in a subfolder of your sketchbook
C:/Users/per/Documents/Arduino/ ├── FooSketch/ │ └── FooSketch.ino └── SomeSubfolder/ └── BarSketch/ └── BarSketch.ino
- Open the sketch from the subfolder of the sketchbook.
🐛 The "Sketchbook" view is opened in the Left Panel of the IDE window for the opened sketch, but the sketch is not selected:
Expected behavior
The newly opened sketch is selected in the "Sketchbook" view even if it is in a subfolder:
Enhancements
I suggest only enabling this behavior when the user opened the sketch via the "Sketchbook" view.
Opening the "Sketchbook" view in the new window after it is opened via the "Sketchbook" view is a very nice UX because it provides continuity of the UI by giving the new window the same UI state as the old one.
But if I didn't use the "Sketchbook" view to open the sketch then it is doing just the opposite. With the current behavior provided by this PR, the user who is not interested in using the "Sketchbook" view must constantly fight with the IDE in order to keep the unwanted view from occupying precious screen real estate.
…tchbook # Conflicts: # arduino-ide-extension/src/browser/arduino-ide-frontend-module.ts # arduino-ide-extension/src/browser/theia/core/application-shell.ts # arduino-ide-extension/src/browser/theia/core/shell-layout-restorer.ts # arduino-ide-extension/src/browser/utils/constants.ts # arduino-ide-extension/src/browser/widgets/cloud-sketchbook/cloud-sketchbook-composite-widget.tsx # arduino-ide-extension/src/browser/widgets/cloud-sketchbook/cloud-sketchbook-widget.ts
Closing in favor of #1102 |
Motivation
When opening a sketch, the sidebar doesn't behave as expected.
As stated in #442, this is the expected behaviour:
fixes #442
Change description
Check which sketchbook widget to show (remote or local) whenever the top-level sketchbook widget (which contains both) is opened.
https://github.com/arduino/arduino-ide/compare/active-sketchbook?expand=1#diff-34e4625218827959b97fd2f2905e68bc3c513e02fd972a65a283176d9245136aR42-R78
Also, fix a bug that occurs sometimes when opening the remote sketchbook and causes the widget to render completely empty:
https://github.com/arduino/arduino-ide/compare/active-sketchbook?expand=1#diff-70a70e54dd8a31cca611f181690c62f53f19385750d6383a5d336d6aaad82257R62-R72
Refine
setLayoutData
in application-shell.ts so that the initial layout of the left sidebar will always be set with the sketchbook container widget open.Reviewer checklist