message: Fix multiple `copy-file` buttons on gist svg files
diff: @@ -5,6 +5,7 @@ import * as pageDetect from 'github-url-detection';
  import copyToClipboard from 'copy-text-to-clipboard';
  import features from '.';
  +import {groupButtons} from '../github-helpers/group-buttons';
  function handleClick({delegateTarget: button}: delegate.Event<MouseEvent, HTMLButtonElement>): void {
  const file = button.closest('.Box, .js-gist-file-update-container')!;
  @@ -22,10 +23,11 @@ function handleClick({delegateTarget: button}: delegate.Event<MouseEvent, HTMLBu
  }
  function renderButton(): void {
  - for (const button of select.all('.file-actions .btn, [data-hotkey="b"]')) {
  - button
  - .parentElement! // `BtnGroup`
  - .prepend(
  + for (const button of select.all<HTMLAnchorElement>([
  + '.file-actions .btn[href*="/raw/"]', // `isGist`
  + '[data-hotkey="b"]'
  + ])) {
  + const copyButton = (
  <button
  className="btn btn-sm tooltipped tooltipped-n BtnGroup-item rgh-copy-file"
  aria-label="Copy file to clipboard"
  @@ -34,6 +36,12 @@ function renderButton(): void {
  Copy
  </button>
  );
  + const group = button.closest('.BtnGroup');
  + if (group) {
  + group.prepend(copyButton);
  + } else {
  + groupButtons([button, copyButton]);
  + }
  }
  }
  