-
-
Notifications
You must be signed in to change notification settings - Fork 668
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
Render /me ...
messages
#3306
Render /me ...
messages
#3306
Conversation
@gnprice ping for a review. |
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.
LGTM!
Two things though:
- I think the word processing for /me would be better in
processAlertWords
itself since there may be other alert words which we might need to process in the future and combining the text in brackets (eg.processSomething(processMeMessage(content))
) would be cumbersome. - The style of display would be better off exactly the same as the one displayed in the webapp IMO -- maybe some trickery with
display: inline
or:after
, and CSS variables would achieve that?
That wouldn't be very true to the function name though, wouldn't it? This has nothing to do with alert words :) |
This function checks if the message is of the type `/me ...` and converts it into format appropriate for rendering. This might have beeen better implemented server-side. While the check seems a bit simplistic and possibly error-prone, it is the exact same logic that the web uses. We will do a more simple styling that imitates Slack so the producedg markup is good enough.
Fixes zulip#1773 * Run `processMeMessage` on each message's content before rendering. * Add simple 'italics' style to '/me ...' messages. The styling is the exact same one Slack uses (just italics) and saves on having to support another completely different message layout on all the various device sizes.
550740a
to
70783b4
Compare
No need for tricky CSS, it can be achieved by relatively straight-forward CSS... and then we need to support another way of rendering messages that is barely used and barely needed (the feature request has been open for years, the PR for a half, and no one is really asking about this, this is a 'barely worth it PR', IMHO). Also, to reiterate, Slack do render it exactly like this PR. I would argue the web app needs to revert to this rendering too (for simplicity and maintainability). |
Oh I wasn't aware of that, I misread the commit. Sorry about that.
|
Honest error. I barely know what they are :) |
Thanks @borisyankov for this PR and @ishammahajan for the review! On the logic: in the webapp code (thanks for the link!), it has this:
Note in particular the So, I think we should consult that; it looks like this version doesn't. I think that will even mitigate to some extent the brittleness that you point out in the error message 🙂 Looks like we have the plumbing to sling it around; it's a flag. |
Helpful link! :) |
I am not sure what you mean. |
In the webapp, the corresponding logic only fires if the Digging a bit more to see what that works out to... it's set from the function
will not be treated as a me-message. (There actually seems to be a bug where the webapp's local echo disagrees with the server -- the former does treat it as a me-message.) I don't love the implementation of this feature, and don't have a strong view on the edge cases of what should count as a me-message; but of course whatever we do, the behavior should agree across platforms. So to do that here, we just need to consult the |
Quick update -- I reported this:
as zulip/zulip#12450, and it was fixed in zulip/zulip#12619 and in particular zulip/zulip@c03efd297. The backend logic was updated to match the webapp frontend. Looking briefly back at the code in this PR, it's based on the webapp frontend, not the backend, so hopefully it's already aligned with the behavior that the backend and webapp frontend now share. |
Closing because this implementation direction doesn't work. The issue remains open, and can be fixed with the approach described at #3306 (comment) above. (Which basically just comes down to: do what the issue description at #1773 already says to do.) |
Fixes #1773
processMeMessage
functionprocessMeMessage
on each message's content before rendering.The styling is the exact same one Slack uses (just italics) and
saves on having to support another completely different message
layout on all the various device sizes.