Skip to content

Commit f978f5e

Browse files
ci-link - Restore feature (refined-github#8944)
Co-authored-by: Grigory <techuila.sunset@gmail.com>
1 parent 71d3972 commit f978f5e

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

source/features/ci-link.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.rgh-ci-link .commit-build-statuses {
2+
font-size: 0;
3+
}
4+
15
/* The icon appears inside a clickable container, so it must be disabled */
26
.AppHeader-context-compact-mainItem .rgh-ci-link {
37
pointer-events: none;

source/features/ci-link.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,14 @@ async function add(anchor: HTMLElement): Promise<void> {
2929
return;
3030
}
3131

32+
if (!anchor.classList.contains('AppHeader-context-item')) {
33+
anchor.closest('li')!.classList.add('d-flex');
34+
}
35+
3236
const endpoint = buildRepoURL('commits/checks-statuses-rollups');
3337
anchor.parentElement!.append(
3438
// Hide in small viewports, matches `repo-header-info`
35-
<span className="rgh-ci-link ml-1 d-none d-sm-inline" title="CI status of latest commit">
39+
<span className="rgh-ci-link ml-1 d-none d-sm-flex flex-items-center flex-justify-center" title="CI status of latest commit">
3640
<batch-deferred-content hidden data-url={endpoint}>
3741
<input
3842
name="oid"
@@ -51,6 +55,8 @@ async function init(signal: AbortSignal): Promise<void> {
5155
await expectToken();
5256

5357
observe([
58+
'div[data-testid="top-nav-center"] li:last-child > a[class*="prc-Breadcrumbs-Item"]',
59+
// TODO: Remove after July 2026
5460
// Desktop
5561
'.AppHeader-context-item:not([data-hovercard-type])',
5662

source/features/repo-header-info.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ async function add(repoLink: HTMLAnchorElement): Promise<void> {
8282
async function init(signal: AbortSignal): Promise<void> {
8383
await expectToken();
8484
observe([
85+
'div[data-testid="top-nav-center"] li:last-child > a[class*="prc-Breadcrumbs-Item"]',
8586
'.AppHeader-context-full [role="listitem"]:last-child a.AppHeader-context-item', // TODO: Drop after May 2026
86-
'header.GlobalNav [data-testid="top-nav-center"] ol > li:last-child a:first-child',
8787
], add, {signal});
8888
}
8989

0 commit comments

Comments
 (0)