MCPcopy Index your code
hub / github.com/refined-github/refined-github / replaceRerunDropdown

Function replaceRerunDropdown

source/features/rerun-workflow.tsx:12–32  ·  view source on GitHub ↗
(signal: AbortSignal, menu: HTMLElement)

Source from the content-addressed store, hash-verified

10}
11
12function 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
34function init(signal: AbortSignal): void {
35 observe('.PageHeader-actions action-menu', replaceRerunDropdown.bind(undefined, signal), {signal});

Callers

nothing calls this directly

Calls 3

registerHotkeyFunction · 0.85
cloneNodeMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected