Skip to content

Conversation

seanstrom
Copy link
Member

@seanstrom seanstrom commented Apr 21, 2025

fixes #22110
fixes #22520

Related Figma Designs: https://www.figma.com/design/JlpPhJp0SMnEyBQy4nOZHo/Settings----Mobile?node-id=9076-64860&t=LcQeTqpusDFjU8Lq-4

Summary

  • This PR attempts to update the Notification settings screen with latest design components for nested notifications settings.
  • This PR attempts to update the Notification settings screen to check if the OS permissions are blocked for the device, and if they are we'll display a banner.
  • This PR also attempts to update the onboarding and upgrading experience to prompt the user with the "Enable Notifications" screen.
    • Notably, we use the react-mmkv dependency for storing some state for each user profile.
      • In this case we store whether a user profile has confirmed if they want to enable notifications.

Review notes

Here's some of the flows that I've tested to show the intended behaviour

Note, please enable the feature-flag news-notifications under the settings section. Here's a screen capture of me shaking the device to enable the feature flag during onboarding.

Feature-Flag.Activation.mp4
Description Video
Create Profile - New Profile
Create.Profile.-.New.Profile.mp4
Create Profile - Recover Profile
Create.Profile.-.Recover.Profile.mp4
Create Profile - Empty Keycard
Create.Profile.-.Empty.Keycard.mp4
Login Profile - Sync Profile
Login.Profile.-.Sync.Profile.mp4
Login Profile - Existing Profile after upgrade
Login.Profile.-.Existing.Profile.needing.prompt.mp4
Notifications Settings - Permissions Blocked Banner Android
Notification.Settings.-.Permissions.Banner.mp4
Notifications Settings - Permissions Blocked Banner iOS
Notification.Settings.-.Permissions.Banner.iOS.mp4

Testing notes

Platforms

  • Android
  • iOS

Areas that may be impacted

Functional

  • Onboarding new account
    • Signup
    • Recovery
    • Sync
  • Login after upgrade
  • Notification settings

Steps to test

The steps to test the scope of this PR is mainly to confirm that

  • the onboarding flows now show the "Enable Notifications" screen
  • the notification settings screen displays the settings based on the recent designs
  • the upgrade flow for existing users will display the "Enable Notifications" screen after login
  • the "Enable Notifications" screen is only shown once for each profile
    • during onboarding
    • or after login (when upgrading app versions)

For testing the push notifications themselves, here's a document describing the process, but that might be out-of-scope of this PR. Likely we'll need to test this soon, but maybe it can wait for when we remove the feature flag (?)

Here's the doc: https://www.notion.so/How-to-manually-test-News-Push-Notifications-1ed8f96fb65c80ae84ecf27be6b61067?pvs=4

status: ready

@seanstrom seanstrom self-assigned this Apr 21, 2025
@status-github-bot-v2 status-github-bot-v2 bot moved this from REVIEW to CONTRIBUTOR in Pipeline for QA Apr 21, 2025
@seanstrom seanstrom changed the title WIP: Implement onboarding and upgrade flows for Enable Notifications screen WIP: Update the enable-notifications flows and notification settings UI Apr 21, 2025
@status-im-auto
Copy link
Member

status-im-auto commented Apr 21, 2025

Jenkins Builds

