message: Fix handling of "Code" button in `clean-repo-filelist-actions`
diff: @@ -3,7 +3,7 @@ import select from 'select-dom';
  import onetime from 'onetime';
  import {observe} from 'selector-observer';
  import * as pageDetect from 'github-url-detection';
  -import {PlusIcon, SearchIcon} from '@primer/octicons-react';
  +import {PlusIcon, SearchIcon, CodeIcon} from '@primer/octicons-react';
  import {wrap} from '../helpers/dom-utils';
  import features from '.';
  @@ -37,14 +37,19 @@ function init(): void {
  addTooltipToSummary(addFileDropdown, 'Add file');
  }
  - // This dropdown doesn't appear on `isSingleFile`
  - // Remove `.octicon-download` in November
  - const codeIcon = select('get-repo :is(.octicon-code, .octicon-download)');
  + const codeDropdownButton = select('get-repo summary');
  + if (codeDropdownButton) { // This dropdown doesn't appear on `isSingleFile`
  + addTooltipToSummary(codeDropdownButton, 'Clone, open or download');
  +
  + // Users with Codespaces enabled already have an icon in the button https://github.com/refined-github/refined-github/pull/5074#issuecomment-983251719
  + const codeIcon = select('.octicon-code', codeDropdownButton);
  if (codeIcon) {
  - // Remove "Code" text next to it
  + // Remove "Code" text
  codeIcon.nextSibling!.remove();
  -
  - addTooltipToSummary(codeIcon, 'Clone, open or download');
  + } else {
  + // Replace "Code" text with icon
  + codeDropdownButton.firstChild!.replaceWith(<CodeIcon/>);
  + }
  }
  },
  });
  