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

feat: introduced cloud states #1901

Merged
merged 1 commit into from
Mar 16, 2023
Merged

feat: introduced cloud states #1901

merged 1 commit into from
Mar 16, 2023

Conversation

kittaakos
Copy link
Contributor

@kittaakos kittaakos commented Feb 21, 2023

Motivation

Please reference the internal slides regarding the expected behavior.

editor_toolbar.mp4
offline.mp4
copy-to-cloud.mp4
cloud_prefix.mp4

Change description

  • New UX for the sketchbook,
  • Show [Cloud] prefix in the window title,
  • Pull/push sketch from the editor toolbar, and
  • Create a cloud copy of the local sketch.

Other information

Closes #1879
Closes #1876
Closes #1899
Closes #1878

This PR includes 3f5eddb from #1910.

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 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Feb 21, 2023
@kittaakos kittaakos self-assigned this Feb 21, 2023
@kittaakos kittaakos changed the base branch from #1879 to main February 23, 2023 14:03
@kittaakos kittaakos changed the title feat: pull/push cloud sketch from the tab toolbar feat: introduced cloud states Feb 24, 2023
@kittaakos kittaakos marked this pull request as ready for review February 24, 2023 09:45
@AlbyIanna
Copy link
Contributor

AlbyIanna commented Mar 1, 2023

I've stumbled in an edge case that resulted in having a broken cloud user icon and an empty cloud sketchbook. Steps to reproduce:

  • make sure your internet connection is ON
  • sign in to cloud from the cloud sketchbook
  • make sure you have pulled at least one sketch (e.g.: sketch_A)
  • turn OFF your internet connection
  • open a sketch from the cloud sketchbook that you already had pulled (e.g. sketch_A)
  • a new sketch window opens showing the cloud sketch
  • 🐛 in the left sidebar, the user image is broken (I guess we should have a default image to show when we can't show the actual user image)
  • 🐛 the cloud sketchbook is empty
Here's a recording
Screen.Recording.2023-03-01.at.15.51.36.mov

I'm not sure what the expected behaviour should be here. If possible I guess we should load the cloud sketchbook in the same state as it is in the current window, but I'm not sure we can do that.

@kittaakos thoughts?

UPDATE:
I went a little further and turned back on the internet connection and this is the result:

another recording:
Screen.Recording.2023-03-01.at.16.16.34.mov

As you can see, when the connection comes back, the situation doesn't change. Clicking on the "Refresh" button will have the cloud sketchbook loaded, but the user image will still remain unavailable.

@AlbyIanna
Copy link
Contributor

Another thing I stumbled into, but I'm not sure it's an unexpected behaviour or if I am missing something about the expected behaviour:

In the following 2 screen recordings, I'm pushing sketches from my local sketchbook to the cloud sketchbook.

The first one results in a different behaviour from the the second one, asking for user's confirmation before pushing the sketch, and after that opening the pushed sketch in a new window.

screen recording 1
confirm.push.mov

The second one doesn't ask for confirmation and doesn't open the sketch in a new window:

screen recording 2
push.no.confirm.mov

I'm not sure about the confirmation message, but in the second recording I think it's expected to open the pushed sketch in a new window.

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.

Thank you @kittaakos for this! Overall quality of the code is outstanding, as always.

I just left some of comments that in my opinion could improve the readability. Let me know what you think about them. I didn't request changes because they're not blocking.

Apart from those, I also left a couple of comments about unexpected behaviour.

@kittaakos
Copy link
Contributor Author

  • 🐛 in the left sidebar, the user image is broken (I guess we should have a default image to show when we can't show the actual user image)

I added a patch and the default account codicon is visible when loading the avatar has failed.

@kittaakos kittaakos force-pushed the #1899 branch 2 times, most recently from d4a4e11 to 25665d8 Compare March 10, 2023 10:47
@kittaakos
Copy link
Contributor Author

kittaakos commented Mar 10, 2023

I'm not sure about the confirmation message, but in the second recording I think it's expected to open the pushed sketch in a new window.

Thanks! I could reproduce it when creating a cloud copy without renaming the local sketch. The problem was in ncp, so I switched to a new lib and added a few tests.

Update:

Cross-link from the Arduino forum: https://forum.arduino.cc/t/new-ide-inst-saving-files-correctly/1122494/9

@kittaakos
Copy link
Contributor Author

@91volt, can you please help with the review? Thanks!

@AlbyIanna
Copy link
Contributor

Thank you @kittaakos for addressing my comments.

I performed another run of tests and these are the results:

  • ✅ this is fixed (now it always asks for confirmation before pushing a sketch)

    In the following 2 screen recordings, I'm pushing sketches from my local sketchbook to the cloud sketchbook.
    The first one results in a different behaviour from the the second one, asking for user's confirmation before pushing the sketch, and after that opening the pushed sketch in a new window.
    The second one doesn't ask for confirmation and doesn't open the sketch in a new window:

  • ✅ this is fixed

    🐛 in the left sidebar, the user image is broken (I guess we should have a default image to show when we can't show the actual user image)

  • ❌ this is still happening

    🐛 the cloud sketchbook is empty

@kittaakos
Copy link
Contributor Author

Thanks for the review!

  • ❌ this is still happening

    🐛 the cloud sketchbook is empty

Clicking on the "Refresh" button will have the cloud sketchbook loaded, but the user image will still remain unavailable.

I expected it would be OK. What is your expectation?

@91volt
Copy link

91volt commented Mar 10, 2023

✅ this is fixed (now it always asks for confirmation before pushing a sketch)

I suggest removing the confirmation prompt when copying a sketch to the cloud, as it may cause confusion for the user since there is no existing sketch being overwritten. Additionally, both options currently result in the same outcome.

About this:

🐛 the cloud sketchbook is empty

Clicking on the "Refresh" button will have the cloud sketchbook loaded.

I expected it would be OK. What is your expectation?

Ideally, this glitch wouldn't exist at all, or the sketchbook would be refreshed automatically in such cases. If fixing it now is time-consuming, we could consider publishing a separate fix for this bug since it is not critical for the general purpose of this feature in my opinion.

@AlbyIanna
Copy link
Contributor

Clicking on the "Refresh" button will have the cloud sketchbook loaded, but the user image will still remain unavailable.

I expected it would be OK. What is your expectation?

About this, I agree with the last comment from @91volt ⬇️

Ideally, this glitch wouldn't exist at all, or the sketchbook would be refreshed automatically in such cases. If fixing it now is time-consuming, we could consider publishing a separate fix for this bug since it is not critical for the general purpose of this feature in my opinion.

@AlbyIanna
Copy link
Contributor

I suggest removing the confirmation prompt when copying a sketch to the cloud, as it may cause confusion for the user since there is no existing sketch being overwritten. Additionally, both options currently result in the same outcome.

I too was thinking it would be a good idea to remove it. In the end, it's not possible to push a local sketch if it already exists in the cloud, therefore it doesn't make much sense to warn the user saying that "Pushing this Sketch will overwrite its Cloud version."

@kittaakos
Copy link
Contributor Author

kittaakos commented Mar 10, 2023

  • ❌ this is still happening

    🐛 the cloud sketchbook is empty

Thanks! I fixed it

1899.mp4

as it may cause confusion for the user since there is no existing sketch being overwritten.

Technically, there is. There is no such thing as create a sketch with these files endpoint. IDE2 has to create a default one and push the local files, so it's not an atomic operation. I tame IDE2 to ignore the arduino.cloud.push.warn preference for this use case.


Update

I tame IDE2 to ignore the arduino.cloud.push.warn preference for this use case.

It's done ✅

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.

🟢 Green light for me!

Thank you Akos!

Closes #1879
Closes #1876
Closes #1899
Closes #1878

Signed-off-by: Akos Kitta <[email protected]>
@kittaakos
Copy link
Contributor Author

Thanks to all of you for the excellent reviews.

@kittaakos kittaakos merged commit 0ab2826 into main Mar 16, 2023
@kittaakos kittaakos deleted the #1899 branch March 16, 2023 09:00
@per1234 per1234 added the topic: cloud Related to Arduino Cloud and cloud sketches label Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: cloud Related to Arduino Cloud and cloud sketches topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
4 participants