Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions source/features/ci-link.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.rgh-ci-link .commit-build-statuses {
font-size: 0;
}

/* The icon appears inside a clickable container, so it must be disabled */
.AppHeader-context-compact-mainItem .rgh-ci-link {
pointer-events: none;
Expand Down
8 changes: 7 additions & 1 deletion source/features/ci-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ async function add(anchor: HTMLElement): Promise<void> {
return;
}

if (!anchor.classList.contains('AppHeader-context-item')) {
anchor.closest('li')!.classList.add('d-flex');
}

const endpoint = buildRepoURL('commits/checks-statuses-rollups');
anchor.parentElement!.append(
// Hide in small viewports, matches `repo-header-info`
<span className="rgh-ci-link ml-1 d-none d-sm-inline" title="CI status of latest commit">
<span className="rgh-ci-link ml-1 d-none d-sm-flex flex-items-center flex-justify-center" title="CI status of latest commit">
<batch-deferred-content hidden data-url={endpoint}>
<input
name="oid"
Expand All @@ -51,6 +55,8 @@ async function init(signal: AbortSignal): Promise<void> {
await expectToken();

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

Expand Down
2 changes: 1 addition & 1 deletion source/features/repo-header-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ async function add(repoLink: HTMLAnchorElement): Promise<void> {
async function init(signal: AbortSignal): Promise<void> {
await expectToken();
observe([
'div[data-testid="top-nav-center"] li:last-child > a[class*="prc-Breadcrumbs-Item"]',
'.AppHeader-context-full [role="listitem"]:last-child a.AppHeader-context-item', // TODO: Drop after May 2026
'header.GlobalNav [data-testid="top-nav-center"] ol > li:last-child a:first-child',
], add, {signal});
}

Expand Down
Loading