Skip to content

new-or-deleted-file - Support Material Icons for GitHub - #9493

Merged
fregante merged 7 commits into
mainfrom
new-or-deleted-materials
May 18, 2026
Merged

fregante merged 7 commits into
mainfrom
new-or-deleted-materials

Conversation

Comment thread source/features/new-or-deleted-file.tsx Outdated

const icon = listIcon.cloneNode(true);
// Undo `display: none` that might be added by extensions like "Material Icons for GitHub"
icon.style.display = 'block';

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Core changes that enable the support:

  • include svg in the selector
  • reset display prop


const icon = $optional(['.octicon-diff-removed', '.octicon-diff-added'], fileInList)
?.cloneNode(true);
const icon = $optional(['.octicon-diff-removed', '.octicon-diff-added'], fileInList);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

  • Silences no-optional-chaining
  • Does not use iconSelectors because the icons are different and I don't care about improving code for old views

Comment thread source/features/new-or-deleted-file.tsx Outdated
?.cloneNode(true);
if (icon) {
fileHeader.append(<div className="d-flex ml-1">{icon}</div>);
const listIcon = $(`li[class*="file-tree-row"] a[href="${fileLink.hash}"] ` + is(iconSelectors));

@fregante fregante May 17, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

3 queries merged into one. Not sure why we had 3 separate queries before. Most likely we can drop the li part as well.

  • test

@fregante
fregante merged commit d91052e into main May 18, 2026
9 checks passed
@fregante
fregante deleted the new-or-deleted-materials branch May 18, 2026 07:16
Comment thread source/features/new-or-deleted-file.tsx Resolved
fregante added a commit that referenced this pull request May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Compatibility issues with Refined GitHub's new-or-deleted-file feature

2 participants