-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Heatmap mini fix #13637
Heatmap mini fix #13637
Conversation
* issue introduced by go-gitea#13623 makes the heatmap to show up really small
this might be a temporary fix
regression of #13623 |
Codecov Report
@@ Coverage Diff @@
## master #13637 +/- ##
==========================================
- Coverage 42.20% 42.19% -0.01%
==========================================
Files 697 697
Lines 76577 76577
==========================================
- Hits 32316 32311 -5
- Misses 38960 38964 +4
- Partials 5301 5302 +1
Continue to review full report at Codecov.
|
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 fix isn't right. We need flexbox to vertically center and we want to hide the heatmap on smaller screens. Will check out later unless you find a proper solution. I think the <svg>
element needs its size increased to fill the parent container.
This appears to work for me: #user-heatmap > svg {
width: 100%;
height: 100%;
} |
why do you want to hide the heatmap on smaller screens? also this puts it all together. #user-heatmap {
...
display: inline;
...
} |
notice how contribution stats and the heatmap legend are aligned when using
also, is that with the original setting or with my changes already? |
Try scaling the window even smaller. In the past there was a issue where it overflowed the container but I guess with
Yes, original settings. |
text-align: center; | ||
position: relative; | ||
min-height: 125px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; |
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.
If you remove display: flex
(which I don't agree with), you can also remove align-items
and justify-content
because those properties only apply to flexbox.
Please check if the placeholder seen in #13623 (comment) is still centered. I still think the flexbox removal is unwarranted, it's the best method to center things.
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 error message could be flex-centered once the error occurs, maybe by defining another heatmap-error class or sth.
let me see if I can trigger an error to verify what it looks like now.
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.
You can add a throw new Error("fail")
at a place like here:
gitea/web_src/js/features/heatmap.js
Line 13 in ad2a288
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.
Please check if the placeholder seen in #13623 (comment) is still centered. I still think the flexbox removal is unwarranted, it's the best method to center things.
I still wouldn't say a centered error message is more important than a nicely aligned heatmap, don't know...
hopefully, we can do both.
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 error message could be flex-centered
why not flex-center everything including the svg? I see no drawback.
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.
which is not perfect but not the worst either and considering it's an edge case and the fact that when shown it is shown nicely, I'd think it's manageable.
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.
@silverwind I think I got a remedy for your concern.
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.
what do you say on 474119d ?
is that alright?
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.
Not sure yet, need to test later.
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.
""
-->''
in 650964b
posted a screenshot below, too.
* address concerns of @silverwind and in case of an error add 'display: flex' to the heatmap element, resulting in a nicely centered error message (since we kept the centering attributes in heatmap.less)
centered heatmap error message as per @silverwind 's request. |
474119d
to
650964b
Compare
This I'll raise another PR. |
Apparently SVG inside flexbox renders slightly different across browsers where Firefox would stretch to fit the parent while Chrome and safari wouldn't. Stretch the SVG to the width of the parent for consistent rendering. Also did a few minor tweaks on the min-height of the box so it takes up less space on smaller responsive breakpoints. Fixes: go-gitea#13634 Fixes: go-gitea#13637
* linter says gimme single quotes
Alternative fix in #13645. |
650964b
to
f2472b0
Compare
hm let me try it. |
Apparently SVG inside flexbox renders slightly different across browsers where Firefox would stretch to fit the parent while Chrome and safari wouldn't. Stretch the SVG to the width of the parent for consistent rendering. Also did a few minor tweaks on the min-height of the box so it takes up less space on smaller responsive breakpoints. Fixes: go-gitea#13634 Fixes: go-gitea#13637
* Fix heatmap rendering in Chrome and Safari Apparently SVG inside flexbox renders slightly different across browsers where Firefox would stretch to fit the parent while Chrome and safari wouldn't. Stretch the SVG to the width of the parent for consistent rendering. Also did a few minor tweaks on the min-height of the box so it takes up less space on smaller responsive breakpoints. Fixes: #13634 Fixes: #13637 * position tweak Co-authored-by: zeripath <art27@cantab.net>
This fixes #13634 in a way - might not be a proper fix but the heatmap is now properly sized and also shown below 1200w.