MCPcopy
hub / github.com/refined-github/refined-github / addReleasesTab

Function addReleasesTab

source/features/releases-tab.tsx:53–81  ·  view source on GitHub ↗
(repoNavigationBar: HTMLElement)

Source from the content-addressed store, hash-verified

51}
52
53async function addReleasesTab(repoNavigationBar: HTMLElement): Promise<false | void> {
54 const [count, type] = await getReleasesCount();
55 if (!type) {
56 return false;
57 }
58
59 // Wait for the dropdown because `observe` fires as soon as it encounter the container. `releases-tab` must be appended.
60 await elementReady(repoUnderlineNavUl);
61
62 repoNavigationBar.append(
63 <li className="d-flex">
64 <a
65 href={buildRepoUrl(type.toLowerCase())}
66 className="js-selected-navigation-item UnderlineNav-item hx_underlinenav-item no-wrap js-responsive-underlinenav-item rgh-releases-tab"
67 data-hotkey="g r"
68 data-selected-links="repo_releases"
69 data-tab-item="rgh-releases-item"
70 data-turbo-frame="repo-content-turbo-frame" /* Required for `data-selected-links` to work */
71 title="Hotkey: G R"
72 >
73 <TagIcon className="UnderlineNav-octicon d-none d-sm-inline" />
74 <span data-content={type}>{type}</span>
75 <span className="Counter" title={count > 999 ? String(count) : ''}>{abbreviateNumber(count)}</span>
76 </a>
77 </li>,
78 );
79
80 triggerRepoNavOverflow();
81}
82
83async function addReleasesDropdownItem(dropdownMenu: HTMLElement): Promise<false | void> {
84 const [, type] = await getReleasesCount();

Callers

nothing calls this directly

Calls 5

getReleasesCountFunction · 0.85
buildRepoUrlFunction · 0.85
abbreviateNumberFunction · 0.85
triggerRepoNavOverflowFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected