-
-
Notifications
You must be signed in to change notification settings - Fork 489
feat: rename, deletion, and validation support #1833
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
a19b864
to
84e9ea3
Compare
There is another bug with the server. When IDE2 tries to rename a non-existing sketch via the POST /create/v3/files/mv
endpoint, IDE2 expects an HTTP 404 (Not found), but the server fails with HTTP 500. IDE2 has no chance to handle it.
8804332
to
31cc604
Compare
(削除) bug (削除ここまで) ✅ 38e0806 + b5be42a
must-set-focus-in-editor-after-rename.mp4
Upstream: eclipse-theia/theia#12139
(削除) When deleting the sketch, the window closes, but the sketch is not cleaned up from the filesystem. (On Windows) (削除ここまで)
Update: hacked in 743c9bf
(削除) when IDE2 prompts a save as
to repair the sketch folder name, it should propose a valid name. (削除ここまで)
5b7a045
to
0e6c19f
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.
Should "cloud" be capitalized?
I'm not a fan of the recent trend I've observed of sometimes capitalizing "sketch" in sentences, since that is not a proper noun, but if "cloud" is short for the "Arduino Cloud" service (as opposed to being a reference to the general concept of "the cloud"), then this is a proper noun and so should be capitalized.
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.
Should "cloud" be capitalized?
I will leave this decision to you. Whichever you think is the best.
the recent trend I've observed of sometimes capitalizing "sketch" in sentences
I found the following translations from this PR where the "sketch" is capitalized in a sentence. (I hope I did not leave out anything):
These have not changed in this PR or recently:
arduino-ide/arduino-ide-extension/src/browser/widgets/cloud-sketchbook/cloud-sketchbook-tree.ts
Line 107 in 9a3b107
arduino-ide/arduino-ide-extension/src/browser/dialogs/cloud-share-sketch-dialog.tsx
Line 66 in 9a3b107
arduino-ide/arduino-ide-extension/src/browser/dialogs/cloud-share-sketch-dialog.tsx
Line 75 in 9a3b107
arduino-ide/arduino-ide-extension/src/browser/dialogs/cloud-share-sketch-dialog.tsx
Line 86 in 9a3b107
arduino-ide/arduino-ide-extension/src/browser/widgets/cloud-sketchbook/cloud-sketchbook-tree.ts
Line 70 in 9a3b107
Line 187 in 9a3b107
These have not changed, and the sentence starts with "sketch":
These are command or menu labels, so capitalized "sketch" is expected:
Line 59 in 9a3b107
arduino-ide/arduino-ide-extension/src/browser/contributions/open-sketch-external.ts
Line 25 in 9a3b107
arduino-ide/arduino-ide-extension/src/browser/widgets/sketchbook/sketchbook-commands.ts
Line 15 in 9a3b107
Line 78 in 9a3b107
Line 87 in 9a3b107
arduino-ide/arduino-ide-extension/src/browser/widgets/sketchbook/sketchbook-composite-widget.tsx
Line 84 in 9a3b107
Line 217 in 9a3b107
These are new and were requested in the design doc:
arduino-ide/arduino-ide-extension/src/browser/contributions/rename-cloud-sketch.ts
Line 85 in 9a3b107
Let me know what to do. Thanks!
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 will leave this decision to you. Whichever you think is the best.
I surveyed the Arduino Cloud-related content on arduino.cc and found that "Cloud" is capitalized in contexts equivalent to "Cloud sketch". So I think it should be capitalized.
the sentence starts with "sketch":
These are command or menu labels, so capitalized "sketch" is expected:
Yes, in cases where the work occurs at the start of a sentence or contexts where the standard for capitalization style is "title case", there is no question that "Sketch" is correct.
These are new and were requested in the design doc:
Then I guess I would have to request the input of the designers.
@91volt @gmarchiarduino please provide clear rules for when "sketch" should and should not be capitalized. As I've said several times in the past, it would be very helpful to have this sort of thing documented in a style guide.
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.
This part is something I cannot control, so I moved it to its dedicated task: #1884.
arduino-ide-extension/src/browser/theia/workspace/workspace-commands.ts
Outdated
Show resolved
Hide resolved
0e6c19f
to
9a3b107
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.
UPDATE: Fixed by fef3b6a
Cloud sketch can be created with Windows-incompatible trailing .
Do not end a file or directory name with a space or a period. Although the underlying file system may support such names, the Windows shell and user interface does not.
When creating/renaming local sketches, Arduino IDE automatically removes a trailing .
if the user adds one, but this is not done when creating/renaming Cloud sketches.
To reproduce
- Start the IDE build from this PR on a Windows machine.
- Select File > New Cloud Sketch from the Arduino IDE menus.
- Type
EndsWithDot.
in the sketch name field. - Click the "OK" button.
🐛 Multiple errors notifications and a spurious sketch name mismatch dialog appear:
image - Click the "OK" button on the dialog.
🐛 The sketch fails to open. - Open the EndsWithDot. sketch from the Cloud sketchbook.
🐛 The sketch fails to open.
Arduino IDE version
bf6c814 (tester build for 9687fc6)
Operating system
Windows
Operating system version
11
Great review!
Arduino IDE automatically removes a trailing
.
if the user adds one
I was surprised because there is no such logic in IDE2. It turned out, the OS is cutting this, not IDE2. Please take a look at the attached screencast. Electron's native file dialog does it on save:
os_trims_the_dot.mp4
When using the CLI:
c:\Users\kittaakos\Desktop\sketchbooks>arduino-cli.exe version
arduino-cli.exe Version: 0.30.0 Commit: 83700ca2 Date: 2023年02月08日T14:48:15Z
c:\Users\kittaakos\Desktop\sketchbooks>arduino-cli.exe sketch new endswithdot.
Sketch created in: c:\Users\kittaakos\Desktop\sketchbooks\endswithdot
Doing with mkdir
from CMD.EXE
:
c:\Users\kittaakos\Desktop\sketchbooks\test>mkdir test.
c:\Users\kittaakos\Desktop\sketchbooks\test>dir
Volume in drive C has no label.
Volume Serial Number is 04F3-13CC
Directory of c:\Users\kittaakos\Desktop\sketchbooks\test
02/09/2023 10:16 AM <DIR> .
02/09/2023 10:16 AM <DIR> ..
02/09/2023 10:16 AM <DIR> test
0 File(s) 0 bytes
3 Dir(s) 215,877,074,944 bytes free
b9e9ae9
to
bec6e92
Compare
arduino-ide-extension/src/browser/contributions/save-as-sketch.ts
Outdated
Show resolved
Hide resolved
arduino-ide-extension/src/browser/contributions/save-as-sketch.ts
Outdated
Show resolved
Hide resolved
arduino-ide-extension/src/browser/contributions/save-as-sketch.ts
Outdated
Show resolved
Hide resolved
048f452
to
adf3dcf
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.
Very excellent work. Thanks Akos!
Uh oh!
There was an error while loading. Please reload this page.
Motivation
remote
tocloud
sketch in the UI.Change description
Other information
Closes #1599
Closes #1825
Closes #649
Closes #1847
Closes #1882
Ref #1826 (partially fixes)
Reviewer checklist