microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.17k stars 29.28k forks source link

Source control svg icons stay dark when the repository row is selected. #163748

Open jespertheend opened 2 years ago

jespertheend commented 2 years ago

Does this issue occur when all extensions are disabled?: N/A

Version: 1.72.0 (Universal) Commit: 64bbfbf67ada9953918d72e1df2f4d8e537d340e Date: 2022-10-04T23:21:58.256Z Electron: 19.0.17 Chromium: 102.0.5005.167 Node.js: 16.14.2 V8: 10.2.154.15-electron.0 OS: Darwin x64 21.6.0 Sandboxed: No

Steps to Reproduce:

  1. Install the git-graph extension
  2. Open a repository
  3. Open the source control view
  4. Make sure you currently have a light theme
  5. Click the repository row so it becomes blue

Expected result: The git graph icon changes along with the other icons.

Actual result: The git graph icon stays black

more info here: https://github.com/mhutchie/vscode-git-graph/issues/690

https://user-images.githubusercontent.com/2737650/196002067-29002c28-c71b-42a3-8806-85e5e143fe2f.mp4

daviddossett commented 2 years ago

This looks related to a contribution from the extension itself. My guess is that it contributes an SVG that doesn't have two versions for both light and dark themes.

Would recommend filing an issue on that extension's repo: https://github.com/mhutchie/vscode-git-graph/issues

vscodenpa commented 2 years ago

This issue is caused by an extension, please file it with the repository (or contact) the extension has linked in its overview in VS Code or the marketplace for VS Code. See also our issue reporting guidelines. If you don't know which extension is causing the problem, you can run Help: Start extension bisect from the command palette (F1) to help identify the problem extension.

Happy Coding!

jespertheend commented 2 years ago

@daviddossett I did, you can find it here: https://github.com/mhutchie/vscode-git-graph/issues/690

I checked the repository and it does seem to contain two icons for dark and light. The issue is that when a light theme is enabled, the icon is dark. Which normally looks fine, but if you click on the row it becomes blue and it doesn't look fine anymore.

jespertheend commented 2 years ago

To be clear, this bug report wasn't meant for the icon from vscode-git-graph extension specifically. I'm saying that this is an issue for all extensions. I was just using vscode-git-graph as an example.

daviddossett commented 2 years ago

I get that, but the VS Code API provides a mechanism for supplying icons for both light and dark themes if they aren't using the product's theme icons. Product icons automatically do this, custom SVGs do not.

See iconPath here: https://code.visualstudio.com/api/references/vscode-api#TreeItem

daviddossett commented 2 years ago

Oh I'm sorry, I didn't see your message above re: them supplying two icons already. I'll take a look.

jespertheend commented 2 years ago

Thanks David!

daviddossett commented 2 years ago

Ok, it looks like they did supply the correct icons—the issue is then specifically just about static SVGs reacting to a selected state of the list item. I don't know what the best solution would be since simply switching to the "light" icon wouldn't really work either. We would instead need to dynamically update the fill of the svg. Or something similar.

cc @joaomoreno for general list widget knowledge: who would be the best person to assign here?

joaomoreno commented 2 years ago

This is more SCM specific than anything else, @lszomoru can you take a peek?

lszomoru commented 10 months ago

While the recording is specific to SCM, this is an issue with any list that uses an SVG for the inline action. Here is a screenshot from the tree-view-sample from https://github.com/microsoft/vscode-extension-samples/tree/main/tree-view-sample.

image
boltex commented 7 months ago

@lszomoru @jespertheend This may be related to their 'disabled' state. (enablement resolving to false) as per this issue https://github.com/microsoft/vscode/issues/209397 ?