Skip to content
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

Colorize status badge #4286

Merged
merged 8 commits into from
Jan 12, 2023
Merged

Conversation

Thomas1664
Copy link
Contributor

@Thomas1664 Thomas1664 commented Dec 3, 2022

Indicate the status of a PR with different colors and icons. One can now see immediately weither a PR is closed, merged, open or a draft.

Note that you were against colored status badges in #535. However, I think that they are looking substantially different from buttons now and also have icons in them:

In particular, the differences to buttons are:

  • larger
  • rounded corners
  • different font color
  • no outline on focus

Furthermore, I think that it is clear from the context around them that they are status badges and not buttons.

Another concern was that the previous implementation did not respect theme settings. I added the background colors to the color contribution point.

@Thomas1664 Thomas1664 changed the title Colourize status badge Colorize status badge Dec 3, 2022
@alexr00
Copy link
Member

alexr00 commented Dec 5, 2022

@daviddossett what do you think of the colored status?

Copy link
Contributor

@daviddossett daviddossett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open to this in principle but there are some theming issues to iron out:

CleanShot.2022-12-05.at.10.03.21.mp4
  • I believe the color should not be static for all themes. Rather, it should feel like part of that theme. That's why I used badge.background if memory serves. The challenge here is that people have strong associations with the GitHub colors. So we need to balance it feeling like the colors fit with the current theme with that association. Open to ideas here.
  • Some themes don't seem to render a background color at all

@Thomas1664
Copy link
Contributor Author

@daviddossett

Some themes don't seem to render a background color at all

This is only the case for high contrast themes and on purpose. I added a border in my latest commit.

The color is not static for all themes.

Theme authors can change the color using pullRequests.[PR status]. Obviously, it seems now static since those new color settings exist only in this PR. IMO it's up to theme authors to adopt these colors in their extension and therefore not our responsibility. On the other hand, vscode could add more colors to badges that reflect a certain state, e.g. some red-ish color for "closed", "failed", or "error" .

Furthermore, I fixed some issues with the font color on light themes.

webviews/editorWebview/index.css Outdated Show resolved Hide resolved
webviews/components/header.tsx Show resolved Hide resolved
daviddossett
daviddossett previously approved these changes Jan 12, 2023
Copy link
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, this looks very nice. I have just two small comments about reusing colors.

package.json Outdated
Comment on lines 1991 to 1992
"dark": "#238636",
"light": "#238636",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's base this off of the issues.open color so we don't have two slightly different open colors.

Suggested change
"dark": "#238636",
"light": "#238636",
"dark": "issues.open",
"light": "issues.open",

package.json Outdated
Comment on lines 2001 to 2002
"dark": "#da3633",
"light": "#da3633",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as for issues.open:

Suggested change
"dark": "#da3633",
"light": "#da3633",
"dark": "issues.closed",
"light": "issues.closed",

@alexr00 alexr00 modified the milestones: March 2023, January 2023 Jan 12, 2023
Copy link
Member

@alexr00 alexr00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I accepted my suggestions so that the change can be merged. The colors can still be changed before release if there is disagreement.

@alexr00 alexr00 enabled auto-merge (squash) January 12, 2023 10:52
@alexr00 alexr00 merged commit 952bab2 into microsoft:main Jan 12, 2023
@Thomas1664 Thomas1664 deleted the colorize-status-badge branch January 12, 2023 14:50
@Thomas1664
Copy link
Contributor Author

Thanks for taking this PR! I'm ok with the changed colors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants