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
Mute topics with the M key / unmute with U #997
Conversation
(Test failure is due to lack of test coverage on the handlebars file; I'll try to make up a test for it) |
Looks like you're getting a lot of lint failures from adding new global variables; the new functions should all move into the muting.js module. Also maybe there's a few from not declaring variables. You can run tools/lint-all to see the output. And the "frontend" test failure is because you have a new template that doesn't have tests. |
I managed to bring the tests back in line & add the frontend test, phew! |
Cool, I reviewed this and the code looks pretty clean; here are a few comments:
Otherwise, this looks great! As a sidenote, I don't think fixing this should be part of this PR, but the backend implementation for muting isn't designed to handle a user having muted hundreds of topics. I opened #1019 for this issue. |
Hey @antifuchs, I just wanted to check on whether you've had a chance to work on finishing this. It'd be great to get it merged before a lot of merge conflicts develop :) |
I would suggest why not just user 'M' key for both muting and unmuting the topics. Just like streaming any video on youtube pressing 'space' button both pauses and resumes video. |
Ahhh, sorry for the radio silence! I'll try and port it forward to latest master and address your comments this weekend. @krtkmj - I feel like muting/unmuting a topic with only one key while showing a stream might be confusing. It's not extremely clear which way is active, so I think having one button per action would make it easier to predict what will happen. |
I was just checking this functionality and here are a few points.
EDIT: When a topic/stream is muted, it is also faded in left sidebar stream list. So, I don't having single button for both operation should be a problem. @neerajwahi what do you think? |
a97b50d
to
44b4d26
Compare
I've rebased & added a Casper test, but sadly it doesn't pass on travis (but the whole casper test suite passes locally, ugh!) Additionally, I've adjusted the timeout to 5s and made the "muted topic X in stream Y" message only appear once & get dismissed if you unmute while it's visible. I took no action on the other points you two raised (especially the note about putting the message into the compose box, which I agree with but feel unequipped to handle the design implications of). I am happy to give you all push permissions on my branch so we can get somewhere! |
Great, thanks for working on this again @antifuchs! Usually cases where a Casper test passes locally but not on Travis is because Travis' machines are slower than yours. Sometimes you can have good luck reproducing these by getting a super-cheap VM from e.g. Scaleway and running the tests there. But regardless the problem is almost certainly that you are missing a wait (or are waiting on a thing that loads before the element you're about to use) in a test, and thus clicking on something before its ready. I'll take a quick look at the code to see if I can spot something suspiciuos. |
@antifuchs I actually think we should stick with M/U; I think the expectations are a bit clearer that way. |
common.keypress(27); // Escape to deactivate the message edit box | ||
casper.page.sendEvent('keypress', 'U'); | ||
common.un_narrow(); | ||
common.un_narrow(); |
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.
why does this unnarrow twice?
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, I bed that's there because you were getting failures with the unnarrow hadn't been completed yet; I think my proposed fix to the wait line below is the right way to address this (and you can delete the extra un_narrow
)
18a31d3
to
116fe0f
Compare
Being in streams that generate a lot of topics that have a medium chance of being uninteresting can make it hard to keep up - muting a topic can help, but without a key binding, it's pretty tedious. This change adds the "M" key binding that allows muting a topic very quickly, and an "U" key binding that allows unmuting it from the topic's stream.
This tests that muting via the M key and un-muting via the button, as well as un-muting via the U key in a narrowed (muted) topic work.
No longer show more than one "topic X in stream Y" is muted message anymore. Also, dismiss the message if the topic gets unmuted while the message is showing (I don't expect this to be very common, but it's definitely possible to do).
Yay! Your hint about the |
Great! Just to make sure I've kept track of the discussion correctly, are these the outstanding issues from above that you haven't resolved @antifuchs?
@antifuchs what are your thoughts on the last two? |
@antifuchs just wanted to check in -- it'd be great to get these last bits fixed up and merged before merge conflicts develop :) |
@antifuchs: @aakash-cr7 is interested in collaborating with you on this and helping finish it! |
@brainwane @timabbott I have been working on this issue. I want to show my latest work. What should I do, should I create a new PR? |
That's reasonable; the other approach is you can push your branch to your GitHub fork and post a link to it. |
@timabbott I was wondering about the success messages for muting/unmuting topics. Currently it shows up in the compose box, so how should I handle this for now? As you suggested should I add a new error area that drops down from the top of the screen? |
We now have a top-of-screen error area being worked on in #1692; we might be able to use that for this. I'm not entirely sure where the best place to put the notifications for this feature are; perhaps that's a good discussion to bring up at this Thursday's group hangout? Seems worth getting a lot of people's ideas on it... |
I was thinking of showing the success messages on the bottom left side of the screen (just like the new stream message notification appears on the right part of the screen). But yes it's wise to discuss the issue first in Thursday's group hangout. |
@showell as @timabbott suggested that this PR should contain only the muting/unmuting functionality. That functionality is done but the work on notification is already committed so what should I do? Should I rebase to remove those changes or commit again removing those changes? |
I don't think the notifications stuff has actually hit master yet. Unless I'm mistaken, we still have the option to get yourself stuff to master first, and then Brock can rework his piece as needed. |
@aakash-cr7 This branch has some merge conflicts. Can you please rebase this branch with master? |
@timabbott in my latest commit I have made the topic to mute and unmute on pressing M and U respectively. I am having some issues while rebasing, though. |
@aakash-cr7 I rebased for you and posted the resulting branch at: https://github.com/timabbott/zulip/tree/muting-hotkeys |
@timabbott currently the code works for just muting and unmuting the topics, what's more to be done? |
@aakash-cr7 can you test out #1711 (both along and combined with this branch) to make sure things work properly? |
Sure @timabbott . I will do that and ping you once done. |
@aakash-cr7 how's this going? |
I think #1711 is looking really good, solves the notifications piece of the issue, and will merge in the next day. So, you should be able to start working on rebasing these changes on top of that. |
We just merged #1711, so now it should be possible to merge the new hotkeys, with only limited integration with the muting notifications code (we probably still want to dismiss the notification in the event that the user unmutes the stream while it is visible). |
@aakash-cr7 and @antifuchs do either of you have time to finish this up now that the notifications issue is resolved? I'd love to get this feature in. |
@timabbott sorry for the slow response. I had been busy lately so could not finish up the work. Though now I am mostly free and will be able to commit time to this. I will finish it up and get back to you ASAP. |
Cool, let us know if you need any help @aakash-cr7! |
@aakash-cr7 @antifuchs should we be looking for someone else to pick up this project? |
I guess someone new should pick this up. https://github.com/timabbott/zulip/tree/muting-hotkeys is the latest state; I believe the remaining work is basically to clean up the notifications code from this PR in some reasonable way, since that was completed separately in #1711. |
@timabbott in this PR the muting and unmuting of topics is working. There is no notification for muting/unmuting. The notification part is done in #1711. Shouldn't the two PR's be merged? Or what should be done? |
Right, #1711 was merged into master a while ago; what remains is that this PR needs to be rebased and then tested to make sure they work well together. |
@timabbott great! I have rebased the PR and everything seems to be working fine. One question though. What should be the functionality, if the topic is already muted and user presses 'M' again. I have thought about the following 2 scenarios:
What do you think? |
I think probably showing the popover with a faster disappear time (like 1s, not 4s) and a notice that the topic is already muted is probably best? (Can you push to this branch to update the PR?) |
Cool, showing the notice that the topic is already muted sounds good. One more thing, the latest code for this PR is in https://github.com/timabbott/zulip/tree/muting-hotkeys. And I rebased that branch after pulling from it. So @timabbott should I push to that branch itself? |
You don't have permission to push to that branch without my doing some setup, and there's also no real value to seeing so; just push to a branch either in your own repo or on the one this PR is based from (labeled at the top of this page, but I think @antifuchs gave you access to push to it?). It wouldn't be crazy to create a fresh PR for your new version of this. |
Updated the latest code in PR #2292. |
OK cool, we can close this one in favor of #2292 then. Thanks @aakash-cr7! |
My (and I believe many other people's) Zulip workflow involves muting a bunch of Topics that they're not interested in. Since the quickest way to do it currently is context-dependent and takes a bunch of key presses (
i, <down> <down> [<down>] enter
), I decided to add keyboard shortcuts for muting/unmuting.The mute action will show an alert about the muted topic that fades out over 4 seconds, and allows un-muting from the alert itself.
I hope you'll consider this for inclusion; I still need to sign the Dropbox CLA.