message: Restore `download-folder-button`
diff: import React from 'dom-chef';
  -import select from 'select-dom';
  import {DownloadIcon} from '@primer/octicons-react';
  import * as pageDetect from 'github-url-detection';
  import features from '../feature-manager';
  -import {getRepo} from '../github-helpers';
  +import observe from '../helpers/selector-observer';
  -function getDropdownItem(downloadUrl: URL): JSX.Element {
  - return (
  - <a className="dropdown-item rgh-download-folder" href={downloadUrl.href}>
  - Download directory
  - </a>
  - );
  -}
  -
  -function init(): void {
  +function add(folderDropdown: HTMLElement): void {
  const downloadUrl = new URL('https://download-directory.github.io/');
  downloadUrl.searchParams.set('url', location.href);
  - const deleteButtons = select.all(`form[action^="/${getRepo()!.nameWithOwner}/tree/delete"]`);
  - if (deleteButtons.length > 0) { // There are no buttons to delete the folder on "commit tree" pages #5335
  - for (const deleteButton of deleteButtons) {
  - deleteButton.before(getDropdownItem(downloadUrl));
  - }
  -
  - return;
  - }
  -
  - select('a.dropdown-item[data-hotkey="t"]')!.after(getDropdownItem(downloadUrl));
  - select('a.btn[data-hotkey="t"]')!.after(
  + folderDropdown.before(
  + // The buttons are spaced via `gap` on `md+` resolutions, and via `margin` at `sm`
  <a
  - className="btn d-none d-md-block tooltipped tooltipped-ne rgh-download-folder"
  + className="btn tooltipped tooltipped-nw mr-2 mr-md-0"
  aria-label="Download directory"
  href={downloadUrl.href}
  >
  @@ -39,6 +21,10 @@ function init(): void {
  );
  }
  +function init(signal: AbortSignal): void {
  + observe('[title="More options"]', add, {signal});
  +}
  +
  void features.add(import.meta.url, {
  include: [
  pageDetect.isRepoTree,
  @@ -46,6 +32,14 @@ void features.add(import.meta.url, {
  exclude: [
  pageDetect.isRepoRoot, // Already has an native download ZIP button
  ],
  - deduplicate: '.rgh-download-folder', // #3945
  init,
  });
  +
  +/*
  +
  +Test URLs
  +
  +- Own repo: https://github.com/refined-github/refined-github/tree/main/.github
  +- Archived repo: https://github.com/fregante/object-fit-images/tree/master/demo
  +
  +*/
  