Repository navigation
new-or-deleted-file- Improve compatibility with "Material Icons for GitHub" - #9110
SunsetTechuila wants to merge 5 commits into
Conversation
quick-file-edit - Improve compatibility with "GitHub File Icons" extension|
Mergeable? |
| '.react-directory-filename-column > :is(svg, img).color-fg-muted', | ||
| '.js-navigation-container .octicon-file', | ||
| ]; | ||
| export const directoryListingFileIcon = '.react-directory-filename-column > .octicon-file'; |
There was a problem hiding this comment.
This is just a cleanup
There was a problem hiding this comment.
Do send this as a standalone PR or sneak it into a related PR if it doesn't change anything at runtime.
new-or-deleted-file- Improve compatibility with "Material Icons for GitHub"
|
Re: compat with other extensions. I sent PRs to many such extensions over the year, it's often better for them to replace the icons correctly than for us to "support" them all. As long as they replace the SVG without messing the classes up, it doesn't really matter if the SVG is at one level or wrapped in a
We should probably write this "rule" in the feature's source code. |
|
Are there more than 2 extensions that I mentioned, one of which is unmaintained? The problems with "Material Icons for GitHub" are:
You think it's their logic that should be changed instead? |
Yes. Unless we broke something, there are many extensions that are compatible because they follow those two rules. We have a few issues regarding them and in general I sent PRs to address the bug. I even have one of the extensions installed in my testing chrome instance. "Catpuccin for Chrome" |
| fileInFileTree, | ||
| )?.cloneNode(true); | ||
| if (icon) { | ||
| icon.style.display = ''; |
There was a problem hiding this comment.
This fix is extension-specific, isn't it? We can't add this stuff here
Even if we select the right icon, we still have to remove display: none from element's styles
That's something wrong they're doing. They should just replace the element, not leave it behind
There was a problem hiding this comment.
Ew I saw the feature name but was still thinking of quick-file-edit, I didn't realize they were replacing random icons with file-type icons 🤦♂️
Let's see if it can be fixed in there first.
| ], fileInList) | ||
| ?.cloneNode(true); | ||
| const icon = $optional( | ||
| 'svg' + is( |
There was a problem hiding this comment.
As I said before, only DRY if it makes sense. Repeating "svg" in the 3 selectors is much more straightforward. I don’t think this saves any characters whatsoever
|
Closing for the aforementioned reasons. Refined GitHub is compatible, that extension is not. We cannot make adjustments for individual extensions. |
|
For me, both our code and theirs make sense and don't need corrections. It's just a question of who will adapt to whom. I hope the Material Icons maintainer will be less categorical |
|
Rehashed in #9493 The selector change threw me off when reviewing this PR and I'm still not sure what was broken in |

Initially, I intended to fix compatibility with the "GitHub File Icons" extension; however, it cannot be fixed on our side alone, and the extension is unmaintained. Material Icons for GitHub looks nicer anyway.
Test URLs
https://github.com/refined-github/sandbox/pull/71/changes
Screenshot
Before:
After: