zulip-desktop
zulip-desktop copied to clipboard
[WIP] Mute organization badge and server count
What's this PR do? Adds context menu and settings option to mute/unmute badge count of connected organizations.
Any background context you want to provide? https://github.com/zulip/zulip-electron/issues/623 should provide the required context. Please also have a look at the chat thread referenced.
Screenshots?
You have tested this PR on:
- [x] Windows
- [ ] Linux/Ubuntu
- [ ] macOS
Instead of storing whether org is muted in configutil, I think i'd be better to store that as a property of the org in domain-util.json.
I attempted that initially by adding a notify
flag to the serverConf
object, but this approach didn't work out for zulipdev.org
servers. The flag would get added and then removed from the file. This was before you helped me with the console logs; I'll let you know how this goes.
I feel Muting/Unmuting a realm causing a refresh could be inconvenience to the user. I feel we should be able to do maybe to this without refreshing.
I agree. I'll get to work. :)
@abhigyank the latest commit addresses the refresh problem, but behaviour is undesirable in one case - if the user is on the org preferences page and then mutes an org using the context menu, it does not trigger an update of the DOM element in the pane. My initial intuition is that if we can keep track of where the user is in the app, then we can figure out a way to cause the update in the preferences page if the user mutes the organization using the context menu.
@kanishk98 the unread count now doesn't change for me in any case. Now since we are not reloading the app, you would need explicitly remove the badge count of the div server-tab-badge
of that icon.
if the user is on the org preferences page and then mutes an org using the context menu, it does not trigger an update of the DOM element in the pane.
Not sure how we can tackle this but I think we can make use of IPCRenderers 'forward-message' feature here.
Ah, sorry. Should've checked thoroughly.
Not sure how we can tackle this but I think we can make use of IPCRenderers 'forward-message' feature here.
Thanks! I'll check that out.
Some relevant discussion is here:
https://chat.zulip.org/#narrow/stream/101-design/topic/mute.20organization/near/683125
@rishig anything else we should be doing here functionality wise?
What does the setting currently do? Also, I think the conclusion was that this should be implemented in the webapp?
What does the setting currently do?
The setting hides the number of unread messages in the sidebar and the tray icon for all muted organizations.
Also, I think the conclusion was that this should be implemented in the webapp?
If you see this thread, you'll see that the last few messages indicate that the feature is required in the desktop app too. One of the suggestions from the community (see https://github.com/zulip/zulip-electron/issues/623#issuecomment-454795980) is to extend this functionality to other environments, but this is certainly needed on the desktop. :)
ah, I guess we should have been more explicit. Given that it needs to be reflected on all clients, the setting should be stored on the UserProfile object on the server, and controlled by something in the webapp's settings page. That single setting will control how we set unread counts on desktop/mobile/terminal/web.
Heads up @kanishk98, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/master
branch and resolve your pull request's merge conflicts accordingly.
@kanishk98 any update on this? https://github.com/zulip/zulip/pull/12677 should be helpful I guess. @rishig would it make sense to add an option like the following to mute an org in the desktop app -
yeah, for sure; maybe called "None". Though I imagine the current setting solved most of the problem for most people.
I'm confused about the discussion here - given that people can now control their notifications across all clients from the web app and we read notifications from the favicon updates, I thought the conclusion here was to move such settings to the web app and continue as is with the desktop app.
If we're planning to also include a similar setting on the desktop app, how does that add more to what's on the web app right now?
yeah, for sure; maybe called "None".
@kanishk98 if we add this in the webapp then we can re-use it in the desktop app to add muting org feature.
I also agree with Kanishk's intuition; I think we likely don't need a separate desktop app feature for this. The benefit of having settings in the webapp is that those settings will translate to mobile as well.