Click to see older builds (93)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 4fbb410 #1 2025-04-21 14:43:30 ~4 min tests 📄log
✔️ 4fbb410 #1 2025-04-21 14:46:18 ~7 min android-e2e 🤖apk 📲
✔️ 4fbb410 #1 2025-04-21 14:48:57 ~10 min android 🤖apk 📲
✔️ 4fbb410 #1 2025-04-21 14:52:22 ~13 min ios 📱ipa 📲
e70472f #2 2025-04-22 07:17:04 ~3 min tests 📄log
✔️ e70472f #2 2025-04-22 07:22:26 ~8 min android-e2e 🤖apk 📲
✔️ e70472f #2 2025-04-22 07:23:12 ~9 min android 🤖apk 📲
✔️ e70472f #2 2025-04-22 07:26:12 ~12 min ios 📱ipa 📲
✔️ abbf4d0 #3 2025-04-22 09:55:56 ~5 min tests 📄log
✔️ abbf4d0 #3 2025-04-22 09:58:13 ~7 min android-e2e 🤖apk 📲
✔️ abbf4d0 #3 2025-04-22 10:00:23 ~9 min android 🤖apk 📲
✔️ abbf4d0 #3 2025-04-22 10:05:09 ~14 min ios 📱ipa 📲
6f54b9b #4 2025-04-23 15:15:05 ~2 min tests 📄log
✔️ 6f54b9b #4 2025-04-23 15:21:09 ~8 min android-e2e 🤖apk 📲
✔️ 6f54b9b #4 2025-04-23 15:21:48 ~9 min android 🤖apk 📲
✔️ 6f54b9b #4 2025-04-23 15:26:10 ~13 min ios 📱ipa 📲
7bfbd86 #5 2025-05-07 12:15:39 ~2 min tests 📄log
✔️ 7bfbd86 #5 2025-05-07 12:21:34 ~8 min android-e2e 🤖apk 📲
✔️ 7bfbd86 #5 2025-05-07 12:22:09 ~9 min android 🤖apk 📲
✔️ 7bfbd86 #5 2025-05-07 12:25:09 ~12 min ios 📱ipa 📲
5374b35 #6 2025-05-08 08:29:20 ~2 min tests 📄log
✔️ 5374b35 #6 2025-05-08 08:34:57 ~8 min android 🤖apk 📲
✔️ 5374b35 #6 2025-05-08 08:35:04 ~8 min android-e2e 🤖apk 📲
✔️ 5374b35 #6 2025-05-08 08:40:38 ~14 min ios 📱ipa 📲
c45b399 #7 2025-05-08 10:00:15 ~2 min tests 📄log
✔️ c45b399 #7 2025-05-08 10:05:54 ~8 min android-e2e 🤖apk 📲
✔️ c45b399 #7 2025-05-08 10:06:20 ~8 min android 🤖apk 📲
✔️ c45b399 #7 2025-05-08 10:08:47 ~11 min ios 📱ipa 📲
029cc19 #8 2025-05-08 11:54:28 ~2 min tests 📄log
✔️ 029cc19 #8 2025-05-08 12:00:35 ~8 min android-e2e 🤖apk 📲
✔️ 029cc19 #8 2025-05-08 12:01:03 ~9 min android 🤖apk 📲
✔️ 029cc19 #8 2025-05-08 12:03:48 ~11 min ios 📱ipa 📲
c44e04b #9 2025-05-08 14:42:25 ~3 min tests 📄log
✔️ c44e04b #9 2025-05-08 14:46:14 ~7 min android-e2e 🤖apk 📲
✔️ c44e04b #9 2025-05-08 14:46:58 ~7 min android 🤖apk 📲
✔️ c44e04b #9 2025-05-08 14:52:30 ~13 min ios 📱ipa 📲
2a9758b #10 2025-05-08 16:49:25 ~2 min tests 📄log
✔️ 2a9758b #10 2025-05-08 16:53:25 ~6 min android-e2e 🤖apk 📲
✔️ 2a9758b #10 2025-05-08 16:55:21 ~8 min android 🤖apk 📲
✔️ 2a9758b #10 2025-05-08 16:57:55 ~11 min ios 📱ipa 📲
043722c #11 2025-05-09 16:03:16 ~2 min tests 📄log
✔️ 043722c #11 2025-05-09 16:08:00 ~7 min android 🤖apk 📲
✔️ 043722c #11 2025-05-09 16:08:35 ~8 min android-e2e 🤖apk 📲
✔️ 043722c #11 2025-05-09 16:12:40 ~12 min ios 📱ipa 📲
b67e243 #12 2025-05-11 14:09:07 ~2 min tests 📄log
✔️ b67e243 #12 2025-05-11 14:15:12 ~9 min android-e2e 🤖apk 📲
✔️ b67e243 #12 2025-05-11 14:15:42 ~9 min android 🤖apk 📲
✔️ b67e243 #12 2025-05-11 14:18:34 ~12 min ios 📱ipa 📲
e9f7b1b #13 2025-05-12 09:00:08 ~2 min tests 📄log
✔️ e9f7b1b #13 2025-05-12 09:05:52 ~8 min android-e2e 🤖apk 📲
✔️ e9f7b1b #13 2025-05-12 09:06:36 ~9 min android 🤖apk 📲
✔️ e9f7b1b #13 2025-05-12 09:09:17 ~12 min ios 📱ipa 📲
✖️ 78bdf89 #14 2025-05-12 10:11:02 ~4 min tests 📄log
✔️ 78bdf89 #14 2025-05-12 10:15:21 ~8 min android-e2e 🤖apk 📲
✔️ 78bdf89 #14 2025-05-12 10:15:53 ~9 min android 🤖apk 📲
✔️ 78bdf89 #14 2025-05-12 10:19:13 ~12 min ios 📱ipa 📲
✖️ a6d5aa0 #15 2025-05-12 12:30:41 ~4 min tests 📄log
✔️ a6d5aa0 #15 2025-05-12 12:34:44 ~8 min android-e2e 🤖apk 📲
✔️ a6d5aa0 #15 2025-05-12 12:35:18 ~9 min android 🤖apk 📲
✔️ a6d5aa0 #15 2025-05-12 12:37:24 ~11 min ios 📱ipa 📲
✖️ c192036 #16 2025-05-12 13:06:38 ~6 min tests 📄log
✔️ c192036 #16 2025-05-12 13:09:51 ~9 min android-e2e 🤖apk 📲
✔️ c192036 #16 2025-05-12 13:10:23 ~10 min android 🤖apk 📲
✔️ c192036 #16 2025-05-12 13:17:27 ~17 min ios 📱ipa 📲
✖️ 748a1cc #17 2025-05-12 14:45:40 ~4 min tests 📄log
✔️ 748a1cc #17 2025-05-12 14:49:29 ~8 min android-e2e 🤖apk 📲
✔️ 748a1cc #17 2025-05-12 14:50:06 ~9 min android 🤖apk 📲
✔️ 748a1cc #17 2025-05-12 14:54:57 ~13 min ios 📱ipa 📲
✖️ e582ac9 #18 2025-05-13 10:12:57 ~4 min tests 📄log
✔️ e582ac9 #18 2025-05-13 10:16:03 ~7 min android 🤖apk 📲
✔️ e582ac9 #18 2025-05-13 10:17:36 ~9 min android-e2e 🤖apk 📲
✔️ e582ac9 #18 2025-05-13 10:23:54 ~15 min ios 📱ipa 📲
✖️ 7a73fa2 #20 2025-05-13 12:29:23 ~5 min tests 📄log
✔️ 7a73fa2 #20 2025-05-13 12:34:35 ~10 min android-e2e 🤖apk 📲
✔️ 7a73fa2 #20 2025-05-13 12:35:15 ~10 min android 🤖apk 📲
✔️ 7a73fa2 #20 2025-05-13 12:37:31 ~13 min ios 📱ipa 📲
✖️ 1b02878 #21 2025-05-14 14:20:58 ~5 min tests 📄log
✔️ 1b02878 #21 2025-05-14 14:24:38 ~8 min android-e2e 🤖apk 📲
✔️ 1b02878 #21 2025-05-14 14:25:15 ~9 min android 🤖apk 📲
✔️ 1b02878 #21 2025-05-14 14:29:37 ~13 min ios 📱ipa 📲
✖️ c979ef2 #22 2025-05-14 14:52:17 ~4 min tests 📄log
✖️ 630e92e #23 2025-05-14 15:00:52 ~4 min tests 📄log
✔️ 630e92e #23 2025-05-14 15:05:02 ~8 min android-e2e 🤖apk 📲
✔️ 630e92e #23 2025-05-14 15:05:50 ~9 min android 🤖apk 📲
✔️ 630e92e #23 2025-05-14 15:08:19 ~12 min ios 📱ipa 📲
✖️ 42cfd8a #24 2025-05-15 12:27:17 ~4 min tests 📄log
✔️ 42cfd8a #24 2025-05-15 12:30:08 ~7 min android-e2e 🤖apk 📲
✔️ 42cfd8a #24 2025-05-15 12:31:53 ~9 min android 🤖apk 📲
✔️ 42cfd8a #24 2025-05-15 12:34:33 ~12 min ios 📱ipa 📲
✖️ 60cd271 #25 2025-05-16 11:43:24 ~4 min tests 📄log
✔️ 60cd271 #25 2025-05-16 11:45:55 ~7 min android-e2e 🤖apk 📲
✔️ 60cd271 #25 2025-05-16 11:47:37 ~9 min android 🤖apk 📲
✔️ 60cd271 #25 2025-05-16 11:53:43 ~15 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✖️ 1ee1fd3 #26 2025-05-19 09:02:24 ~4 min tests 📄log
✔️ 1ee1fd3 #26 2025-05-19 09:05:52 ~8 min android-e2e 🤖apk 📲
✔️ 1ee1fd3 #26 2025-05-19 09:06:25 ~8 min android 🤖apk 📲
✔️ 1ee1fd3 #26 2025-05-19 09:11:24 ~13 min ios 📱ipa 📲
✔️ a5bdf6e #27 2025-05-19 10:20:08 ~4 min tests 📄log
✔️ a5bdf6e #27 2025-05-19 10:24:04 ~8 min android-e2e 🤖apk 📲
✔️ a5bdf6e #27 2025-05-19 10:24:42 ~9 min android 🤖apk 📲
✔️ a5bdf6e #27 2025-05-19 10:27:36 ~12 min ios 📱ipa 📲

@seanstrom seanstrom force-pushed the seanstrom/news-notifications-ui branch 2 times, most recently from abbf4d0 to 6f54b9b Compare April 23, 2025 15:12
@seanstrom seanstrom force-pushed the seanstrom/news-notifications-ui branch from 6f54b9b to 7bfbd86 Compare May 7, 2025 12:12
Comment on lines 111 to 112
notifications-settings? (= (get-in db [:view-id])
:screen/settings.notifications)
Copy link
Member Author

Choose a reason for hiding this comment

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

This value is used inside the event that's called when the app returns from being in the background. For example, when we return from outside the app, we'll check if we've returned to the notification settings screen so we can refresh the permissions state.

Copy link
Contributor

Choose a reason for hiding this comment

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

(= (get-in db [:view-id])  :screen/settings.notifications)

->

(= (:view-id db) :screen/settings.notifications)

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if instead we could add a handler in the screen mounted (by using use-effect or something related). If we can't, it's ok to keep it here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I wonder if instead we could add a handler in the screen mounted (by using use-effect or something related). If we can't, it's ok to keep it here.

I remember trying to use a hook for detecting when the screen is mounted, but it doesn't seem like the screen is re-mounted when returning from a background state, which lead to hooking into the event here.

However, there's a chance we could try creating a hook that uses a re-frame subscription, and we can somehow use that hook in the view to trigger changes when the app returns from the background (?) Just an idea but maybe that will make it easier to extend the app.

{:dispatch [:biometric/authenticate {:on-fail on-biometric-auth-fail}]})
#(when notifications-settings?
{:dispatch [:notifications/check-notifications-blocked]}))))
Copy link
Member Author

Choose a reason for hiding this comment

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

Here we're conditionally dispatching the :notifications/check-notifications-blocked event to refresh the screen UI if the user has recently unblocked or allowed notification permissions from outside the Status app and then returned to the notifications settings screen.

Comment on lines +98 to +101

(defn open-notification-settings
[]
(openSettings "notifications"))
Copy link
Member Author

Choose a reason for hiding this comment

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

Here we're creating a function that should open the OS system settings screen for the app, and if possible it will display the notification related settings for the app (from the OS System pov, not inside Status app).

Comment on lines +36 to +38
:on-press #(rf/dispatch [:onboarding/biometrics-setup-start
{:enable-biometrics? true
:syncing? syncing?}])}
Copy link
Member Author

Choose a reason for hiding this comment

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

Here we're using a different pattern for dispatching events from the onboarding screens. Instead of dispatching different events from the screen, we attempt to dispatch the same event with different parameters.

This pattern is an attempt to simplify how we manage the onboarding screens, for example, if we choose to expand the onboarding steps, it would be ideal that we can refactor mostly the event layer instead of needing to refactor both the event layer and view layer.

