zulip-desktop icon indicating copy to clipboard operation
zulip-desktop copied to clipboard

[WIP] Mute organization badge and server count

Open kanishk98 opened this issue 6 years ago • 16 comments


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? image image

You have tested this PR on:

  • [x] Windows
  • [ ] Linux/Ubuntu
  • [ ] macOS

kanishk98 avatar Jan 14 '19 09:01 kanishk98

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. :)

kanishk98 avatar Jan 14 '19 11:01 kanishk98

@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 avatar Jan 14 '19 13:01 kanishk98

@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.

abhigyank avatar Jan 14 '19 14:01 abhigyank

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.

kanishk98 avatar Jan 14 '19 18:01 kanishk98

Some relevant discussion is here:

https://chat.zulip.org/#narrow/stream/101-design/topic/mute.20organization/near/683125

showell avatar Jan 16 '19 14:01 showell

@rishig anything else we should be doing here functionality wise?

akashnimare avatar Jan 21 '19 09:01 akashnimare

What does the setting currently do? Also, I think the conclusion was that this should be implemented in the webapp?

rishig avatar Jan 24 '19 14:01 rishig

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. :)

kanishk98 avatar Jan 24 '19 21:01 kanishk98

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.

rishig avatar Jan 24 '19 21:01 rishig

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.

zulipbot avatar Apr 18 '19 14:04 zulipbot

@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 -

image

akashnimare avatar Aug 13 '19 20:08 akashnimare

yeah, for sure; maybe called "None". Though I imagine the current setting solved most of the problem for most people.

rishig avatar Aug 14 '19 06:08 rishig

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.

kanishk98 avatar Aug 14 '19 13:08 kanishk98

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?

kanishk98 avatar Aug 14 '19 13:08 kanishk98

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.

akashnimare avatar Aug 14 '19 13:08 akashnimare

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.

rishig avatar Aug 14 '19 15:08 rishig