-
Notifications
You must be signed in to change notification settings - Fork 680
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
Initial status message condensing #759
Conversation
Is it not possible to do something more similar to IRCCloud, where we just combine all the parts and joins into a line or two. I do kind of like the button, however I see it being difficult on mobile. I also think the text could be better (we shouldn't use etc) |
client/js/lounge.js
Outdated
@@ -276,9 +278,27 @@ $(function() { | |||
return msg; | |||
} | |||
|
|||
function buildChannelMessages(channel, messages) { | |||
function appendMessage(container, chan, type, msg) { | |||
if (!$(msg).hasClass("message") && type !== "lobby") { |
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.
Topic changes and other stuff? I think whitelist is better suited here?
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.
Hmmm, I guess. I guess it depends what we want to condense. I was thinking of condensing everything, but I guess people might prefer just condensing parts, joins, quits. What about kicks?
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.
Hmm yeah, maybe multiple mode changes and kicks be a good idea to condense too. But whitelist is still safer in this case. So we don't unknowingly break anything if we add new features.
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.
Aight, I've done joins, parts, quits, modes, kicks and nick changes.
client/js/lounge.js
Outdated
@@ -292,7 +312,7 @@ $(function() { | |||
} | |||
|
|||
function renderChannelMessages(data) { | |||
var documentFragment = buildChannelMessages(data.id, data.messages); | |||
var documentFragment = buildChannelMessages(data.id, data.messages, data.type); |
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.
Just pass data
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.
Aight
That's what I meant when I talked about irc cloud in the pr. It's a bit |
Can we remove the button and have the actual text be the button? I think that's what IRCCloud does |
I think it might be better to change the text to be a summary of what's condensed, something like
And then when you open it up, you can see the timestamps and quit messages, or whatever detail gets tucked away. |
@spangborn As I've already said, that is a good next step, but I think this is a useful first step before it. I won't have the time to add that just now, and this is better than nothing.
@MaxLeiter Happy to make the text clickable as well, but I don't want to remove the button. The button is a key indicator that you can expand it. |
3d85a96
to
76c8c76
Compare
Alright, I think I've updated it with people's feedback (except the natural language explanation of what's inside the condensed bit). I think we need to remember that it's good to make incremental improvements, and as @astorije has said a lot, we don't want to wait until things have all of the features that we want to put them in. Adding the natural "x, y and z joined, a and b left" will be a good next step, and I will take some time to work that out, but that has multiple issues:
So yes, that will come. But I want to do that separately, once this one is done. But yeah, the best thing is if some people can run this and see if there are any bugs I've missed. It seems to work quite well so far. I've removed "etc." from the wording, because that's a bit awkward. If anyone has a better idea for how we should word it for this PR (before we do the natural language explanation), that would be great. |
client/js/lounge.js
Outdated
docFragment.append(buildChatMessage({ | ||
chan: channel, | ||
function appendMessage(container, chan, type, msg) { | ||
if ($(msg).is(".join, .part, .quit, .mode, .kick, .nick") && type !== "lobby") { |
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.
Compare type
, you don't need to use DOM.
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.
Type here is actually the type of channel. But I can check against the message.
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.
Ah wait, the message we get through is the dom element anyway. We don't get the information of the message without it being an element.
client/views/msg_condensed.tpl
Outdated
<div class="msg {{type}}{{#if self}} self{{/if}}{{#if highlight}} highlight{{/if}} closed" id="msg-{{id}}"> | ||
<span class="time"></span> | ||
<span class="from"><span class="expander"></span></span> | ||
<span class="text">Condensed joins/parts</span> |
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 count all the unique events and display like 5x join, 1x quit, 2x mode
. As of right now youre not saying correctly which events were condensed.
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.
Would you be happy with me just saying "Condensed joins/parts/mode/nick changes" for this PR?
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.
No, that's just wrong. Print actual events (even without counter)
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.
Print actual events (even without counter)
What do you mean?
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.
Find out which events are in this condensed message and print these.
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.
Oh. Meh, that's more work. But fine, I'll do it.
Alright, I've added a simple "1 join, 1 part" as the message, so that we at least have some sort of information. I still think it's a good idea to do a natural language one at some point, but still not this PR, because we need to figure out what the wording should be. |
770bac9
to
9d59cde
Compare
So, current text will show (if they are all there) "1 join, 1 part, 1 quit, 1 mode change, 1 nick change and 1 kick". They will all pluralise if there are multiple, and if there are 0, it'll just not show at all. Think this is a good one for just now? |
68f446d
to
2d5cfd4
Compare
Alrighty, I have a bug now, which is fun. It doesn't work perfectly with the date separator. When there is a part/join straight after a date separator, the expanded elements show as below the date, but the condenser element shows as behind it. The condenser should show after the date separator (unless part of it is in the past, I guess?) |
My reason for doing this was to make it consistent (it felt a bit odd having it look different when there was only 1) but I can change it.
Good point, I'll remove it. |
Ideally we would do something similar to IRCCloud. |
Yeah,that's the ultimate plan. But happy to remove the condensing for 1 thing before that happens. I'll hopefully get these bugs fixed this week. |
This is really nice on busy channels! Good job 👏 I do agree with not condensing less than 2 items (I'd even say 3 or 5 if it were me). If the goal is to reduce noise on busy channels, then channels with very little activity should would not benefit from this much. In terms of messages, I think we should only condense joins, parts and quits together, at least at first. I don't think topic changes, mode changes or other kind of messages are as noisy as those 3. (Actually, camping in those 2 channels mentioned above), I'm happy to re-evaluate the need to condense nicks and modes, or others, but starting with joins/parts/quits is a strong improvement already and lets us experiment how it behaves that way. One bug though: When unfolding the messages, all messages are now clickable. I agree that the summary should be clickable (though when we start listing nicks in the summary, there will be a choice to make), but not everything it's condensing IMO. In terms of icons, can you right and down carets at the message level (where it's clickable) to give it a dropdown purpose?
|
2d5cfd4
to
684ca37
Compare
Alrighty. I have done all of the things people asked (I'm not sure about not condensing modes and nick changes, but I'll see how it goes for a while). There is 1 definite bug left, and 1 possible bug left (I need to test that overnight). Feel free to retry guys. |
684ca37
to
2fe7280
Compare
Having used this for only a few hours, it almost defeats the purpose if we don't include mode changes and nick changes. It breaks up the condensing so much, that we don't save a lot of space. So I'm going to add it back in. |
So, I added nick changes and mode changes back in, and I fixed the bugs. I think that's everything we had wrong with it. So, it should be ready for proper review. |
@@ -47,7 +47,7 @@ function renderPreview(preview, msg) { | |||
container.trigger("keepToBottom"); | |||
} | |||
|
|||
$("#chat").on("click", ".toggle-button", function() { | |||
$("#chat").on("click", ".text .toggle-button", function() { |
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 makes sure that the thumbnail toggle handler does not react to condensed toggle clicks. It is possible because text
class is now absent from the condensed template.
#chat .toggle-content { | ||
background: #242a33; | ||
color: #f3f3f3; | ||
} |
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.
All this makes the toggle button the same color than neighboring text. It was silly of me to color it differently, and it looked really bad on the condensed toggle.
client/views/msg_condensed.tpl
Outdated
<span class="content"> | ||
<span class="text condensed-msg"></span> | ||
<span class="condensed-text"></span> |
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.
Removed text
class here to differentiate normal messages from condensed messages. See above for a further explanation.
client/js/condensed.js
Outdated
@@ -33,5 +34,6 @@ function updateText(condensed, addedTypes) { | |||
text += obj[messageType] > 1 ? "s" : ""; | |||
} | |||
} | |||
condensed.find(".condensed-msg").text(text); | |||
condensed.find(".condensed-text") | |||
.html(text + templates.msg_condensed_toggle()); |
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.
@astorije So the potential issue I see with this, is that unlike previews, condensed text can change and thus move the button. A case can happen when you want to click the button, and someone leaves the channel at that moment and the button moves as a result of increased text.
Unless the entire line is clickable, which makes my comment irrelevant.
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.
Unless the entire line is clickable
Yep, entire line of text, not just the toggle button ;-)
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.
@astorije the default state for the setting appears to be nothing. |
Ah, missed that @xPaw, it shouldn't as the default is supposed to be "shown" (i.e. expanded), but I'll look into it. |
I think default should be collapsed. This will highlight the future (not everyone will click on settings and change this because they don't know of it), as well as this is probably what most people would like anyway.
I agree about having "everything"/"less things"/"nothing". What I don't agree about is the lack of informational text. Can we put "joins/parts/quits/nick changes" somewhere to make it very easy to see what the settings are for? Please mind I have not seen what the tooltip on ? says. |
Hey @christer88, thanks for your feedback! 😊
Cool, your explanation makes sense!
👍
It turns out, this is exactly what this ❔ tooltip is for :) In practice, this is exactly the text that @YaManicKill put in a |
9f18c36
to
3a1db41
Compare
b3f634f
to
2ccac7b
Compare
@xPaw, fixed that issue with default option, as well as another one. Finally, did the last thing I wanted to do, i.e. made the strings friendlier and closer to what we have on expanded view: It's not the cleanest code for that, but it will be amended by #1271 and/or #1047 anyway. Also, I did clean up this file a little bit to balance the karma 😅 Next step for me is to do a full review again, will do that shortly. |
… (with transition), reuse thumbnail toggle style
2ccac7b
to
43a8604
Compare
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'm not a huge fan of implementation and I suspect things will go wrong in the near future (@xPaw mentioned that #1041 is going to be a pain now), but feature itself is 👌 and I'm sure we can improve over time.
Huge 💯 to @YaManicKill for making this a reality!
My last issue with this is that selecting the option in the settings does not do anything until restarted. Solutions involve re-rendering, probably very expensive, or refreshing the page, which would be a poor experience until #1283 gets done.
I won't be blocking because of this context, but will definitely open a issue for it after this PR gets merged :)
@xPaw, with the recent changes I have made, do you want to give it another try before we merge?
Whatever, let's merge this and do work on top of master. This has been stalled for too long. |
Wait, this is actually finally merged? Holy crap. I'm so happy. No more rebasing. |
…joins Initial part/join condensing
This probably isn't done, and needs a lot more testing from other people to see if I've done anything bad.
Another good thing to add would be how IRC cloud shows it (it makes a little sentence explaining some of the parts/joins in it).
But this is just an initial one.
List of stuff still to do before merging:
handledTypes
toactionTypes
Try removing the second click handlerUI logic was changed a bit, making this a non-issue