Skip to content

Conversation

@anikiki
Copy link
Contributor

@anikiki anikiki commented Dec 5, 2025

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 CardsListRemoteMessagePixelHelper class 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

  • Verify that when a CardsList message is shown, the m_remote_message_card_shown pixel fires for each card
  • Verify that when a card item is clicked, the m_remote_message_card_clicked pixel fires with the correct card ID
  • Verify that when a message is dismissed via close button or via the back navigation, the m_remote_message_dismissed pixel fires with the appropriate dismiss type parameter
  • Verify the other existing RMF pixels are fired (message shown, primary action clicked)

NO UI changes


Note

Implements CardsList RMF pixels (shown/clicked) and dismissal tracking (close/back) with view model wiring and back navigation handling, plus pixel definitions and tests.

  • Remote Messaging (CardsList):
    • Pixels: Fire m_remote_message_card_shown for each card on message render and m_remote_message_card_clicked on item click via CardsListRemoteMessagePixelHelper.
    • Dismiss Tracking: Fire m_remote_message_dismissed with dismiss_type (close_button/back_button_or_gesture) and dismiss via repository.
    • ViewModel Updates: Track last message; call RemoteMessageModel.onMessageShown and onPrimaryActionClicked; wire onMessageShown() from view render.
    • Back Navigation: ModalSurfaceActivity intercepts back; ModalSurfaceViewModel.onBackPressed fires dismiss pixel (CardsList) then closes.
  • Pixels Definition: Add RMF pixel specs in PixelDefinitions/pixels/remote_messaging_framework.json5 (including m_remote_message_card_shown, m_remote_message_card_clicked, and dismiss_type enum).
  • Tests: Add unit tests for helper, view models, and back-press dismissal pixels.

Written by Cursor Bugbot for commit 73d3d60. This will update automatically on new commits. Configure here.

Copy link
Contributor Author

anikiki commented Dec 5, 2025

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.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@anikiki anikiki changed the title Add CardsListRemoteMessagePixelHelper for pixel tracking of card interactions. [Android] "What’s New" promo message: Implement pixels Dec 5, 2025
@anikiki anikiki marked this pull request as ready for review December 5, 2025 17:32
@anikiki anikiki requested a review from cmonfortep December 5, 2025 17:32
companion object {
private const val PARAM_NAME_MESSAGE_ID = "message"
private const val PARAM_NAME_CARD_ID = "card"
internal const val PARAM_NAME_DISMISS_TYPE = "dismissType"
Copy link

Choose a reason for hiding this comment

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

Bug: Pixel parameter name mismatch with JSON5 definition

The constant PARAM_NAME_DISMISS_TYPE is defined as "dismissType" (camelCase), but the pixel definition in remote_messaging_framework.json5 specifies the parameter key as "dismiss_type" (snake_case). This mismatch will cause the dismiss type parameter to not be properly recognized by the analytics system, resulting in anonymous measurement data being lost or incorrectly categorized.


Please tell me if this was useful or not with a 👍 or 👎.

Fix in Cursor Fix in Web

binding.headerImage.setImageResource(it.placeholder.drawable(true))
binding.headerTitle.text = it.titleText
binding.actionButton.text = it.primaryActionText
viewModel.onMessageShown()
Copy link

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)

Fix in Cursor Fix in Web

@anikiki anikiki force-pushed the feature/ana/android_whats_new_promo_message_add_the_new_ui_elements branch from ff64a45 to 1957d95 Compare December 8, 2025 23:31
@anikiki anikiki force-pushed the feature/ana/android_whats_new_promo_message_implement_pixels branch from 6e8064f to 73d3d60 Compare December 8, 2025 23:31
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.

2 participants