Problems with Merge Confidence PR styling #10
Replies: 13 comments
-
Is this possible to fix though? The browser appears to be adapting based on a combination of column header with / badge width. |
Beta Was this translation helpful? Give feedback.
-
I've tested this, badge size is based on column header size. Reproduction:
|
Beta Was this translation helpful? Give feedback.
-
Given a small enough viewpoint, won't all badges shrink? Or there is there some minimum based on the column header width? |
Beta Was this translation helpful? Give feedback.
-
There is a minimum width based on the column header width. Badges more or less keep normal size with larger column text:I also noticed something else when I was changing the column header text. You can use | Package | Change | Age | Adoption | Passing | Confidence |
| :---: | :---: | :---: | :---: | :---: | :---: |
| [@mdx-js/react](https://mdxjs.com) ([source](https://togithub.com/mdx-js/mdx)) | [`1.6.21` -> `1.6.22`](https://renovatebot.com/diffs/npm/@mdx-js%2freact/1.6.21/1.6.22) | [![age](https://badges.renovateapi.com/packages/npm/@mdx-js%2freact/1.6.22/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@mdx-js%2freact/1.6.22/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@mdx-js%2freact/1.6.22/compatibility-slim/1.6.21)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@mdx-js%2freact/1.6.22/confidence-slim/1.6.21)](https://docs.renovatebot.com/merge-confidence/) | Live example of fix:
Picture of badges not center aligned: |
Beta Was this translation helpful? Give feedback.
-
Great finding! We serve the badges on all platforms so need to determine:
And then the other part of what you've found is whether we should use deliberately more verbose column headings in order to get more predictability for badge sizes. |
Beta Was this translation helpful? Give feedback.
-
Platform support for Markdown center aligned tables
GitHub supports centering Markdown tablesQuote from GitHub Flavored Markdown Spec, 4.10 Tables:
GitLab supports centering Markdown tablesQuote from GitLab Markdown guide, tables:
Azure DevOps supports centering Markdown tables:Azure DevOps, Markdown Guidance, tables
BitBucket uses CommonMark tables only, so cannot use centered tables |
Beta Was this translation helpful? Give feedback.
-
Here's a screenshot example of a table with multiple rows: Here's how it looks all center-aligned: I wasn't sure about the Package column, but I think it looks ok? |
Beta Was this translation helpful? Give feedback.
-
I think the Package column should be left-aligned. Also the badge content itself can grow, if Age becomes say Maybe you're better of doing the table in plain HTML and then add some CSS Grid magic to align everything nicely. |
Beta Was this translation helpful? Give feedback.
-
Most platforms don't allow any custom CSS, so that's not an option. |
Beta Was this translation helpful? Give feedback.
-
But you can embed HTML in a Markdown file, and then add inline CSS maybe? This is a regular paragraph.
<table>
<tr>
<td style="center-align: true, or whatever works in CSS">Foo</td>
</tr>
</table>
This is another regular paragraph. |
Beta Was this translation helpful? Give feedback.
-
This will work for most cases, but word-wrap is causing problems. In some cases the words are being put below each other in the column, that causes the column to shrink again... |
Beta Was this translation helpful? Give feedback.
-
I believe GitHub and probably others strip out inline CSS. So maybe we skip center-aligning so that the badges left-align with each other? That leaves column width remaining. The Age badge is probably narrow because the column heading is only 3 characters and the badge itself is not wide either. Another possibility could be to add invisible I think Passing looks too small because the badge itself is wide due to the text "low data". An alternative would be to use the ⏳ symbol(s) in place. Although it's less intuitive than "low data", if the badge links to documentation explaining that's what it means then people only really need to learn that once. |
Beta Was this translation helpful? Give feedback.
-
Ok, inline CSS is out then. 😄
If we cannot be consistent for all platforms, it's probably better to just use the default left-align, and accept that some combinations of badges can look a bit weird in a table with multiple rows.
That's a possibility to fix the Passing badges,, but it's not very descriptive on its own without reading the docs. I hope that the |
Beta Was this translation helpful? Give feedback.
-
Problem:
The badges for Age and Passing shrink down to unreadable sizes when the viewport is made smaller.
This affects the New and Low confidences badges, and might affect other badges in the range as well.
Pictures:
Full viewport:
Small viewport:
How to reproduce:
PR where these pictures are coming from:
HonkingGoose/git-gosling#94
Beta Was this translation helpful? Give feedback.
All reactions