-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Fix alignment for commits on dashboard #11595
Conversation
Fix allignment issue between commit SHA and commit message
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.
doesn't appear to work
@zeripath hmm weird -- does the dashboard on gitea.com look ok to you? Right now for me everything (which is only mirror synching) looks broken like my first screenshot. This change makes them all look normal for me in every browser. Do you see them as broken but this change doesn't fix it? |
No the gitea.com dashboard looks broken too. Fiddling a little the issue might be that the SHA link isn't display: inline-block |
Sorry or rather that the text.truncate is display: inline-block |
Does not work here either, it's broken with and without this PR, just in different direction. Changing it to -4px works for me but that's a rather poor hack that most likely depend on font too. |
Weird, must be some combination of font/os that gives different results it looks totally fine in all 3 browsers on MacOs with this PR but I just tried in a windows vm and see the same thing as @zeripath . The fact that its a negative margin makes me feel like its making up for something else that needs to be fixed, though unsetting display: inline-block makes it look mostly better, and causes margin top and bottom to just have no effect. WIll need to look into more |
Also, I think you can add small top/bottom margins to |
@silverwind thanks, applied those changes and seems to work better in all places now |
seems not unfortunately |
Works for me @zeripath |
@zeripath you use Ubuntu right? I set up a vm and think this is an issue with Liberation Mono font which was the font it chose with default settings It seems to just size much different than others. Removing it from the mono font stack fixes it, but obviously a problem if that is going to be the default font selected for many users. Not really sure what would be a good way of working with that: |
If Liberation Mono is causing issues, maybe we want to move it after all other monospace fonts, right before |
In this test for Ubuntu it falls back to 'monospace' when removing Liberation Mono which seems to then use DejaVu Sans Mono from the system which looks better imo. Not sure what other distributions have installed other than Liberation Mono but I can't imagine there is only one monospace font installed. |
Adding DejaVu Sans Mono before Liberation Mono sounds like a good idea, if it works better. |
That |
Fix the fonts is not a proper solution; you can try manipulate list to look fine to you but in the end you can never be sure what user has installed and what browser will use. Aligning to baseline seems like the only option where you can be sure that different fonts will be aligned to each other visually. |
I'd say the behaviour in #11595 (comment) is a font/browser bug that should not require us to make specific workarounds for as these may bite us in the long run (after the font/browser is fixed). |
Yes on Libertion Mono the text is around 1px too high compared to avatar, but that's because the font's baseline is off. My proposed changes do not workaround the font issue, they align items to their baseline. This looks off on Libertion Mono for same reason the original solution did, but at least it's less visible now. Other fonts look fine to me and text is aligned perfectly to avatar. |
The alignment looks ok in those screenshots. What I don't quite get is how |
Good question, I have no idea why it actually visually centers image. |
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.
Try with this and
.push.news .content ul {
line-height: 18px;
web_src/less/_dashboard.less
Outdated
margin-bottom: .5rem; | ||
|
||
img { | ||
align-self: flex-end; |
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.
align-self: flex-end; | |
align-self: flex-start; |
it's possibly font x-height differences between the monospace font and the sans-serif font used for the message. The solution might simply be to stick the sha in side a rounded-box like we do elsewhere then the jarring font change would be less visible. |
@CirnoT applied those changes, looks ok to me on various systems/fonts @zeripath I think one of my least favorite parts of Gitea UI is the SHA1 inside of a rounded box : ( I'd rather see those all eventually get replaced rather than add another one here. These changes seem to make it work and look as it is intended to look now |
I think this should be backported to 1.12 -- I'm not sure exactly where but the bug this fixes seems like it was introduced somewhere in 1.12 (probably one of the larger timeline UI changes). I don't see it on 1.11 |
Please send backport |
Fix alignment issue between commit SHA and commit message
Fix alignment issue between commit SHA and commit message
Fix allignment issue between commit SHA and commit message
Old:
New: