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

Document 3rd party theme installation in "Advanced Usage" #2024

Merged
merged 1 commit into from
Apr 20, 2023

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Apr 20, 2023

Motivation

Arduino IDE comes with a selection of officially maintained and supported built-in themes:

  • Light
  • Dark
  • High Contrast

Although these three should be sufficient for most users, some users may have other requirements or preferences for the Arduino IDE UI theming.

Change description

Fortunately, because it is built on the Eclipse Theia IDE framework, Arduino IDE supports VS Code theme extensions. This makes a large variety of 3rd party themes available to the user, and even the ability to create custom themes.

Instructions for installing VS Code theme extensions are here added to the "Advanced Usage" document hosted in the repository.

Other information

Preview the rendered content here:

https://github.com/per1234/arduino-ide/blob/theme-installation-instructions/docs/advanced-usage.md#3rd-party-themes

Related

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)

Arduino IDE comes with a selection of officially maintained and supported built-in themes:

- Light
- Dark
- High Contrast

Although these three should be sufficient for most users, some users may have other requirements or preferences for the
Arduino IDE UI theming. Fortunately, because it is built on the Eclipse Theia IDE framework, Arduino IDE supports VS
Code theme extensions. This makes a large variety of 3rd party themes available to the user, and even the ability to
create custom themes.

Instructions for installing VS Code theme extensions are here added to the "Advanced Usage" document hosted in the
repository.
@per1234 per1234 added topic: documentation Related to documentation for the project type: enhancement Proposed improvement labels Apr 20, 2023
@per1234 per1234 requested a review from kittaakos April 20, 2023 06:38
@per1234 per1234 self-assigned this Apr 20, 2023
@per1234 per1234 added the topic: theme Related to GUI theming label Apr 20, 2023
@kittaakos
Copy link
Contributor

kittaakos commented Apr 20, 2023

The documentation should contain that the VSIX should be renamed to ZIP and extracted into the plugins folder.

Although using the VSIX also works, unzipping it is more efficient as Theia needs to extract the VSIX every time to a temporary folder and resolve it when loading the VSIXs. This will cause IDE2 to start slower.

Here is the log when a VSIX is read and not an extracted VSIX:

2023-04-20T08:39:18.574Z root INFO [akamud.vscode-theme-onedark-2.3.0.vsix]: trying to decompress into "/private/var/folders/z1/xkw1yh5n7rz4n8djprp1mdn80000gn/T/vscode-unpacked/akamud.vscode-theme-onedark-2.3.0.vsix"...
2023-04-20T08:39:18.927Z root INFO [akamud.vscode-theme-onedark-2.3.0.vsix]: decompressed

We must decide whether to provide more straightforward steps or a faster IDE2 start. I am OK with both.


Update:

Here is the Theia (1.31.1) code that does the extraction: https://github.com/eclipse-theia/theia/blob/v1.31.1/packages/plugin-ext-vscode/src/node/plugin-vscode-file-handler.ts#L52

@per1234
Copy link
Contributor Author

per1234 commented Apr 20, 2023

I actually only discovered that installation of the .vsix file was possible today (the support for this installation method was introduced starting from 2.0.4).

From my experience providing support to the Arduino community, I have learned that there is an unfortunate lack of fluency in working directly with file systems. The .vsix approach to installation is significantly more user friendly than the alternative manual unzip approach:

  • Unzipping a file that doesn't have a .zip file extension is somewhat difficult.
  • Installing a folder is more difficult than a file because the user must avoid the addition of an extra parent folder in the installation structure, or the loss of the essential extension folder.

So I do think it is worth adding some startup overhead in exchange for getting a more user friendly installation. But it does depend on how much overhead we are talking about.

I see that decompression is skipped if the extracted extension is already present in the temporary folder:

2023-04-20T16:01:18.510Z root INFO [21BlueDolphins.bluedolphin-0.4.0.vsix]: trying to decompress into "c:\Users\per\AppData\Local\Temp\vscode-unpacked\21BlueDolphins.bluedolphin-0.4.0.vsix"...
2023-04-20T16:01:18.510Z root INFO [ftsamoyed.theme-pink-cat-boo-1.3.0.vsix]: trying to decompress into "c:\Users\per\AppData\Local\Temp\vscode-unpacked\ftsamoyed.theme-pink-cat-boo-1.3.0.vsix"...
2023-04-20T16:01:18.510Z root INFO [johv.parchment-light-1.8.0.vsix]: trying to decompress into "c:\Users\per\AppData\Local\Temp\vscode-unpacked\johv.parchment-light-1.8.0.vsix"...
2023-04-20T16:01:18.510Z root INFO [21BlueDolphins.bluedolphin-0.4.0.vsix]: already found
2023-04-20T16:01:18.510Z root INFO [ftsamoyed.theme-pink-cat-boo-1.3.0.vsix]: already found
2023-04-20T16:01:18.512Z root INFO [johv.parchment-light-1.8.0.vsix]: already found

Although the decompression may have to be repeated periodically after the operating system clears the temporary folder (which is never done automatically on Windows), it seems this will significantly mitigate any overhead on the IDE startup.

Due to the asynchronous nature of the processes, I'm not sure how to determine the exact overhead from the use of .vsix files in the installation, but my crude experiments on a very low spec machine with three .vsix themes installed (I don't expect the average user to have even that many installed) seem to indicate that, even when a decompression operation is required, the overhead is not significant.

Copy link
Contributor

@kittaakos kittaakos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I verified the steps, and all works. Thank you!

@kittaakos
Copy link
Contributor

I do think it is worth adding some startup overhead in exchange for getting a more user friendly installation.

Thank you for the explanation. I wanted to make sure we are all aware of it.

@per1234 per1234 merged commit b3b9494 into arduino:main Apr 20, 2023
@per1234 per1234 deleted the theme-installation-instructions branch April 20, 2023 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: documentation Related to documentation for the project topic: theme Related to GUI theming type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants