-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Android] "What’s New" promo message: Implement pixels #7292
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: feature/ana/android_whats_new_promo_message_add_the_new_ui_elements
Are you sure you want to change the base?
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
...l/src/main/java/com/duckduckgo/remote/messaging/impl/ui/CardsListRemoteMessagePixelHelper.kt
Show resolved
Hide resolved
| binding.headerImage.setImageResource(it.placeholder.drawable(true)) | ||
| binding.headerTitle.text = it.titleText | ||
| binding.actionButton.text = it.primaryActionText | ||
| viewModel.onMessageShown() |
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.
Bug: Missing duplicate prevention for "shown" pixels
The onMessageShown() call in render() lacks the duplicate prevention check present in the existing RemoteMessageView. The ViewModel computes newMessage (line 70) but doesn't include it in ViewState or use it to guard pixel firing. In contrast, the existing RemoteMessageView uses shouldRender = newMessage || binding.root.visibility == View.GONE before calling onMessageShown(). Without this check, the card "shown" pixels will fire every time render() is called with the same message, such as after configuration changes, leading to duplicate anonymous measurement data.
Please tell me if this was useful or not with a 👍 or 👎.
Additional Locations (1)
ff64a45 to
1957d95
Compare
73d3d60 to
579c0e6
Compare
f56fe00 to
a2f7db4
Compare
579c0e6 to
9a50672
Compare
| val customParams = mapOf( | ||
| PARAM_NAME_DISMISS_TYPE to PARAM_VALUE_CLOSE_BUTTON, | ||
| ) | ||
| cardsListPixelHelper.dismissCardsListMessage(message.id, customParams) |
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.
Bug: Dismiss command sent before pixel and repository operations
In onCloseButtonClicked(), the Command.DismissMessage is sent before cardsListPixelHelper.dismissCardsListMessage() is called. This could cause a race condition where the activity finishes before the pixel fires and the message is dismissed in the repository. Compare with onBackPressed() in ModalSurfaceViewModel which correctly calls dismissCardsListMessage() first and sends the dismiss command afterward. The inconsistent ordering in onCloseButtonClicked() could result in missed anonymous measurements and messages not being properly marked as dismissed.
Please tell me if this was useful or not with a 👍 or 👎.
25e285b to
366bbc1
Compare
…issals and update pixel tracking.
2104248 to
1e6cb98
Compare
366bbc1 to
b411140
Compare

Task/Issue URL: https://app.asana.com/1/137249556945/project/1200581511062568/task/1211783737656685?focus=true
Description
Added pixel tracking for CardsList remote messages. This PR introduces a new
CardsListRemoteMessagePixelHelperclass that handles firing pixels for card-specific events (shown, clicked, dismissed) with appropriate parameters. The implementation tracks when cards are shown to users, when users interact with cards, and how messages are dismissed.Steps to test this PR
CardsList Remote Message Tracking
m_remote_message_card_shownpixel fires for each cardm_remote_message_card_clickedpixel fires with the correct card IDm_remote_message_dismissedpixel fires with the appropriate dismiss type parameterNO UI changes
Note
Implements card-specific pixels and dismissal tracking for CardsList remote messages, adds back navigation dismiss handling, and defines new pixel specs with comprehensive tests.
CardsListRemoteMessagePixelHelper(fireCardItemShownPixel,fireCardItemClickedPixel,dismissCardsListMessage) with parametersmessage,card, and optionaldismissType.CardsListRemoteMessageViewModel, track last message, fireonMessageShown(including per-cardm_remote_message_card_shown), logm_remote_message_card_clickedon item taps, and dismiss withm_remote_message_dismissedincludingdismissType=close_button.viewModel.onMessageShown()on render inCardsListRemoteMessageView.m_remote_message_dismissedwithdismissType=back_button_or_gestureviaModalSurfaceViewModel.onBackPressed().m_remote_message_card_shownandm_remote_message_card_clickedinPixelDefinitions/pixels/remote_messaging_framework.json5.RealCardsListRemoteMessagePixelHelperTest),CardsListRemoteMessageViewModel, andModalSurfaceViewModelcovering show, click, and dismiss (includingdismissType).Written by Cursor Bugbot for commit b411140. This will update automatically on new commits. Configure here.