From cf481876b15753e9264e538398e3680ed9c0575c Mon Sep 17 00:00:00 2001 From: whereareiam Date: Sun, 4 Oct 2026 10:29:55 +0200 Subject: [PATCH] Pull request: Match GitHub's state colours for closed, draft, merged and blocked pull requests Measured against GitHub signed in, on pull requests in each state: - A closed pull request's state label is red; it was purple, the colour for closed issues and merged pull requests. - A draft's state label is solid grey with white text. - A merged pull request's box has a purple border. - Blocked, conflicting, draft and closed pull requests keep a neutral badge and border; the red border added for blocked ones was a guess and is removed. - "Viewed" is a bordered 28px button and the review button is 28px. Co-Authored-By: Claude Opus 5.5 --- styles/components/issues/pull_files_review.ts | 19 ++++++++++++++++ styles/components/issues/pull_review.ts | 22 ++++++++++++++++--- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/styles/components/issues/pull_files_review.ts b/styles/components/issues/pull_files_review.ts index 6827d76..ecdeb34 100644 --- a/styles/components/issues/pull_files_review.ts +++ b/styles/components/issues/pull_files_review.ts @@ -31,6 +31,25 @@ export default css` font-weight: 500; line-height: 18px; } + /* GitHub's review button is a small 28px control. */ + #review-box .ui.ui.ui.button.js-btn-review { + height: 28px; + min-height: 28px; + } + /* "Viewed" is a small bordered button on GitHub. */ + .diff-file-header .viewed-file-form { + display: inline-flex; + align-items: center; + gap: 4px; + height: 28px; + padding: 0 8px; + border: 1px solid ${themeVars.color.light.border}; + border-radius: ${otherThemeVars.border.radius}; + background: ${themeVars.color.button}; + color: ${themeVars.color.text.self}; + font-size: 12px; + font-weight: 500; + } .review-box-panel { display: block; & > .ui.segment { diff --git a/styles/components/issues/pull_review.ts b/styles/components/issues/pull_review.ts index cf87639..c973456 100644 --- a/styles/components/issues/pull_review.ts +++ b/styles/components/issues/pull_review.ts @@ -76,6 +76,19 @@ export default css` align-items: center; gap: 4px; font-size: 14px; + font-weight: 600; + } + /* A closed pull request is red on GitHub (purple is for merged, and for closed issues). */ + & .issue-title-meta .ui.label.issue-state-label.red { + background-color: ${themeVars.github.bgColor.danger.emphasis} !important; + border-color: ${themeVars.github.bgColor.danger.emphasis} !important; + box-shadow: none; + } + /* A draft is a solid grey label. */ + & .issue-title-meta .ui.label.issue-state-label.grey { + color: ${themeVars.github.fgColor.onEmphasis} !important; + background-color: ${themeVars.github.bgColor.neutral.emphasis} !important; + border-color: ${themeVars.github.bgColor.neutral.emphasis} !important; } & .pull-desc { font-size: 14px; @@ -220,9 +233,12 @@ export default css` &.merge-ready > .content { border-color: ${themeVars.github.bgColor.success.emphasis}; } - /* A blocked pull request: the box border follows the red status badge. */ - &:has(> .timeline-avatar.red) > .content { - border-color: ${themeVars.github.bgColor.danger.emphasis}; + /* GitHub keeps the badge and border neutral for blocked, conflicting, draft and closed pull requests. */ + & > .timeline-avatar:is(.red, .grey, .yellow) { + background: ${themeVars.github.bgColor.neutral.emphasis} !important; + } + &:has(> .timeline-avatar.purple) > .content { + border-color: ${themeVars.github.bgColor.done.emphasis}; } /* While the merge form is open GitHub shows the form alone, in a neutral box. */ & > .content:has(.pull-merge-actions form .field) {