Comment on lines 320 to 322
{:notifications-blocked? (boolean notifications-blocked?)
:notifications-enabled? (and (boolean notifications-enabled?)
(not (boolean notifications-blocked?)))
Copy link
Member Author

Choose a reason for hiding this comment

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

Here we're expanding this subscription to include whether the notifications have been blocked at the OS level.

Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose (not (boolean notifications-blocked? is unnecessary and could be just (not notifications-blocked? because not will already coerce values to booleans. If you really want to make sure the sub value is a boolean you could call boolean only once outside the conditionals, or better yet, when reading profile data from status-go, thus coercing on write, which leads to less type mismatch issues (but I think it's not worth it for these flags tbh).

But do we even need this external extra boolean call? notifications-blocked? and notifications-enabled? seem to be either nil or a boolean and there's no risk of it being a seq, which could be kind of a problem in sub values that should be truthy/falsy values.

Copy link
Member Author

Choose a reason for hiding this comment

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

The main reason for the extra boolean expressions is to ensure we're not passing nil into the quo components for things related to boolean states. I recall there being some issues with how nil handled differently than false.

But I can revise this subscription to at least re-use the (boolean notifications-blocked?) expression

Copy link
Contributor

Choose a reason for hiding this comment

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

Most likely, if there's any part of the code that can't work with nil instead of an explicit false it should be revisited because it's asking for bugs. Idiomatic Clojure embraces nullable booleans. I know of one place in our repo where a value can be a tri-state boolean, but this should be very rare.

Comment on lines 32 to 34
(fn [{:keys [fcm-token]}]
(logger/log-debug "registered fcm token for status news"
;; NOTE(@seanstrom): temporarily avoid logging fcm-token
#_{:fcm-token fcm-token})))
{:fcm-token fcm-token})))
Copy link
Member Author

Choose a reason for hiding this comment

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

Here we're temporarily logging the Firebase token after successfully registering with Firebase for Status news notifications. This likely should not be logged in production, so this change has been marked as "donotmerge", but it still is required for testing, so we'll keep it in the PR for now.

Comment on lines 102 to +103
:else
[[:dispatch [:update-theme-and-init-root :screen/shell-stack]]
[:dispatch [:profile/toggle-testnet-mode-banner]]]))})))
[[:dispatch [:shell/show-root-view]]]))})))
Copy link
Member Author

Choose a reason for hiding this comment

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

Here we're introducing a new event for representing when we want to show root shell-stack of the app. This is being introduced because we needed a common place to check whether someone has been prompted with the screen for the notification permissions, and we needed to cover all the possible ways someone could arrive to the app including:

  • login
  • signup
  • recovery
  • syncing

