-
Notifications
You must be signed in to change notification settings - Fork 8
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 issue with not highlighted snippets and automatically scroll to snippets #168
Conversation
Okay, this seems to work great for about half of the snippets. For the other half, it either scrolls a little too much or not enough. |
Hmm, when I try it in docker-compose, it tells me I have no data. :( |
Do not merge yet though. There must be some bug in the calculation of how many lines should be scrolled. If we want ship the fix for not highlighted snippets, I'd rather split it into two PRs. |
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.
I tried about 7 different reviews and in most of them it worked so well!
;; I experimentally figured out this number but the the applicable CSS | ||
;; line-height is `--bs-body-line-height' which is 1.5 and the | ||
;; font-size is 0.875em which equals to 14px. The `14 * 1.5' number | ||
;; would scroll good enough but when adding 0.3, it positions the | ||
;; snippet more close to the center. | ||
lineheight 21.3 |
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 is the reason why webdev is so hard :D
Fix fedora-copr#166 The `partition` function takes only doesn't include partitions with fewer items than `n`. Therefore when we have an odd number of snippets, the last one was not being highlighted.
0b95413
to
de2165f
Compare
I found and fixed the issue, so scrolling to snippets now works in 99% of cases. There are still two special cases that don't work:
I'd prefer merging now and fixing these corner cases in a followup PR |
When the review page is loaded, automatically scroll down to the displayed snippet. Also, when user clicks on a snippet in the right column, automatically scroll to it as well.
de2165f
to
258e954
Compare
I don't understand why the pre-commit fails because it doesn't show any error:
|
Two unrelated changes in this PR: