mentions: Fix highlight extending unproportionately.#3514
mentions: Fix highlight extending unproportionately.#3514ishammahajan wants to merge 3 commits intozulip:mainfrom
Conversation
51f88f1 to
9956c5f
Compare
|
Interesting -- thanks for the investigation and fix!
I think in short the Can you find another solution? If it ends up involving some changes to the HTML we generate, that's fine. |
9956c5f to
ca405df
Compare
|
@gnprice thanks for the extensive investigation on this!
That was definitely not my intention when making this PR (I did not consider a case where a message-full came right after another message-full), but it looks like that actually stabilises the spacing between two different messages in the sense that all messages would now have spacing between them to be a total of 1rem. In this case I think I'll be making two PRs one where this change doesn't occur (basically fixing this issue, making it match current design) and another where we make this change with a commit of its own.
Well, that solution looks very dirty (essentially inserting dummy elements just to increase/decrease padding). Pushed a new version, check it out! |
|
Thanks @ishammahajan ! This looks like a plausible direction for the code, and it looks right visually in the quick example I just looked at. I don't feel I 100% yet understand what it's doing, though. I quite appreciate the idea of separating into a commit that makes one change and holds other effects constant, and another commit that makes another change -- that's quite helpful. Here's an idea that I think would make it easier to understand the first change:
Also:
|
Makes sense, done! In commit 1, the
I understand the confusion. Edited the commit message to make things clearer! Basically, there are two 'bugs' which come with fixing #3513. One (as mentioned in commit 2's message, in the last paragraph) makes it so that in some cases timerows (date pills) don't have as much padding according to previous design as they should have; this has been 'fixed' in commit 2 itself -- has not been dealt with, because I found it very difficult to revert the design to the version prior to this commit. Second issue (again mentioned in the commit message for commit 2 -- rule 4) is where a |
ca405df to
a0bb734
Compare
|
Thanks @ishammahajan -- this is helpful! A couple more questions, which I'm now better able to ask 🙂 :
you change the values in the first rule, and also change what set of them gets overridden in the second rule; and also start overriding one of those for certain
|
|
a0bb734 to
543e2cb
Compare
|
Thanks for the swift review!
That's right, my bad 🙂.
Sorry, this just seemed like good syntactic sugar 😛. I have made it more explicit.
Yup, that's right. This includes
I can't recall all of them. Unfortunately in this case too, I was enticed by the syntactical sugar. I think my intension in this case was to give this margin to every timerow and every header. Fixed. |
|
Thanks, this is helpful! It still doesn't quite give the kind of reasoning that I'd want to go through in order to convince myself that I understand exactly what the main commit here is doing -- or, what's almost the same thing, that it doesn't cause any changes at all except the ones the commit message describes. So, I'll try to go through that kind of reasoning here. I'll be sort of thinking aloud. First, a version where I'm problem-solving trying to reconstruct a change like this from scratch:
Now, a version looking at the actual commit and trying to validate that it doesn't have any unexpected behavior. (This is something I'd do after writing a commit myself, just like I do when reviewing one someone else wrote.)
|
|
Thanks for the review, @gnprice! The explanation above seems to be matching what was in my mind. Thanks for writing (and in turn documenting) it!
If I understand correctly from the review, the following is not described correctly:
I tried very hard to do that. The simplest way I could write it out is this I'm afraid. It does look a little convoluted though. Perhaps a simple rearranging of the css rules might make it better? Perhaps some comments (generally not preferable, I know) would make it more understandable -- containing a link to the above very helpful long explanation? |
|
I was just about to go create a thread for something unrelated on #mobile. I think to test out the slight changes in design made in this PR, I'll be using it for a few days on my device and report back if the they feel very out of place. |
543e2cb to
936aa3c
Compare
That sounds like a good plan.
Yep, those two, plus on the other hand this bit (from my notes above):
It's been a bit since I wrote that, but from rereading quickly, I think the conclusion of that bit is that the "Second, which should not be fixed" paragraph is just not true, and so should be deleted. There's also this bit:
In general, commit messages or comments that just say the same thing as the code aren't very helpful (unless the code change is so simple that just a one-line summary amounts to saying the same thing as the code, in which case that's still helpful for a commit message.) When it's not even quite the same, then it's definitely not helpful. 🙂 Here, I think what I was referring to when I said "the same as a previous version" is this bit: because in this version it doesn't look like that's what the parent commit actually does. |
As the title says. Padding for a `.loading` was also getting affected, hence that has been repositioned along with its brethen as well.
Mentions highlighting extends to the bottom and not at all at the top. This commit fixes that, through some CSS which might be confusing to a reader who is already familiar with the current codebase. Because of the changes made in this commit there are a few cases where the design is not exactly the same as before this commit. One, which `.message + .message-full` rule temporarily fixes, is where a message-full directly follows any other message. (The bug' was that there appears a loss of 24px of `padding-top`.) Second, and third, are introduced at the extremes of the message list. At the very top of the message list some extra padding exists because the topmost element will always be a `timerow`. And, the bottom most element will have a reduced padding -- because of the fact that we're changing the bottom padding of all message elements by 8px (16px -> 8px), and the bottom most element (which has padding) will always be a messages. Fixes zulip#3513.
When two message-full objects come adjacent to one another, the distance between them becomes 3rem, which is not desirable at all. This commit removes some of the code produced in the parent commit which was written in order to keep things consistent and not change the design of the webview too much in one commit. The removed code used to add extra padding to make the total 3rem.
936aa3c to
0f90e3a
Compare






Mentions highlighting extends to the bottom and not at all at the
top. This commit fixes that, by some CSS which might be confusing to
a reader.
With
.message + .messagewe change the top and bottom padding ofmessages which come directly after messages. This causes the spacing
to get messed up in the case where a header comes right after a
message which succeeds another message (so message --> message -->
header), it becomes 0.5rem instead of the default/previous 1rem.
.message + .message + .headerselector fixes this issue byintroducing a top-margin to such a header. This method appears to be
hacky but this is the cleanest way such an issue could be fixed
without a huge change in the entire CSS.
Fixes #3513.