Comment on lines 349 to 335
temporary-display-name?
enable-news-notifications?
enable-notifications?]} (:onboarding/profile db)
{:keys [key-uid] :as profile} (:profile/profile db)
biometric-enabled? (= auth-method constants/auth-method-biometric)]
{:db (assoc db :onboarding/generated-keys? true)
:fx [(when temporary-display-name?
[:dispatch [:profile/set-default-profile-name profile]])
(when biometric-enabled?
[:keychain/save-password-and-auth-method
{:key-uid key-uid
:masked-password (if syncing?
password
(security/hash-masked-password password))
:on-success (fn []
(rf/dispatch [:onboarding/set-auth-method auth-method])
(when syncing?
(rf/dispatch
[:onboarding/finish-onboarding false])))
:on-error #(log/error "failed to save biometrics"
{:key-uid key-uid
:error %})}])]})))
:fx (cond->
[(when temporary-display-name?
[:dispatch [:profile/set-default-profile-name profile]])
(when biometric-enabled?
[:keychain/save-password-and-auth-method
{:key-uid key-uid
:masked-password (if syncing?
password
(security/hash-masked-password password))
:on-success (fn []
(rf/dispatch [:onboarding/set-auth-method auth-method])
(when syncing?
(rf/dispatch
[:onboarding/finish-onboarding])))
:on-error #(log/error "failed to save biometrics"
{:key-uid key-uid
:error %})}])]

(and enable-notifications?
enable-news-notifications?)
(conj [:dispatch
[:notifications/news-notifications-switch true]])

enable-notifications?
(conj [:dispatch
[:push-notifications/switch true]]))})))
Copy link
Member Author

Choose a reason for hiding this comment

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

Here we're expanding the :onboarding/finalize-setup event to handle the activation of the push notification settings if the user has opted-in.

Comment on lines 269 to 220
{:db (assoc db :profile/profiles-overview multiaccounts)
:fx (cond-> []
(ff/enabled? ::ff/settings.news-notifications)
(conj [:effects.profile/remove-local-profile-storage
{:key-uid key-uid}])
(not (seq multiaccounts))
(conj [:dispatch
[:update-theme-and-init-root :screen/onboarding.intro]]))}))
Copy link
Member Author

Choose a reason for hiding this comment

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

Here we're extending the :onboarding/on-delete-profile-success event to remove any profile related data that had been stored inside the mmkv storage via the key-uid.

@seanstrom seanstrom force-pushed the seanstrom/news-notifications-ui branch from 5374b35 to c45b399 Compare May 8, 2025 09:57
@seanstrom seanstrom changed the title WIP: Update the enable-notifications flows and notification settings UI Update the enable-notifications flows and notification settings UI May 8, 2025
@seanstrom seanstrom changed the title Update the enable-notifications flows and notification settings UI feat: Update the enable-notifications flows and notification settings UI May 8, 2025
@seanstrom seanstrom force-pushed the seanstrom/news-notifications-ui branch 2 times, most recently from 2a9758b to 043722c Compare May 9, 2025 16:00
Comment on lines +28 to +36
(defn notifications-info-view
[{:keys [blur?]}]
[quo/documentation-drawers
{:title (i18n/label :t/enable-notifications)
:show-button? true
:shell? blur?
:button-label (i18n/label :t/read-more)
:button-icon :i/info}
[quo/text (i18n/label :t/enable-notifications-info-description)]])
Copy link
Member Author

Choose a reason for hiding this comment

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

This drawer view still needs the correct verbiage from the docs team (I think ?)
Reference: https://www.figma.com/design/JlpPhJp0SMnEyBQy4nOZHo/Settings----Mobile?node-id=9395-120255&t=IZIHOX0Oys0QGyTf-4

Comment on lines 70 to 78
(when (and platform/android?
(ff/enabled? ::ff/settings.news-notifications))
[rn/view
{:style style/news-notifications-checkbox-container}
[quo/selectors
{:type :checkbox
:blur? true
:checked? third-party-checked?
:on-change set-third-party-checked}]
Copy link
Member Author

Choose a reason for hiding this comment

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

Here we're only showing the third-party services checkbox (activation for news-notifications) on Android. On iOS the setting will be active by default (based on the designs).

Comment on lines 52 to 55
set-third-party-checked] (rn/use-state
(if (ff/enabled? ::ff/settings.news-notifications)
true
false))
Copy link
Member Author

Choose a reason for hiding this comment

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

Here we're defaulting the third-party services option to true when we make news-notifications available. On Android, users will be able to opt-out of this feature.

Copy link
Contributor

Choose a reason for hiding this comment

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

(if condition? true false)

Seems a bit uncommon to me, what about just (boolean condition?), or if condition? already is a boolean (it should be because of ?) just condition?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I intentionally made it so unappealing because I thought leaving a (ff/enabled?) expression might seem to subtle. But I agree it should be flattened, I mainly wanted to draw attention to this weird part of the code 😄

Comment on lines 48 to 57
(and biometrics? onboarding? syncing?)
(conj [:dispatch [:onboarding/finalize-setup]])

(and biometrics? onboarding? (not syncing?))
(conj [:dispatch [:onboarding/create-account-and-login]])

(and (not biometrics?) onboarding? syncing?)
(conj [:dispatch [:onboarding/finish-onboarding]])

(and (not biometrics?) onboarding? (not syncing?))
(conj [:dispatch [:onboarding/create-account-and-login]])

(and (not biometrics?) (not onboarding?) (not syncing?))
(conj [:dispatch [:shell/show-root-view]]))})
Copy link
Member Author

Choose a reason for hiding this comment

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

This logic was extracted from a few places related to the biometrics onboarding screen, onboarding events, and login events. The gist of this code is to correctly dispatch the continuation event based on whether we're onboarding with or without syncing (and with or without biometrics), or if it's a login.

Comment on lines +70 to +68
current-view-id (if (= db-view-id :screen/onboarding.syncing-biometric)
:screen/onboarding.enable-biometrics
db-view-id)]
Copy link
Member Author

Choose a reason for hiding this comment

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

Here we're handling a special case when attempting to navigate from the current view to the notification setup screen. During the onboarding flow with syncing, we've aliased to the onboarding view-id to :screen/onboarding.syncing-biometric, but that is not correct view-id for performing a navigation, so I replace it with the correct view-id

Comment on lines 134 to 141
(defn inject-local-profile-storage
[context]
(let [db (interceptor/get-coeffect context :db)
key-uid (get-in db [:profile/profile :key-uid])
local-profile (mmkv/get-object key-uid)]
(assoc-in context
[:coeffects :local-profile-storage]
local-profile)))
Copy link
Member Author

Choose a reason for hiding this comment

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

Here's an implementation of a Re-Frame interceptor that synchronously accesses the mmkv key-value store, and it retrieves some metadata about a user profile via the key-uid.

seanstrom added 25 commits May 19, 2025 11:10
…ding or login when displaying the enable-notifications screen
# 50-character subject line
#
# 72-character wrapped longer description.
#
# * Maybe try answering these questions: *
# * What did I change? *
# * Why did I change it? *
# * How did I change it? *
@seanstrom seanstrom force-pushed the seanstrom/news-notifications-ui branch from 1ee1fd3 to a5bdf6e Compare May 19, 2025 10:15
@seanstrom seanstrom merged commit 13959f6 into develop May 19, 2025
5 checks passed
@seanstrom seanstrom deleted the seanstrom/news-notifications-ui branch May 19, 2025 13:00
@github-project-automation github-project-automation bot moved this from MERGE to DONE in Pipeline for QA May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: DONE
Development

Successfully merging this pull request may close these issues.

Update the onboarding experience to allow users to enable notifications Update the Notification settings UI with the current design system
6 participants