Skip to content

[RSM] Support generated chapters#5277

Open
sztomek wants to merge 6 commits into
feat/radical-episode-summariesfrom
feat/radical-ai-chapters
Open

[RSM] Support generated chapters#5277
sztomek wants to merge 6 commits into
feat/radical-episode-summariesfrom
feat/radical-ai-chapters

Conversation

@sztomek
Copy link
Copy Markdown
Contributor

@sztomek sztomek commented May 7, 2026

Description

This PR is part of the Radical Speed Month initiative.
It builds upon our previous work with AI summaries for episodes.
Adds support for AI-generated chapters -- when an episode doesn't have curated chapters but has the server-generated meta file (that contains both summary and chapters), we will grab those chapters and store them in our database.
This PR also introduces EpisodeMetaResponse that is a DTO to map the meta file's JSON format and we use Moshi to parse the file's content.

Testing Instructions

  1. Open an episode that doesn't have chapters, but has generated transcripts (e.g. The American Life)
  2. Notice that Chapters tab is available
  3. Interact with chapters

Screenshots or Screencast

Screenshot_20260507_162521

Checklist

  • If this is a user-facing change, I have added an entry in CHANGELOG.md
  • Ensure the linter passes (./gradlew spotlessApply to automatically apply formatting/linting)
  • I have considered whether it makes sense to add tests for my changes
  • All strings that need to be localized are in modules/services/localization/src/main/res/values/strings.xml
  • Any jetpack compose components I added or changed are covered by compose previews
  • I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.

@sztomek sztomek added this to the 8.12 milestone May 7, 2026
Copilot AI review requested due to automatic review settings May 7, 2026 14:27
@sztomek sztomek requested a review from a team as a code owner May 7, 2026 14:27
@sztomek sztomek requested review from geekygecko and removed request for a team May 7, 2026 14:27
@sztomek sztomek added [Type] Enhancement Improve an existing feature. [Area] Chapters Episode chapters labels May 7, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds support for persisting AI-generated chapters from the server “-meta.json” transcript metadata when curated chapters are missing, using a Moshi DTO for parsing.

Changes:

  • Parse transcript meta JSON into a new EpisodeMetaResponse DTO via Moshi.
  • Extend TranscriptManagerImpl.loadSummaryText to opportunistically save AI chapters when no existing chapters are present.
  • Add unit tests covering chapter persistence / skipping behavior and meta JSON permutations.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/transcript/TranscriptManagerImpl.kt Parses meta JSON with Moshi and saves AI chapters when appropriate.
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/transcript/EpisodeMetaResponse.kt New Moshi DTO for meta JSON (summary, chapters).
modules/services/repositories/src/test/java/au/com/shiftyjelly/pocketcasts/repositories/transcript/TranscriptManagerTest.kt Adds coverage for saving/skipping AI chapters from meta JSON.
modules/services/repositories/build.gradle.kts Enables Moshi codegen via KSP for @JsonClass(generateAdapter = true).

@CookieyedCodes
Copy link
Copy Markdown

I would suggest an icon is used to inform people these are AI chapters, also maby limit the number of chapters go 10 per hour 🤔🤔

@wpmobilebot wpmobilebot modified the milestones: 8.12, 8.13 May 11, 2026
@wpmobilebot
Copy link
Copy Markdown
Collaborator

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

@sztomek
Copy link
Copy Markdown
Contributor Author

sztomek commented May 12, 2026

@CookieyedCodes Great suggestions! We've added a text disclaimer that appears above the chapters list when they're AI-generated to set user expectations. An icon indicator and chapter density limits are good ideas for a future iteration — keeping them out of this PR's scope for now.

Copilot AI review requested due to automatic review settings May 12, 2026 15:30
@sztomek sztomek force-pushed the feat/radical-ai-chapters branch from eaddc9c to 93bfbc6 Compare May 12, 2026 15:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

modules/services/utils/src/main/java/au/com/shiftyjelly/pocketcasts/utils/featureflag/Feature.kt:274

  • PR description is focused on AI-generated chapters, but this diff also introduces a new BLOGS feature flag and substantial Blogs-related UI/networking changes. Please update the PR description/scope (or split into a separate PR) so reviewers and release notes can track these independently.
    GENERATED_CHAPTERS(
        key = "generated_chapters",
        title = "AI-Generated Chapters",
        defaultValue = isDebugOrPrototypeBuild,
        tier = FeatureTier.Free,
        hasFirebaseRemoteFlag = true,
        hasDevToggle = true,
    ),
    AI_SUMMARIES(
        key = "ai_summaries",
        title = "AI Summaries",
        defaultValue = isDebugOrPrototypeBuild,
        tier = FeatureTier.Free,
        hasFirebaseRemoteFlag = true,
        hasDevToggle = true,
    ),

PlaybackStatsEvent::class,
],
version = 127,
version = 128,
Comment on lines 1856 to 1861
MIGRATION_123_124,
MIGRATION_124_125,
MIGRATION_125_126,
MIGRATION_126_127,
MIGRATION_127_128,
)
@sztomek
Copy link
Copy Markdown
Contributor Author

sztomek commented May 12, 2026

Added an explanatory text to the screen
Screenshot_20260512_174201

@CookieyedCodes
Copy link
Copy Markdown

CookieyedCodes commented May 12, 2026

Can I suggest something, if rss time tags are detected in the show notes, it might be nice that those are generated as chapters over AI generated transcripts chapters 🤔🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Chapters Episode chapters [Type] Enhancement Improve an existing feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants