Add interactive timestamp to brief messages.#3491
Conversation
c7d1f54 to
85b89c8
Compare
|
Thanks @ishammahajan ! Ah, clever solution -- and thanks for the clear explanation! I've just played with this branch some, using it to read through some threads.
|
|
Oh also, for cross-reference: the issue this addresses is #3375 . |
85b89c8 to
a8de7ff
Compare
|
Thanks for the many swift updates! I played with this version some, and I like it. I think there's still a risk it'll feel "busy" to people, but if so we can probably make the offscreen timestamps poke in a little less still. So for the next step, I took a close look through the code. Comments below -- mainly a number of small things for code clarity, and a couple of nuances of behavior.
the outer
the local is called "element", but it's not actually an element, right? It's a collection, as the Instead, let's put the |
a8de7ff to
2ef801d
Compare
Changes the color scheme followed by mentions css to `hsla` instead of `rgba` in order to make it easier to change if required. Isn't related to the associated PR but is a pure refactor. Related: zulip#3491 (comment).
|
Thanks for the updates! The revisions all look good. This is quite close to merge -- just a few comments on this version:
|
(BTW I just filed #3516, about doing this in general.) |
|
Thanks for the swift review!
Actually, the previous version had both
That is a mistake I made. Sorry, fixed!
So I wanted to make the background for timestamps a little lighter (on light mode) and a little darker (on dark mode) than the headers of the respective modes, in order to make them not look out of place and less flashy.
I'll pick that up, I think. NOTE: Another small change I made during this revision, box-shadow is now properly scaled and even lighter (now that we use HSL I was able to precisely find the correct color I imagined 😄) box-shadow: -1px 1px 2px 0 hsla(0, 0%, 0%, 0.3), 0 2px 4px 0 hsla(0, 0%, 0%, 0.3);
became
box-shadow: -1px 1px 2px 0 hsla(0, 0%, 0%, 0.3), -2px 2px 4px 0 hsla(0, 0%, 0%, 0.3);
and
background: hsl(0, 0%, 88%);
to
background: hsl(0, 0%, 92%);Please play around with these colors and shadows, and tune them better if required, thanks! |
2ef801d to
864ae22
Compare
864ae22 to
976189f
Compare
|
Rebased onto master! |
Changes the color scheme followed by mentions css to `hsla` instead of `rgba` in order to make it easier to change if required. Isn't related to the associated PR but is a pure refactor. Related: zulip#3491 (comment).
When we show several consecutive messages from the same sender without an intervening recipient header or date divider, we don't repeat the sender. This has also meant that there's * no way to tell where one message ends and another begins; * and no way to see the time the later messages were sent. This commit aims to solve both with a sliding label which shows the timestamp of the message if clicked on it. We do this by replacing the existing timestamp with another component in the message list called `timestampHtml`. Timestamp starts out hidden on sender-implicit messages and 'expanded' on sender-showing messages. Browsers, by default, increase the size of the viewport to fit the size of any element inside it. This causes the horizontal size of the viewport to increase if we attempt to 'slide' an element out of the viewport. The only way to not allow the browser to increase the size is if there were an element which is always inside the browser, and another element (our actual timestamp) nested inside it which moves around inside our outer element (which has the overflow property set to hidden). Doing this causes the browser to think that we're not moving the element out of the viewport, but that it's simply overflowing from the outer element. Fixes zulip#3375.
976189f to
8a1099f
Compare
|
Looks good -- merged! Thanks again @ishammahajan for all your work on this. |
In 8a1099f (zulip#3491) we recently switched to a new "pills" design for showing the timestamps of messages. The new design had the side effect of making them a lot more visually prominent. Here, tone them back down: * For sender-showing messages, switch from the new pills back to just gray text on the message list's normal background. (Compare to the `.timestamp` rule removed in 8a1099f.) * Make the time pills' background more similar to the plain background. Keep a little contrast, in order to differentiate the top of the pill from the message list. * Adjust the time pills' shadows to be centered instead of leaning toward the left (lit from the right). For fun, we make them exactly match a Material Design elevation of 2dp, as implemented in MDC Web: https://github.com/material-components/material-components-web/blob/master/packages/mdc-elevation/_mixins.scss. [greg: expanded parts of commit message]




Two problems have plagued user experience for a long time. One,
there is no separation between two different messages, that is, one
does not know when one message ends and another one begins. Two,
there are no timestamps displayed for brief messages.
This commit aims to solve both with a sliding label which shows the
timestamp of the message if clicked on it. We do this buy
introducing two elements under
message-brief,timestamp-containerand
timestamp-label.Browsers, by default, increase the size of the viewport to fit the
size of any element inside it. This causes the horizontal size of
the viewport to increase if we attempt to 'slide' an element out of
the viewport. The only way to not allow the browser to increase the
size is if there were an element which always inside the browser,
and another element (our actual timestamp) nested inside it which
moves around inside our outer element (which has the overflow
property set to hidden). Doing this causes the browser to think that
we're not moving the element out of the viewport, but that it's
simply overflowing from the outer element.
Has been tested on both platforms.