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

Replace icons with codicons #9864

Merged
merged 1 commit into from
Sep 8, 2021
Merged

Conversation

msujew
Copy link
Member

@msujew msujew commented Aug 9, 2021

What it does

Closes #6115

Does a lot of css work:

  • Replaces all internally used icons (fontawesome, custom svg files) with codicons
  • Adds a new utility method for codicons, namely codicon and codiconArray.
  • Aligns button-icon css with vscode: Buttons in toolbars, etc. are now highlighted with a backdrop

I decided to leave the old svg icons in the codebase for backwards compatibility. I also couldn't notice any breaking change, but please keep an eye out for them.

How to test

Before starting to test I would recommend to start a second Theia instance to compare visual changes. The following testing steps are only the most important parts that have changed. As every icon in the app has changed, please refer to the code to gather a list of everything that has changed. Also, change the icon theme to seti at appropriate times to check for tab-bar items, etc.

  • Check toolbar icons, every icon should show a backdrop on hover.
  • Check tabbar close icons, every close icon should show a backdrop on hover.
  • Check status bar icons
  • Check notification widget icons
  • Check debug view widget icons
  • Check scm view widget icons
  • Check problems view widget icons
  • Check extensions view widget icons

Review checklist

Reminder for reviewers

@vince-fugnitto vince-fugnitto added the ui/ux issues related to user interface / user experience label Aug 9, 2021
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

@msujew I believe we should also update the widget icons themselves (ex: explorer, scm, ...), any reason we wanted to omit it initially?

@msujew
Copy link
Member Author

msujew commented Aug 9, 2021

any reason we wanted to omit it initially?

Actually no, I just stopped thinking about it, once I noticed that the explorer icon is not in the codicon collection. But I just saw that every other icon is in there. So I'll replace those. What is your opinion on replacing the default folder/file icon in the explorer? Currently it still uses the fontawesome icons.

@vince-fugnitto
Copy link
Member

Actually no, I just stopped thinking about it, once I noticed that the explorer icon is not in the codicon collection. But I just saw that every other icon is in there. So I'll replace those. What is your opinion on replacing the default folder/file icon in the explorer? Currently it still uses the fontawesome icons.

I think the idea for consistency with vscode and what plugins use we should aim to update all icons (including font-awesome icons) to their codicon counterparts. This includes widgets when docked to sidepanels. It will create a uniform look and feel across the framework.

@msujew msujew force-pushed the codicon-replacement branch 4 times, most recently from d319b55 to 54b476c Compare August 10, 2021 10:34
@msujew msujew requested a review from vince-fugnitto August 10, 2021 10:35
@msujew msujew force-pushed the codicon-replacement branch from 54b476c to 908f64f Compare August 12, 2021 09:24
packages/core/src/browser/label-provider.ts Outdated Show resolved Hide resolved
@@ -73,7 +73,7 @@ export class ProgressStatusBarItem implements ProgressClient {
this.statusBar.removeElement(this.id);
return;
}
const text = `$(refresh~spin) ${message}`;
const text = `$(codicon-sync~spin) ${message}`;
Copy link
Member

Choose a reason for hiding this comment

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

This reminds me of the following issue #9768, perhaps it's something we can easily implement in the future.

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

If we previously had layout data saved (ex: local-storage), then starting the app may cause icons to be non-existent:

image

We may want to introduce a layout-migration:

export type ApplicationShellLayoutVersion =
/** layout versioning is introduced, unversioned layout are not compatible */
2.0 |
/** view containers are introduced, backward compatible to 2.0 */
3.0 |
/** git history view is replaced by a more generic scm history view, backward compatible to 3.0 */
4.0;
/**
* When a version is increased, make sure to introduce a migration (ApplicationShellLayoutMigration) to this version.
*/
export const applicationShellLayoutVersion: ApplicationShellLayoutVersion = 4.0;

export const ApplicationShellLayoutMigration = Symbol('ApplicationShellLayoutMigration');
export interface ApplicationShellLayoutMigration {
/**
* A target migration version.
*/
readonly layoutVersion: ApplicationShellLayoutVersion;
/**
* A migration can transform layout before it will be inflated.
*
* @throws `ApplicationShellLayoutMigrationError` if a layout cannot be migrated,
* in this case the default layout will be initialized.
*/
onWillInflateLayout?(context: ApplicationShellLayoutMigrationContext): MaybePromise<void>;
/**
* A migration can transform the given description before it will be inflated.
*
* @returns a migrated widget description, or `undefined`
* @throws `ApplicationShellLayoutMigrationError` if a widget description cannot be migrated,
* in this case the default layout will be initialized.
*/
onWillInflateWidget?(desc: WidgetDescription, context: ApplicationShellLayoutMigrationContext): MaybePromise<WidgetDescription | undefined>;
}

@msujew msujew force-pushed the codicon-replacement branch 2 times, most recently from 8e26068 to 5261bf2 Compare August 13, 2021 14:23
@msujew
Copy link
Member Author

msujew commented Aug 13, 2021

We may want to introduce a layout-migration

Alright, done. It's a bit crude, but I found the string replacement method to be sufficient.

@msujew msujew force-pushed the codicon-replacement branch 3 times, most recently from 56ac741 to a51ecac Compare August 14, 2021 12:07
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

@msujew do you mind rebasing the pull-request when you get a chance? I'd be happy to take a look at it afterwards :)

@msujew msujew force-pushed the codicon-replacement branch from a51ecac to 928a937 Compare August 20, 2021 14:24
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

I really love the new icons and behavior for toolbar items 👍
I noticed two things when testing:

  • I believe the bottom sidebar (settings icon) may need to be adjusted to have the same font-size as the rest of the sidebar
  • I believe the search-in-workspace widget needs to be updated to take into account the new chevron (left is the pr, and right is master), the input fields are no longer aligned:

siw-diff

  • dirty editors are no longer marked as dirty:

image

@msujew msujew force-pushed the codicon-replacement branch from 928a937 to cac0dfb Compare August 20, 2021 15:53
@msujew
Copy link
Member Author

msujew commented Aug 20, 2021

@vince-fugnitto Thanks for the feedback, I think I addressed everything 👍

@msujew msujew force-pushed the codicon-replacement branch 2 times, most recently from 9ddd8e3 to fba3a8a Compare August 20, 2021 16:10
@paul-marechal paul-marechal added this to the 1.18.0 milestone Aug 26, 2021
@vince-fugnitto
Copy link
Member

@msujew do you mind rebasing when you get a chance? I finally have a bit of time to help with the review :)

@msujew msujew force-pushed the codicon-replacement branch 2 times, most recently from 6fb09be to fa6e0f3 Compare August 27, 2021 13:33
@msujew msujew force-pushed the codicon-replacement branch from fa6e0f3 to a710ef7 Compare August 27, 2021 13:51
@vince-fugnitto
Copy link
Member

vince-fugnitto commented Aug 27, 2021

@msujew I would be fine to merge the changes early in the month and iteratively fix issues if we find them.
One such issue I noticed is the alignment of some icons and the close button as compared to master (below):

image

We would also probably want more padding (like master) when docking widgets out of the sidepanels:

image

master:

image

@msujew
Copy link
Member Author

msujew commented Aug 27, 2021

@vince-fugnitto Sure sounds good to me. I'm still willing to fix any issues that we find before we merge :)

@vince-fugnitto
Copy link
Member

@vince-fugnitto Sure sounds good to me. I'm still willing to fix any issues that we find before we merge :)

You can fix the last two I found, I wasn’t able to see any other regressions when testing 👍

@msujew msujew force-pushed the codicon-replacement branch 2 times, most recently from 6220691 to 9c100f3 Compare August 30, 2021 12:32
@msujew msujew requested a review from vince-fugnitto August 31, 2021 09:56
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

I'd be fine to merge and fix issues throughout the month if necessary as I do not want to hold back the pull-request 👍

I still notice some UI issues, perhaps one of the bigger ones (that may be caused by a bigger issue) is that the plugin-views sometimes do not display their proper icons:

image

I also noticed that the alignment of toolbar items contributed by plugins are not necessarily aligned properly as well (compared to builtin views like the explorer):

image

A very minor bug is how the scm arrow is not aligned properly (for CHANGES) compared to other trees:

image

@msujew
Copy link
Member Author

msujew commented Aug 31, 2021

I still notice some UI issues, perhaps one of the bigger ones (that may be caused by a bigger issue) is that the plugin-views sometimes do not display their proper icons

This seems to be unrelated to my changes, see the current master:

image

I noticed that the instanceof check in the plugin host fails:

} else if (iconPath instanceof ThemeIcon) {

I assume this is due to the ES2017 upgrade and the @es5Compatibility annotation (#9436). instanceof checks are not a valid operation on es5 classes as far as I can tell.

I'll add an is check for ThemeIcon users instead.

@vince-fugnitto
Copy link
Member

@msujew sorry I had thought I confirmed against master that it was a regression (turns out the code I confirmed against was older) but you're right that its not related to your changes and we can omit the fix for now 👍

@msujew msujew force-pushed the codicon-replacement branch 3 times, most recently from 415aa27 to f4be918 Compare September 2, 2021 13:34
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

The changes look good to me 👍

I think there is a leftover file:

image

@msujew msujew force-pushed the codicon-replacement branch from f4be918 to 7f20cec Compare September 3, 2021 13:59
@msujew
Copy link
Member Author

msujew commented Sep 6, 2021

I'll merge this Tuesday or Wednesday, if no one else has any issues with my changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui/ux issues related to user interface / user experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update VSCode Icons
3 participants