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: icon for cloud sketch in File > Open Recent #1868

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

kittaakos
Copy link
Contributor

@kittaakos kittaakos commented Feb 8, 2023

Depends on #1833

Motivation

As asked for in #1826, IDE2 would like to show an icon for cloud sketches in File > Open Recent.

This is just the infrastructure and an example of how IDE2 can render a custom image for a menu item. The images are missing from the PR. Here is the documentation of supported native image formats. If IDE2 wants to dispatch images on the selected theme, I am happy to update the PR.

Screen Shot 2023-02-08 at 14 33 58

Source of my example cloud image: https://imagensemoldes.com.br/wp-content/uploads/2020/04/%C3%8Dcone-Computador-Nuvem-PNG.png

Change description

  • Dedicated static folder on the IDE2 backed to host the images,
  • Exposed endpoint from IDE2 backend to load the image as a binary,
  • IDE2 frontend fetches the image content and builds a nativeImage.
  • A cloud icon is rendered in the native menu item if the sketch is inside directories.data/RemoteSketchbook.

Other information

Ref: #1826

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)

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Feb 9, 2023
@kittaakos kittaakos self-assigned this Feb 15, 2023
Base automatically changed from #1825 to main February 15, 2023 13:09
@kittaakos kittaakos marked this pull request as draft February 23, 2023 09:31
@davegarthsimpson
Copy link
Contributor

@kittaakos is this pending a design decision? Thanks

If IDE2 wants to dispatch images on the selected theme

@kittaakos
Copy link
Contributor Author

@kittaakos is this pending a design decision? Thanks

@davegarthsimpson, yes.

@91volt
Copy link

91volt commented Mar 24, 2023

@kittaakos the icon looks great.
-> if is possible to make the icons theme dependent would be great. Tell me if you need assets for that.
-> If is not feasible to have it in time for our next release, for now we can adopt the same solution of the titlebar, with "Cloud" textual prefix.

wdyt?

@kittaakos
Copy link
Contributor Author

-> if is possible to make the icons theme dependent would be great. Tell me if you need assets for that.

Yes, IDE2 needs the icons if the feature is required. Please see the PR description with the electron restrictions on the icon.

-> If is not feasible to have it in time for our next release,

I am not in the loop, I do not even know when does the next release happen.

Akos Kitta added 2 commits March 27, 2023 17:24
Ref: #1826

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

If IDE2 wants to dispatch images on the selected theme

Dispatching the icon based on IDE2's theme is not the best idea. The OS native menu is still dark, although the IDE2's theme is light. Please decide, @91volt. Thanks!

In-action:

cloud_icon_ide_theme.mp4

@per1234 per1234 added the topic: cloud Related to Arduino Cloud and cloud sketches label Apr 13, 2023
@kittaakos
Copy link
Contributor Author

Dispatching the icon based on IDE2's theme is not the best idea.

Another approach could be using the nativeTheme from Electron.

@kittaakos kittaakos removed their assignment Feb 23, 2024
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Akos Kitta seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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
Development

Successfully merging this pull request may close these issues.

5 participants