-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Less flashy closing-remarks
#6497
Conversation
async function init(): Promise<void> { | ||
const mergeCommit = select(`.TimelineItem.js-details-container.Details a[href^="/${getRepo()!.nameWithOwner}/commit/" i] > code`)!.textContent!; | ||
const tagName = await getFirstTag(mergeCommit); | ||
|
||
if (tagName) { | ||
addExistingTagLink(tagName); | ||
} else { | ||
void addReleaseBanner('The merge commit doesn’t appear in any tags'); | ||
void addReleaseBanner('This PR’s merge commit doesn’t appear in any tags'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copy was a little too vague
text: <>This pull request first appeared in <span className="text-mono text-small">{tagName}</span></>, | ||
classes: ['flash-success'], | ||
action: tagUrl, | ||
buttonLabel: <><TagIcon/> See release</>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This widget only shows the state of the PR, it doesn't require any actions, so I think it'd make sense to not use the button.
This now also helps differentiate the two states:
- released
- unreleased
… because they used to be clearly blue and clearly green, but now their color varies very little.
buttonLabel: <><TagIcon/> Draft a new release</>, | ||
} : {text})} | ||
buttonLabel: 'Draft a new release', | ||
} : bannerContent)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RequireAllOrNone
types make optional properties annoying to use. Feel free to try locally
action: url, | ||
buttonLabel: <><TagIcon/> Draft a new release</>, | ||
} : {text})} | ||
buttonLabel: 'Draft a new release', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Icon gone, fixes
closing-remarks
has wrong style #6482
classes: ['flash-success'], | ||
action: tagUrl, | ||
buttonLabel: <><TagIcon/> See release</>, | ||
icon: <TagIcon className="m-0"/>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tag also aligns it well with rgh-netiquette
in refined-github/sandbox#1
Co-authored-by: Kid <44045911+kidonng@users.noreply.github.com>
This is a good chance to refactor refined-github/source/github-helpers/banner.tsx Lines 12 to 13 in bac8aec
- // Classes copied from "had recent pushes" banner from repo home
+ // https://primer.style/css/components/alerts#with-action-button
- const classes = 'flex-shrink-0 btn btn-sm ml-sm-3 mt-2 mt-sm-n2 mb-sm-n2 mr-sm-n1 flex-self-center';
+ const classes = 'btn btn-sm flash-action'; refined-github/source/github-helpers/banner.tsx Lines 35 to 44 in bac8aec
<div className={['flash', ...props.classes ?? ''].join(' ')}>
- <div className="d-sm-flex flex-items-center gap-2">
- <div className="d-flex flex-auto flex-self-center flex-items-center gap-2">
{props.icon}
{/* TODO: Drop `any` after https://github.com/frenic/csstype/issues/177 */}
<span style={{textWrap: 'balance'} as any}>{props.text}</span>
- </div>
{button}
- </div>
</div> This was intended to be part of #6489 |
Basically that change would revert #5772 You can include this in your lint PR after this one is merged, if you can achieve the same result with semantic classes |
That's float for you! (To be honest I encountered this in my attempt too) It doesn't make sense to revert that PR. I will just create a new one to get rid of |
Reasoning? |
Because we are overriding most things from that class? |
We're not? Borders, rounding, padding, colors, icon colors still come from I suppose that if you can replicate what |
It looks like GitHub uses the same format and location to display status in open PRs: The HTML <div
class="border color-border-default rounded-2 branch-action-item js-details-container js-transitionable"
>
<div
class="merge-status-list-wrapper"
>
<div
class="float-left branch-action-item-icon completeness-indicator circle color-fg-muted border"
>
<RocketIcon/>
</div>
<h3 class="h4 status-heading">This branch has not been deployed</h3>
<span class="status-meta"> No deployments </span>
</div>
</div> It looks decent on mobile but:
So it's still probably not worth spending a lot of time on it (or any) given the 50 open bugs 😅 |
closing-remarks
has wrong style #6482closing-remarks
style #6489Test URLs
safer-destructive-actions
on Discussions #5600quote-props
rule eslint/eslint#17Released
Unreleased