-
Notifications
You must be signed in to change notification settings - Fork 41
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
[JENKINS-73187] - Do not apply icon size to text badges #153
[JENKINS-73187] - Do not apply icon size to text badges #153
Conversation
https://issues.jenkins.io/browse/JENKINS-73187 describes the mistake that I made when setting the icon class to always include "icon-sm". Short text badges do not need to be limited by that class because it causes the text field to be too small for any text to fit. Fixes jenkinsci#152 as well. Include a test for the icon class of short text.
The CSS file makes the short text badge better looking but also makes it use much more space. Better to switch back to the previous layout rather than disrupt existing users with a larger layout.
Makes it clear where the conditional is being applied.
I like the idea and followed a quite similar one in #151 as well. I expose the I can see some minor differences in the screenshots you provided that I'd like to investigate a little further and see how some edge cases behave (larger text, multiple rows, etc.). |
@MarkEWaite do you want to merge it? |
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.
LGTM
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.
@MarkEWaite I checked everything I could and found no major issues so far. The minimal changes to how the badges look after this change are neglectable IMHO.
Feel free to merge this if you are satisfied with the solution, I can push a release after that if you want.
Thanks @strangelookingnerd . I'll merge it and let you run the release. |
JENKINS-73187 - Do not apply icon size to text badges
This is a prototype that I'd like to use for discussion. I think that it may go "too far" along the path to compatibility with the 1.9.1 release of the badge plugin, but I think it is worth discussion from others who are more expert in CSS and page layout.
JENKINS-73187 describes result of the mistake that I made when setting the icon class to always include "icon-sm". Short text badges do not need to be limited by that class because it causes the text field to be too small for any text to fit.
Fixes #152 as well.
Includes a test for the icon class of short text.
That change (in the first commit in the pull request) resolves the most glaring issue, but then I started comparing the new layout with the 1.9.1 layout. The second commit restores the short text layout from the 1.9.1 release and removes the CSS styling of the short text box. The Jenkins design library probably has much better ways of styling that text box, but I've not explored those techniques.
The third commit in the pull request replaces paired "if / if not" conditions with paireed "when / otherwise" conditions. I think it makes the jelly file a little easier to read.
Testing done
Compared the layout of short text badges in Jenkins 2.452.1 with plugin version 1.9.1 and with this pull request.
Results for comparison will be uploaded to the pull request as images
Submitter checklist
Testing details
Compared the results with badge plugin 1.9.1 and this pull request
Short text
With the Pipeline script:
Badge 1.9.1
Badge PR-153
Short text with yellow background
With the Pipeline script:
Badge 1.9.1
Badge PR-153