Repository navigation
[Generated Chapters] Show a Generate chapters prompt and a loading state - #6293
Conversation
|
Claude finished @sztomek's task in 59s —— View job I found nothing blocking. The load and status logic in |
Generated by 🚫 Danger |
e7bbe6a to
145c16a
Compare
|
Claude finished @sztomek's task in 41s —— View job The branch was force-pushed, so I couldn't diff against the commit I last reviewed ( Nits
|
145c16a to
66db590
Compare
|
Claude finished @sztomek's task in 30s —— View job The branch was force-pushed again, this time as a rebase of the whole stack (the base Nits
|
66db590 to
b67e7f9
Compare
|
Claude finished @sztomek's task in 19s —— View job The branch was rebased again: all seven commits now carry the same new commit time, and I couldn't diff against the commits I last reviewed. The overall diff against Nits
|
b67e7f9 to
d270072
Compare
|
Claude finished @geekygecko's task in 11s —— View job The branch was rebased again: all seven commits now carry the same new commit time (2026-11-02), so I couldn't diff against what I last reviewed. The overall diff against Nits
|
d270072 to
c1b66c4
Compare
|
Claude finished @geekygecko's task in 12s —— View job The branch was rebased again. All seven commits now carry the commit time 2026-11-02 17:49 +10:30, so I couldn't diff against what I last reviewed. The overall diff against Nits
|
c1b66c4 to
7b72419
Compare
|
Claude finished @sztomek's task in 17s —— View job The branch was rebased onto the merged #6292 ( Nits
|
7b72419 to
dad2733
Compare
|
Claude finished @sztomek's task in 30s —— View job Two commits have landed since my last review. |
|
Claude finished @sztomek's task in 32s —— View job Since my last review the branch has picked up #6316 ( |
…and retry only on errors
|
Claude finished @sztomek's task in 56s —— View job Seven commits have landed since my last review ( |
…d keep retrying quietly
…several screens collapse
|
Claude finished @sztomek's task in 50s —— View job Nothing blocks in the three commits since my last review ( Non-blocking
|
| if (!generatedChaptersAvailability.isAllowed()) return GeneratedChaptersResult.Unavailable | ||
|
|
||
| val load = generatedChaptersLoads.computeIfAbsent(episodeUuid) { | ||
| applicationScope.async(start = CoroutineStart.LAZY) { |
There was a problem hiding this comment.
(non-blocking) A user who taps Turn off generated chapters while the meta request is in flight can end up on "Generated chapters are off" instead of "No chapters yet". Before this change, collectLatest cancelled the request. Now the fetch runs in applicationScope, so it finishes and saveAiChapters writes the chapters. With visibility Hidden, hasHiddenGeneratedChapters becomes true and emptyState resolves to GeneratedChaptersOff. The window is one request long. To fix it, check generatedChaptersAvailability.isAllowed() again just before chapterManager.updateChapters, or cancel the shared job once no callers are waiting.
|
Claude finished @sztomek's task in 25s —— View job The three new commits ( |
geekygecko
left a comment
There was a problem hiding this comment.
This looks good from the screenshots, and I was able to see the loading state by switching to airplane mode. I couldn't test it with an episode that has a transcript but no chapters, as I don't think that's currently possible.
…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
|
Claude finished @sztomek's task in 32s —— View job The only change since my last review is a merge of |
Description
Fixes PCDROID-841 https://linear.app/a8c/issue/PCDROID-841
Plus and Patron users now see generated chapters states in the Chapters tab when an episode has no creator chapters. Free users still see the upsell. User files are not affected.
How the load decides the state:
hasGeneratedTranscriptis false): No chapters for this episode right away. It no longer waits up to a minute for a transcript row.-meta.jsonURL is built from the episode, without waiting for the transcript row.hasGeneratedTranscriptflips to true, the tab loads again and moves from "No chapters for this episode" to generating and the list.Only one
-meta.jsonrequest runs per episode. The player, its Chapters page and the episode sheet each have their own view model, and each used to fetch and retry on its own. NowTranscriptManagerImplshares one in-flight load per episode on the application scope. A caller that leaves doesn't cancel the load for the others. A failed result is reused for 3 seconds so retries from several screens collapse into one request. After that the next retry fetches again. If generated chapters are turned off while a request is in flight, its chapters are not saved, so the tab goes back to "No chapters yet".There is no on-demand generation API. "Generate" enables the setting and loads chapters that were already generated.
TalkBack reads "Generating chapters…" once, as an in-progress header. The skeleton bars are hidden from TalkBack.
generated_chapters_prompt_shownnow uses the loaded state of the episode instead of the tab's first default state, and fires once per episode and prompt.The Generate tap is tracked as
settings_general_generated_chapters_toggledwithenabled = trueandsource = chapters_generate_button.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.
generated_chapters_prompt_shownwithprompt=no_chapters_yetonce.meta.json, repeat step 7 with the episode playing and its episode sheet open.Screenshots or Screencast
Generate → generating → list:
generate-to-list.mp4
Offline: the skeleton holds while retrying and the slow note fades in:
generate-offline-retry.mp4
No generated transcript: shown right away:
no-generated-transcript-immediate.mp4
Device pass (debug build, staging, Plus account). Each collage: No chapters yet, Generating with the slow note, No chapters for this episode, generated list, ⋯ menu, off state, free upsell.
One shared load: offline, with the episode playing and its sheet open. Before, the player and sheet view models fetched on their own, about 2 s apart:
After, one request per retry round. "No chapters for this episode" shows after the 16:51:50 failure (30 s). The network comes back and the quiet retry at 16:52:30 loads the list:
Online Generate from the player, one request:
Semantics (uiautomator; TalkBack is not installed on the emulator image, so this was not checked with TalkBack itself). Each button is one focusable node with the Button role and its label. The skeleton is one progress element:
Opening Chapters on an episode without a generated transcript. The tab opened at 15:07:55.216 and the state was on screen at the next UI dump (15:07:56.215):
Offline Generate: retries with backoff, then the list once the network is back:
generated_chapters_prompt_shownwhen opening the Chapters tab:Generating state semantics, covered by
ChaptersGeneratingTest(Robolectric): one "Generating chapters…" text node with indeterminate progress, and no content description on the skeleton.Checklist
./gradlew spotlessApplyto automatically apply formatting/linting)modules/services/localization/src/main/res/values/strings.xmlI have tested any UI changes...