You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CRITICAL: Update Mute behavior to not show as unread in the LHN. #33619
Strategy:
Supporting a billion users requires supporting a wide variety of work styles. We know even from our early discussions that the behavior of the LHN is extremely personal, with very subtle variations resulting in significant visceral reactions. While we can't satisfy everyone (and if we think a particular flow is bad, we might not want to), all things being equal we should aim to be as inclusive of as many workflows as possible.
Problem:
Coming from this discussion, we've realized our current Mute behavior only partially mutes. It does disable realtime notifications on that channel, and also disables UnreadMessageSummary on that channel. But it still shows the chat as unread in the LHN. To avoid this LHN distraction requires someone to leave/join the channel frequently, which is cumbersome, and distracting to the rest of the channel (because of your leave/join messages).
Solution:
Mimic Slack and make Mute fully mute, by not showing as unread in the LHN. This has at least a few benefits:
It doesn't return it in the LHN when "Focus mode" is enabled (unless pinned), allowing for faster OpenApp/Reconnect app
It allows you to get notified by @here and @channel group mentions (which are presumed to be more important), without getting distracted by anything else.
It allows you to pin a chat for quick access without being distracted by if it's read/unread.
It allows you to read, post, and disappear without needing to explicitly leave, and without triggering any joined/left messages
So there are advantages to mimicking Slack's Mute behavior. Are there any disadvantages? Is anyone using our current Mute behavior who would be annoyed by this change?
DO NOT mark muted reports unread in the LHN (eg, in bold), even if they have unread messages
For this piece, it looks like "whether a chat is unread" in the LHN is determined here, by ReportUtils.isUnread. So I think we can update it to NOT mark muted reports as unread by simply updating that function like so:
diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts
index b41b74cd57..5a746b9e45 100644
--- a/src/libs/ReportUtils.ts+++ b/src/libs/ReportUtils.ts@@ -3269,6 +3269,10 @@ function isUnread(report: OnyxEntry<Report>): boolean {
return false;
}
+ if (report.notificationPreference === CONST.REPORT.NOTIFICATION_PREFERENCE.MUTE) {+ return false;+ }+
// lastVisibleActionCreated and lastReadTime are both datetime strings and can be compared directly
const lastVisibleActionCreated = report.lastVisibleActionCreated ?? '';
const lastReadTime = report.lastReadTime ?? '';
However, I think we'll want to control that by a flag, because there are other places where ReportUtils.isUnread is used, such as here, where we'd want to consider it unread even if its notification preference is MUTE
The source of my woes was that due to a recent change w/ reliable updates I needed to be running bwm. Ioni sent out an email and we're discussing running bwm as a service in the VM to make the dev environment more automatic.
changed the title [-]CRITICAL: Update `Mute` behavior to not show as unread in the LHN.[/-][+][HOLD] CRITICAL: Update `Mute` behavior to not show as unread in the LHN.[/+]on Jan 12, 2024
changed the title [-][HOLD] CRITICAL: Update `Mute` behavior to not show as unread in the LHN.[/-][+]CRITICAL: Update `Mute` behavior to not show as unread in the LHN.[/+]on Jan 21, 2024
PR put in for review. Just a note, I think I'll create an external follow-up issue to cover my changes with automated tests in the existing UnreadIndicatorsTest file. It can all be covered by automated tests, I just didn't take the time to build them. The manual testing takes a lot of time because there are so many scenarios, which to me suggests that this will be vulnerable to regressions. Therefore the automated tests will be valuable.
Activity
quinthar commentedon Dec 28, 2023
Optimistically assigning to @neil-marcellini as I know this was important to him.
roryabraham commentedon Dec 29, 2023
Coming from slack with my understanding of the requirements here. Update
OpenAppandReconnectAppto:I have a feeling these will be more complex than they might seem on the surface but I'm going to dig in here and try to come up with a plan.
melvin-bot commentedon Dec 29, 2023
Current assignee @roryabraham is eligible for the Engineering assigner, not assigning anyone new.
roryabraham commentedon Dec 29, 2023
Slight modification to the above:
roryabraham commentedon Dec 29, 2023
It looks like this should be relatively easy to accomplish by updating this
WHEREclause as follows:Draft PR for that piece here: https://github.com/Expensify/Auth/pull/9560
roryabraham commentedon Dec 29, 2023
For this piece, it looks like "whether a chat is unread" in the LHN is determined here, by
ReportUtils.isUnread. So I think we can update it to NOT mark muted reports as unread by simply updating that function like so:However, I think we'll want to control that by a flag, because there are other places where
ReportUtils.isUnreadis used, such as here, where we'd want to consider it unread even if its notification preference isMUTE7 remaining items
roryabraham commentedon Jan 5, 2024
The source of my woes was that due to a recent change w/ reliable updates I needed to be running bwm. Ioni sent out an email and we're discussing running bwm as a service in the VM to make the dev environment more automatic.
Anyways, during my testing I found that a number of things just weren't working as expected, and then I discovered that was due to a recent regression on staging. I created a PR to fix that regression that we'll want to CP to staging, but I was blocked on completing my testing until that's merged.
roryabraham commentedon Jan 12, 2024
Was trying to push this over the finish line today, but was blocked by an unrelated deploy blocker.
roryabraham commentedon Jan 12, 2024
Removing reviewing label so this doesn't appear greyed out in my K2
roryabraham commentedon Jan 12, 2024
This is currently blocked by #34466
[-]CRITICAL: Update `Mute` behavior to not show as unread in the LHN.[/-][+][HOLD] CRITICAL: Update `Mute` behavior to not show as unread in the LHN.[/+]quinthar commentedon Jan 21, 2024
#34466 has been merged, this is no longer blocked. What are next steps?
[-][HOLD] CRITICAL: Update `Mute` behavior to not show as unread in the LHN.[/-][+]CRITICAL: Update `Mute` behavior to not show as unread in the LHN.[/+]roryabraham commentedon Jan 22, 2024
PR put in for review. Just a note, I think I'll create an external follow-up issue to cover my changes with automated tests in the existing
UnreadIndicatorsTestfile. It can all be covered by automated tests, I just didn't take the time to build them. The manual testing takes a lot of time because there are so many scenarios, which to me suggests that this will be vulnerable to regressions. Therefore the automated tests will be valuable.quinthar commentedon Jan 23, 2024
Can you link the PR here? I'm not sure what you are referring to with "PR put in for review".
roryabraham commentedon Jan 24, 2024
This is the PR: #33779
quinthar commentedon Jan 26, 2024
Woohoo deployed to staging!