Skip to content

Commit

Permalink
fix: Perceptor tab missing icon (#863)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyantong2000 authored Aug 21, 2024
1 parent cb9c085 commit 3c189d5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/pages/ContentScripts/features/perceptor-tab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,18 @@ const addPerceptorTab = async (): Promise<void | false> => {
const insightsTabDataItem = $('li[data-menu-item$="insights-tab"]', repoNavigationDropdown);
const perceptorTabDataItem = insightsTabDataItem.clone(true);
perceptorTabDataItem.attr('data-menu-item', featureId);
perceptorTabDataItem.children('a').text('Perceptor').attr({
'data-selected-links': perceptorHref,
perceptorTabDataItem.children('a').attr({
href: perceptorHref,
});
const perceptorSvgElement = perceptorTabDataItem
.children('a')
.find('span.ActionListItem-visual.ActionListItem-visual--leading')
.find('svg');
perceptorSvgElement.attr('class', 'octicon octicon-perceptor');
perceptorSvgElement.html(iconSvgPath);
const perceptorTextElement = perceptorTabDataItem.children('a').find('span.ActionListItem-label');
perceptorTextElement.text('Perceptor');
insightsTabDataItem.after(perceptorTabDataItem);

// Trigger a reflow to push the right-most tab into the overflow dropdown
window.dispatchEvent(new Event('resize'));
};
Expand Down

0 comments on commit 3c189d5

Please sign in to comment.