-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Support using theme icons in webview iconPath #92122
base: main
Are you sure you want to change the base?
Conversation
Fixes #90616 Enables using theme icons in the webview.iconPath This fixes the problem in a very ugly way by inlining all the codicon css classes. We should look into a proper fix
@mjbvz what do you want me to review here? |
@bpasero I updated the change to enable codicons in tab labels: This works but I feel we should probably push the ThemeIcons logic into the Also @misolori, once we figure out what we want to do, I'll likely need you help tweaking some of the css. |
try { | ||
const webviewSelector = `.show-file-icons .webview-${key}-name-file-icon`; | ||
if (ThemeIcon.isThemeIcon(value)) { | ||
// Theme icons are handled by EditorInput so hide the standard file icons. | ||
cssRules.push( |
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.
It would be much nicer of ResourceLabel
could handle this automatically
@@ -963,8 +966,9 @@ export class TabsTitleControl extends TitleControl { | |||
tabContainer.title = title; | |||
|
|||
// Label | |||
const displayName = editor.iconPath ? `$(${editor.iconPath.id}) ${escapeCodicons(name)}` : escapeCodicons(name); |
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 logic is ugly and has to duplicated. We should look into pushing the icon logic into ResourceLabel
@mjbvz yes, having this in resource labels seems better to me as probably most of these areas use it under the hood. I do not fully understand what this PR is trying to solve:
I fear that escaping codicons in places like update-tabs could be a perf hit because this method may be called a ton of times. We should only change logic if the optional |
cc @aeschli if you're able to help out with this |
@isidorn do you own |
@mjbvz For a start, there is |
Generally, and swe-wise, it seems that we should have some kind of |
I've struggled to figure out how file icons work in the workbench, especially the CSS part. Can someone please help with the workbench side of things for April? |
We suggest we distinguish between file icons and 'product' icons.
@mjbvz If you want to extract what you have to a |
@aeschli yes we do, it is called We might want to reuse parts of |
What's the progress on this? Is there a reason for |
Is this still relevant? |
Fixes #90616
Enables using theme icons in the
webview.iconPath
This fixes the problem in a very ugly way by inlining all the codicon css classes. We should look into a proper fix