message: Highlight bugs-tab on bug issues
diff: @@ -11,6 +11,19 @@ import {getRepo} from '../github-helpers';
  import SearchQuery from '../github-helpers/search-query';
  import abbreviateNumber from '../helpers/abbreviate-number';
  +async function highlightBugsTabOnIssuePage(): Promise<void | false> {
  + if (await countBugs() > 0 && !await elementReady('.sidebar-labels .IssueLabel[href$="/bug" i]')) {
  + return false;
  + }
  +
  + const bugsTab = await elementReady('.rgh-bug-tab', {stopOnDomReady: false, timeout: 10000});
  + bugsTab!.classList.add('selected');
  +
  + const issuesTab = select('.UnderlineNav-item[data-hotkey="g i"]')!;
  + issuesTab.classList.remove('selected');
  + issuesTab.removeAttribute('aria-current');
  +}
  +
  const countBugs = cache.function(async (): Promise<number> => {
  const {search} = await api.v4(`
  search(type: ISSUE, query: "label:bug is:open is:issue repo:${getRepo()!.nameWithOwner}") {
  @@ -53,6 +66,7 @@ async function init(): Promise<void | false> {
  // Copy Issues tab
  const bugsTab = issuesTab.cloneNode(true);
  + bugsTab.classList.add('rgh-bug-tab');
  // Disable unwanted behavior #3001
  bugsTab.removeAttribute('data-hotkey');
  @@ -112,4 +126,11 @@ void features.add(__filebasename, {
  ],
  awaitDomReady: false,
  init
  +}, {
  + include: [
  + pageDetect.isIssue
  + ],
  + awaitDomReady: false,
  + repeatOnBackButton: true,
  + init: highlightBugsTabOnIssuePage
  });
  