Skip to content
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

fix(ActivityCenter): Simplify and fix AC notifications read/unread states #12753

Conversation

MishkaRogachev
Copy link
Contributor

@MishkaRogachev MishkaRogachev commented Nov 15, 2023

Close #12619

What does the PR do

  • Simplify read and unread states for AC notifications making them match status-go state
  • Remove accept and dismiss actions (completely handled in status-go)
  • Mark all read marks ALL notifications as read (it's how it's implemented in status-go)
  • Fix wrong disabled state for Mark all read

Affected areas

Activity center

Screenshot of functionality (including design for comparison)

Screen.Recording.2023-11-16.at.14.35.23.mov

@MishkaRogachev MishkaRogachev linked an issue Nov 15, 2023 that may be closed by this pull request
@status-im-auto
Copy link
Member

status-im-auto commented Nov 15, 2023

Jenkins Builds

Click to see older builds (7)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 397239e #1 2023-11-15 18:57:43 ~6 min tests/nim 📄log
✔️ 397239e #1 2023-11-15 18:59:21 ~7 min macos/aarch64 🍎dmg
✔️ 397239e #1 2023-11-15 19:02:53 ~11 min tests/ui 📄log
✔️ 397239e #1 2023-11-15 19:03:05 ~11 min macos/x86_64 🍎dmg
✔️ 397239e #1 2023-11-15 19:06:47 ~15 min linux/x86_64 📦tgz
✔️ 397239e #1 2023-11-15 19:18:53 ~27 min windows/x86_64 💿exe
✔️ 397239e #1 2023-11-15 19:24:15 ~32 min tests/e2e 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 12fc931 #2 2023-11-16 10:45:46 ~8 min macos/x86_64 🍎dmg
✔️ 12fc931 #2 2023-11-16 10:46:13 ~8 min macos/aarch64 🍎dmg
✔️ 12fc931 #2 2023-11-16 10:48:55 ~11 min tests/nim 📄log
✔️ 12fc931 #2 2023-11-16 10:51:31 ~14 min linux/x86_64 📦tgz
✔️ 12fc931 #2 2023-11-16 10:52:04 ~14 min tests/ui 📄log
✔️ 12fc931 #2 2023-11-16 10:58:52 ~21 min windows/x86_64 💿exe
✔️ 12fc931 #2 2023-11-16 11:13:58 ~36 min tests/e2e 📄log
✔️ cd661be #6 2023-11-17 10:27:10 ~4 min tests/nim 📄log
✔️ cd661be #5 2023-11-17 10:27:38 ~5 min macos/aarch64 🍎dmg
✔️ cd661be #5 2023-11-17 10:31:20 ~9 min macos/x86_64 🍎dmg
✔️ cd661be #5 2023-11-17 10:31:59 ~10 min tests/ui 📄log
✔️ cd661be #5 2023-11-17 10:35:07 ~13 min linux/x86_64 📦tgz
✔️ cd661be #5 2023-11-17 10:48:43 ~27 min windows/x86_64 💿exe
✖️ cd661be #5 2023-11-17 10:54:09 ~32 min tests/e2e 📄log
✔️ cd661be #6 2023-11-17 12:59:42 ~30 min tests/e2e 📄log

@MishkaRogachev MishkaRogachev force-pushed the fix/12619-mark-all-as-read-is-broken-in-the-activity-center branch from 397239e to 12fc931 Compare November 16, 2023 10:37
@MishkaRogachev MishkaRogachev marked this pull request as ready for review November 16, 2023 10:38
Copy link
Member

@jrainville jrainville left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job. It's way cleaner!

@@ -54,36 +54,32 @@ proc init*(self: Controller) =
self.events.on(activity_center_service.SIGNAL_ACTIVITY_CENTER_NOTIFICATIONS_LOADED) do(e: Args):
let args = ActivityCenterNotificationsArgs(e)
self.delegate.addActivityCenterNotifications(args.activityCenterNotifications)
self.delegate.hasUnseenActivityCenterNotificationsChanged()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the module could call this signal on itself instead of the controller doing it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed (others also)

if (evArgs.notificationIds.len > 0):
self.delegate.markActivityCenterNotificationReadDone(evArgs.notificationIds)
self.delegate.unreadActivityCenterNotificationsCountChanged()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing here

if (evArgs.notificationIds.len > 0):
self.delegate.markActivityCenterNotificationUnreadDone(evArgs.notificationIds)
self.delegate.unreadActivityCenterNotificationsCountChanged()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same


self.events.on(activity_center_service.SIGNAL_ACTIVITY_CENTER_MARK_ALL_NOTIFICATIONS_AS_READ) do(e: Args):
self.delegate.markAllActivityCenterNotificationsReadDone()
self.delegate.unreadActivityCenterNotificationsCountChanged()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

src/app_service/service/community_tokens/service.nim Outdated Show resolved Hide resolved
@MishkaRogachev MishkaRogachev force-pushed the fix/12619-mark-all-as-read-is-broken-in-the-activity-center branch from fabbcb8 to 7178455 Compare November 17, 2023 10:20
@MishkaRogachev MishkaRogachev force-pushed the fix/12619-mark-all-as-read-is-broken-in-the-activity-center branch from 7178455 to cd661be Compare November 17, 2023 10:21
Copy link
Contributor

@igor-sirotin igor-sirotin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much cleaner indeed! 👍
Always happy to see more code removed than added 😄

self.events.emit(SIGNAL_ACTIVITY_CENTER_NOTIFICATIONS_COUNT_MAY_HAVE_CHANGED, Args())
let notificationIds = @[notificationId]
discard backend.markActivityCenterNotificationsRead(notificationIds)
self.events.emit(SIGNAL_ACTIVITY_CENTER_MARK_NOTIFICATIONS_AS_READ, ActivityCenterNotificationIdsArgs(notificationIds: notificationIds))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly are the cases when we still need to emit SIGNAL_ACTIVITY_CENTER_NOTIFICATIONS_COUNT_MAY_HAVE_CHANGED? You removed it in a few places, but it's still there sometimes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were extra calls, but its still needed

@MishkaRogachev MishkaRogachev merged commit 7830310 into master Nov 20, 2023
8 of 9 checks passed
@MishkaRogachev MishkaRogachev deleted the fix/12619-mark-all-as-read-is-broken-in-the-activity-center branch November 20, 2023 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mark all as Read is broken in the Activity Center
4 participants