Skip to content

Add analytics tracking to wordpress-rs post list and settings#22763

Open
nbradbury wants to merge 2 commits intotrunkfrom
issue/rspost-analytics
Open

Add analytics tracking to wordpress-rs post list and settings#22763
nbradbury wants to merge 2 commits intotrunkfrom
issue/rspost-analytics

Conversation

@nbradbury
Copy link
Copy Markdown
Contributor

@nbradbury nbradbury commented Apr 3, 2026

Description

Adds analytics tracking to the wordpress-rs post list (PostRsListViewModel) and post settings (PostRsSettingsViewModel) to achieve parity with the legacy implementations.

Post list events (PostRsListViewModel):

  • POST_LIST_TAB_CHANGED — when the user swipes or taps a tab
  • POST_LIST_CREATE_POST_TAPPED — when the FAB is tapped
  • POST_LIST_SEARCH_ACCESSED — when search mode is opened
  • POST_LIST_AUTHOR_FILTER_CHANGED — when the author filter changes
  • POST_LIST_ITEM_SELECTED — when a post is tapped to edit
  • POST_LIST_BUTTON_PRESSED — when a post menu action is tapped

Post settings events (PostRsSettingsViewModel):

  • EDITOR_POST_VISIBILITY_CHANGED, EDITOR_POST_PASSWORD_CHANGED, EDITOR_POST_SCHEDULE_CHANGED, EDITOR_POST_CATEGORIES_ADDED, EDITOR_POST_TAGS_CHANGED — via trackPostSettings() (adds via=settings)
  • EDITOR_POST_SLUG_CHANGED, EDITOR_POST_EXCERPT_CHANGED, EDITOR_POST_FORMAT_CHANGED — via direct track()

All settings events only fire when the value actually changes, matching legacy behavior.

Track post list events (tab changes, search, author filter, item
selection, menu actions, create post) in PostRsListViewModel and
post settings events (visibility, password, slug, excerpt, format,
schedule, categories, tags) in PostRsSettingsViewModel to match
the legacy implementations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dangermattic
Copy link
Copy Markdown
Collaborator

dangermattic commented Apr 3, 2026

1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Apr 3, 2026

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
Build TypeDebug
Versionpr22763-511b26d
Build Number1488
Application IDorg.wordpress.android.prealpha
Commit511b26d
Installation URL1avh5mpkajtq8
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Apr 3, 2026

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
Build TypeDebug
Versionpr22763-511b26d
Build Number1488
Application IDcom.jetpack.android.prealpha
Commit511b26d
Installation URL7ch6es7j7hg7o
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Add the missing analyticsTracker parameter to PostRsListViewModelTest
and PostRsSettingsViewModelTest after the constructor change.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

❌ Patch coverage is 70.83333% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.42%. Comparing base (8c0b6d4) to head (511b26d).

Files with missing lines Patch % Lines
...ordpress/android/ui/postsrs/PostRsListViewModel.kt 71.05% 10 Missing and 1 partial ⚠️
...ess/android/ui/postsrs/screens/PostRsListScreen.kt 0.00% 6 Missing ⚠️
...ress/android/ui/postsrs/PostRsSettingsViewModel.kt 85.71% 0 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            trunk   #22763      +/-   ##
==========================================
+ Coverage   37.40%   37.42%   +0.01%     
==========================================
  Files        2320     2320              
  Lines      123674   123743      +69     
  Branches    16791    16801      +10     
==========================================
+ Hits        46256    46306      +50     
- Misses      73707    73721      +14     
- Partials     3711     3716       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nbradbury nbradbury marked this pull request as ready for review April 3, 2026 17:47
@nbradbury nbradbury requested a review from adalpari April 3, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants