(signal: AbortSignal, menu: HTMLElement)
| 10 | } |
| 11 | |
| 12 | function replaceRerunDropdown(signal: AbortSignal, menu: HTMLElement): void { |
| 13 | const menuButton = $optional('focus-group > button', menu); |
| 14 | // The observer matches all action-menus; only transform the "Re-run jobs" dropdown |
| 15 | if (menuButton?.textContent.trim() !== 'Re-run jobs') { |
| 16 | return; |
| 17 | } |
| 18 | |
| 19 | registerHotkey('r f', rerunFailedJobs, {signal}); |
| 20 | |
| 21 | const container = menu.parentElement!; |
| 22 | |
| 23 | for (const button of $$('button.ActionListContent', menu)) { |
| 24 | const clone = button.cloneNode(true); |
| 25 | clone.className = 'Button--secondary Button--medium Button'; |
| 26 | clone.firstElementChild!.className = 'Button-label'; |
| 27 | container.append(clone); |
| 28 | } |
| 29 | |
| 30 | container.classList.add('d-flex', 'gap-2'); |
| 31 | menu.classList.add('d-none'); |
| 32 | } |
| 33 | |
| 34 | function init(signal: AbortSignal): void { |
| 35 | observe('.PageHeader-actions action-menu', replaceRerunDropdown.bind(undefined, signal), {signal}); |
nothing calls this directly
no test coverage detected