message: Restore `tags-dropdown` link to open tag pages
diff: @@ -10,7 +10,7 @@ function init(): false | void {
  return false;
  }
  - return select('.subnav')!.append(
  + select('.subnav')!.append(
  <div className="rgh-tags-dropdown float-right d-flex flex-shrink-0 flex-items-center">
  <details className="details-reset details-overlay select-menu branch-select-menu position-relative">
  <summary className="btn select-menu-button css-truncate" data-hotkey="w" title="Find tags" aria-haspopup="menu">
  @@ -23,22 +23,29 @@ function init(): false | void {
  role="menu"
  style={{zIndex: 99}}
  >
  - <include-fragment className="select-menu-loading-overlay anim-pulse" onLoad={onFragmentLoaded}>
  + <include-fragment className="select-menu-loading-overlay anim-pulse" onLoad={changeTabToTags}>
  {octofaceIcon()}
  </include-fragment>
  </details-menu>
  </details>
  </div>
  );
  +
  + // https://github.com/github/remote-input-element#events
  + // Wait until the network request is finished and HTML body is updated
  + // "remote-input-success" event is bubbled
  + select('.rgh-tags-dropdown')!.addEventListener('remote-input-success', updateLinksToTag);
  }
  // We're reusing the Branch/Tag selector from the repo's Code tab, so we need to update a few things
  -function onFragmentLoaded(): void {
  +function changeTabToTags(): void {
  // Change the tab to "Tags"
  select('.rgh-tags-dropdown .select-menu-tab:last-child button')!.click();
  +}
  +function updateLinksToTag(): void {
  // Change links, which point to the content of each tag, to open the tag page instead
  - for (const anchorElement of select.all<HTMLAnchorElement>('.rgh-tags-dropdown [href*="/tree/"]')) {
  + for (const anchorElement of select.all<HTMLAnchorElement>('.rgh-tags-dropdown .select-menu-list:last-child [href*="/tree/"]')) {
  const pathnameParts = anchorElement.pathname.split('/');
  pathnameParts[3] = 'releases/tag'; // Replace `tree`
  anchorElement.pathname = pathnameParts.join('/');
  