-
-
Notifications
You must be signed in to change notification settings - Fork 475
[WIP] Mute organization badge and server count #626
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
base: main
Are you sure you want to change the base?
Conversation
Adds mutedOrganizations object to settings.json file inside the app's data folder to keep track of muted organizations.
Depending on per-org setting, the app will now hide the badge count of certain servers. Fix unmute/mute confirmation prompt
@@ -117,6 +117,11 @@ class WebView extends BaseComponent { | |||
} | |||
|
|||
getBadgeCount(title) { | |||
const mutedOrganizations = ConfigUtil.getConfigItem('mutedOrganizations'); | |||
const { url } = this.props; | |||
if (!!mutedOrganizations[url]) { |
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.
Jus out of curiosity, any reason to use !!mutedOrganizations[url]
instead of simply mutedOrganizations[url]
?
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.
Not really, just the way I got used to. I'll change this along with the Travis fixes and squash the commits.
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.
The feature works as expected and required. Good work on that.
A couple of suggestions with implementation though -
- 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 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.
- Not sure about the design of the additions in the organisations page. Maybe @akashnimare would weigh in on that.
I attempted that initially by adding a
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. |
@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
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.
Thanks! I'll check that out. |
Some relevant discussion is here: https://chat.zulip.org/#narrow/stream/101-design/topic/mute.20organization/near/683125 |
618d0d9
to
49869d2
Compare
Individually handles refreshing UI without refreshing the whole app after user mutes/unmutes server for both context menu and org preferences pane. Also improves code readibility by removing !! operations. Mute individual orgs without refreshing entire app Fix Travis errors Fix Travis errors
49869d2
to
5fbd7d8
Compare
@rishig anything else we should be doing here functionality wise? |
What does the setting currently do? |
@@ -530,6 +533,29 @@ class ServerManagerView { | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: (mutedOrganizations[url] ? 'Unmute' : 'Mute') + ' organization', |
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.
Note that stuff like this is not going to work with translations
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 sorry, I didn't think about that. I'll need to have a look at how translations are currently handled. Will get to it.
The setting hides the number of unread messages in the sidebar and the tray icon for all muted organizations.
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 |
@kanishk98 any update on this? zulip/zulip#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". |
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? |
@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. |
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: