Skip to content

[Generated Chapters] Animate the generating and ready states - #6339

Open
sztomek wants to merge 36 commits into
mainfrom
feat/generated-chapters-motion
Open

sztomek wants to merge 36 commits into
mainfrom
feat/generated-chapters-motion

Conversation

@sztomek

@sztomek sztomek commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #6293. Merge #6293 first.

Description

Part of PCDROID-841 https://linear.app/a8c/issue/PCDROID-841

The generated chapters states now follow the motion spec from the Figma prototypes.

  • State changes: the old state fades out and moves up 8 dp (250 ms, ease-in). The new one fades in and rises 8 dp (300 ms, ease-out). This replaces the plain crossfade.
  • Generating: the "Generating chapters…" header only fades in, in place. Only the skeleton rises 8 dp, as in the prototype. The skeleton uses Modifier.animateEnterExit inside the AnimatedContent, with the same timings.
  • Background: the chapters background now sits behind the crossfade. Before, the player colour behind the tab showed through for about 200 ms between two states.
  • Sparkle: pulses between 100% and 78% scale (600 ms each way) and turns slowly (one full turn every 7.2 s), both ease-in-out. The old alpha flicker and wobble are gone.
  • Shimmer: same 1.1 s sweep plus 0.1 s gap, now ease-in-out.
  • Slow note: still shows after 5 s. It now fades in and rises 6 dp over 400 ms.
  • Ready: the skeleton fades out over 170 ms. The ready header fades in over 200 ms. The rows fade in and rise 8 dp over 350 ms, 70 ms apart, top to bottom.

The stagger only plays when the tab goes from generating to generated chapters. It does not play when you open a tab that already has chapters, for creator chapters, when you switch tabs or when you scroll. Rows after the 10th come in with the 10th, so long lists don't wait.

All animations use Compose specs, so they follow the system animation scale and switch off when animations are off.

No changelog entry because the feature is behind a remote flag that is off.

Testing Instructions

Use a Plus account with the generated chapters flag on.

  1. Turn off Auto generate chapters in Settings → General.
  2. Play an episode without creator chapters that has a generated transcript and open Chapters.
  3. Tap Generate chapters.
  4. ✅ "No chapters yet" fades out and moves up. The "Generating chapters…" header fades in without moving and the skeleton rises. The sparkle pulses and turns.
  5. ✅ When the chapters load, the skeleton fades out and the rows come in one after another from the top.
  6. Switch to Details and back to Chapters.
  7. ✅ The list shows without replaying the stagger.
  8. Turn generated chapters off, open another such episode, turn on airplane mode and tap Generate chapters.
  9. ✅ After 5 seconds the note fades in and rises a little.
  10. Set Animator duration scale to 5x in Developer options and repeat steps 2–5.
  11. ✅ The stagger is easy to see. Set the scale back to 1x.

Screenshots or Screencast

Recording What it shows
1 Generate → generating → ready at 1x, re-recorded: the header fades in place and only the skeleton rises
2 Airplane mode: the skeleton holds and the slow note fades in after 5 s (1x)
3 Generate → generating → ready with the animator scale at 5x, re-recorded
  1. Generate → generating → ready (1x). Airplane mode is on for the first load so the generating state stays long enough to see. The network comes back and the 5 s retry loads the list:
generate-to-ready-header-fade.mp4
  1. Slow note (1x):
slow-note.mp4
  1. Generate → generating → ready (5x animator scale):
generate-to-ready-header-fade-5x.mp4

Header and skeleton position during the generating enter (frames 66 ms apart, brightened). The header stays at the same height, the skeleton rises:

Header fades in place, skeleton rises

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 Event Horizon schema to reflect any new or changed analytics.

I have tested any UI changes...

  • with different themes
  • with a landscape orientation
  • with the device set to have a large display and font size
  • for accessibility with TalkBack

@sztomek sztomek added this to the 8.25 milestone Nov 3, 2026
@sztomek sztomek added [Type] Feature Adding a new feature. [Area] Chapters Episode chapters labels Nov 3, 2026
@claude

claude Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @sztomek's task in 53s —— View job


I found nothing blocking. The reveal starts only when the state goes from generating to ready, and it doesn't play again later on. All animation state is read in the draw phase, so the stagger doesn't trigger recomposition per frame. I have one non-blocking point about an edge case in the transition from generating to the list.

Non-blocking

  • modules/features/player/src/main/java/au/com/shiftyjelly/pocketcasts/player/view/chapters/ChaptersPage.kt:197 If the state goes from generating to the list without generated chapters (e.g. canGenerateChapters flips to false, or the episode switches to one with publisher chapters), the list appears with no entrance animation behind the fading generating screen. Fix: require hasGeneratedChapters for the special-case transform as well. [Generated Chapters] Animate the generating and ready states #6339 (comment)

density: Density,
): ContentTransform {
val shift = with(density) { STATE_SHIFT.roundToPx() }
return if (initialState == ChaptersViewModel.EmptyState.GeneratingChapters && targetState == null) {

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.

(non-blocking) If the state goes from GeneratingChapters to null while hasGeneratedChapters is false, the list just appears with no entrance animation while the generating screen fades out on top of it. That happens when canGenerateChapters flips to false, or when the episode changes to one with publisher chapters. This branch uses EnterTransition.None and relies on the stagger reveal to bring the list in, but rememberGeneratedChaptersReveal returns null in that case. The fix is to apply the same hasGeneratedChapters check here, e.g. pass it into chaptersContentTransform, so those cases fall back to the default fade-and-shift.

@sztomek
sztomek marked this pull request as ready for review November 3, 2026 15:10
@sztomek
sztomek requested a review from a team as a code owner November 3, 2026 15:10
@sztomek
sztomek requested review from geekygecko and removed request for a team November 3, 2026 15:10
@claude

claude Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @sztomek's task in 12s —— View job


No commits since my last review. One non-blocking finding is still open.

Non-blocking

@sztomek
sztomek force-pushed the feat/generated-chapters-motion branch from a6eab11 to 08a6d42 Compare November 3, 2026 16:10
@claude

claude Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @sztomek's task in 35s —— View job


The branch was rebased, and the new commits move the theme background onto the AnimatedContent container and rise only the skeleton while the generating header fades in place. I found nothing new that blocks. The earlier non-blocking finding is still open.

Non-blocking

@sztomek
sztomek added this pull request to stack #6294 November 4, 2026 18:28
…rs-no-chapters-yet

# Conflicts:
#	modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/transcript/TranscriptManagerImpl.kt
#	modules/services/repositories/src/test/java/au/com/shiftyjelly/pocketcasts/repositories/transcript/TranscriptManagerTest.kt
Base automatically changed from feat/generated-chapters-no-chapters-yet to main November 5, 2026 10:10
…ers-yet' into feat/generated-chapters-motion
…rs-motion

# Conflicts:
#	modules/features/player/src/main/java/au/com/shiftyjelly/pocketcasts/player/view/chapters/ChaptersGenerating.kt
#	modules/features/player/src/main/java/au/com/shiftyjelly/pocketcasts/player/view/chapters/ChaptersPage.kt
@claude

claude Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @sztomek's task in 22s —— View job


Since my last review, 1c091a4 and e0c170f fixed the open finding: the reveal transform now runs only when hasGeneratedChapters is true (thread). The other new commits are merges from the base branch and main. I found nothing new to raise and nothing is still open.

@wpmobilebot wpmobilebot modified the milestones: 8.25, 8.26 Nov 9, 2026
@wpmobilebot

Copy link
Copy Markdown
Collaborator

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

@wpmobilebot wpmobilebot modified the milestones: 8.26, 8.27 Nov 23, 2026
@wpmobilebot

Copy link
Copy Markdown
Collaborator

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

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

Labels

[Area] Chapters Episode chapters [Type] Feature Adding a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants