Skip to content

[PC TV] Add per-screen source to episode action analytics#4625

Draft
kean wants to merge 1 commit into
trunkfrom
kean/tvos-source-for-episode-events
Draft

[PC TV] Add per-screen source to episode action analytics#4625
kean wants to merge 1 commit into
trunkfrom
kean/tvos-source-for-episode-events

Conversation

@kean

@kean kean commented Jun 26, 2026

Copy link
Copy Markdown
Contributor
📘 Part of: #4614

Builds on #4614, addressing review feedback.

tvOS has no AnalyticsSourceProvider, so episode-action events (mark as played, archive, add to Up Next, reorder) were going out as source: unknown. This declares an AnalyticsSource per screen where the episode row is built and attaches it to the existing events: podcast_screen, up_next, starred, listening_history, filters, plus new home/search cases. No events are double-fired; play/pause are unchanged (they fire from the player as source: player).

To test

  1. Watch the AnalyticsLoggingAdapter console output while using the tvOS app.
  2. Open an episode's "…" menu on each screen and tap Mark as Played / Archive / Play Next.
  3. Confirm the events log the matching source: Podcast detail → podcast_screen, Up Next → up_next, Starred → starred, History → listening_history, Filter → filters, Home → home, Search → search.
  4. Confirm no duplicate events and play/pause still log source: player.

Checklist

  • I have considered if this change warrants user-facing release notes and have added them to CHANGELOG.md if necessary.
  • I have considered adding unit tests for my changes.
  • I have updated (or requested that someone edit) the Event Horizon schema to reflect any new or changed analytics.

tvOS episode-action events (mark as played, archive, add to Up Next,
reorder) reported source=unknown because tvOS has no
AnalyticsSourceProvider to merge a source like iOS does. Thread a
per-screen AnalyticsSource into EpisodeRowViewModel and the discovery
menus, push it onto the shared analytics helper before each action, and
add `home`/`search` source cases for the tvOS-only screens.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kean kean added this to the 8.16 milestone Jun 26, 2026
@dangermattic

Copy link
Copy Markdown
Collaborator
1 Warning
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

.setFocus(section: DiscoverType.video.rawValue)
.contextMenu {
DiscoveryEpisodeMenuButtons(podcastUuid: model.episode.podcastUuid ?? "", episodeUuid: model.episode.uuid ?? "", showNotesEpisode: $showNotesEpisode)
DiscoveryEpisodeMenuButtons(podcastUuid: model.episode.podcastUuid ?? "", episodeUuid: model.episode.uuid ?? "", source: AnalyticsSource(rawValue: source) ?? .unknown, showNotesEpisode: $showNotesEpisode)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@SergioEstevao , is that what you are thinking in terms of action sources? How does this PR look?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is looking good! You can move it for review. Thanks for doing this!

Base automatically changed from sergio/pc-tv/add_missing_analytics_events to trunk June 28, 2026 21:46
@pocketcasts pocketcasts modified the milestones: 8.16, 8.17 Jul 7, 2026
@pocketcasts

Copy link
Copy Markdown
Contributor

Version 8.16 has now entered code-freeze, so the milestone of this PR has been updated to 8.17.

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.

4 participants