Skip to content

[Compose] Port Podcasts tab (part 3: page) - #6334

Draft
sztomek wants to merge 1 commit into
compose/pr23-podcasts-tab-bfrom
compose/pr23-podcasts-tab-c
Draft

sztomek wants to merge 1 commit into
compose/pr23-podcasts-tab-bfrom
compose/pr23-podcasts-tab-c

Conversation

@sztomek

@sztomek sztomek commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Description

Plan PR 23 (Podcasts tab), part 3 of 4. Adds the stateless Compose PodcastsPage. Part 4 switches PodcastsFragment to it.

  • Toolbar: shared ThemedTopAppBar (as on the Playlists tab) with the old title (Podcasts or the folder name), back button only on a folder page, toolbar colours passed in (theme colours, or the folder's user colours). Actions in the old menu order: folder+ for free users (untinted, like the old excludeMenuItems) or Create folder for Plus on the root, the cast button (shared ToolbarCastButton), Search on the root, More options.
  • Grid: one LazyVerticalGrid for all three layouts: large/small artwork use UiUtil.getGridColumnCount (recomputed on configuration change) with 12dp outer padding and 4dp per-cell padding like SpaceItemDecoration; list uses one column with the 12dp list padding. Bottom padding adds the mini-player inset. The banner ad spans the row and tracks an impression when it comes into view.
  • Reorder: GridDragState + LockedReorder from part 1, on every podcast and folder cell (not the ad). Dropping commits through onReorder (part 4 passes PodcastsViewModel.reorderItems, unchanged). Moves animate with the 250ms move spec, the dragged cell is drawn on top.
  • Empty state: PodcastsEmptyContent (ad, then the banner slot) with the old 1:2 spacing.
  • Pull to refresh: Material PullRefreshIndicator, refreshing until the fragment says otherwise.

Tests: PodcastsPageTest (Robolectric) covers root toolbar taps (locked folder, search, options), the folder toolbar (back, no search), item taps and the empty content.

Intentional visual changes

  • Toolbar: shared ThemedTopAppBar + IconButton actions. The title and action icons sit a few pixels from where the AppCompat Toolbar drew them.
  • Grid columns use GridCells.Fixed, which hands the leftover pixel to the first columns, not GridLayoutManager's spread. On a 3-column phone the middle cell is 1px narrower or wider, so its artwork is resampled.

Parity ledger (pre-existing, kept)

  • Item spacing comes from a 4dp padding on every cell, so the outer gap is 12dp + 4dp. The old SpaceItemDecoration did the same and assumed a 2-column look. Kept.

Testing Instructions

./gradlew :modules:features:podcasts:testDebugUnitTest --tests '*PodcastsPageTest*'. Visual checks are in part 4.

Screenshots or Screencast

No UI change in this part. See part 4 for the before/after collage.

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

@claude

claude Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @sztomek's task in 1m 18s —— View job


No blocking issues. I checked the grid and list padding, the ad's full-width span, the column count recomputing on configuration change, the empty-state layout and the toolbar actions against the old PodcastsFragment, SpaceItemDecoration and BannerAdAdapter. Apart from the differences the description already lists, they match. Dropping the empty view's isViewVisible impression check is safe, because PodcastsEmptyContent is only composed while showEmpty is true. I didn't build the module or run the tests.

Non-blocking

  • modules/features/podcasts/src/main/java/au/com/shiftyjelly/pocketcasts/podcasts/view/podcasts/PodcastsPage.kt:234: The grid can prefetch the ad item, and LaunchedEffect runs for prefetched items. So when a user scrolls back toward the top, the impression can be counted before the ad is on screen. The old code tracked it when the view was attached. Fix: only track once the ad key is in visibleItemsInfo. [Compose] Port Podcasts tab (part 3: page) #6334 (comment)

@dangermattic

Copy link
Copy Markdown
Collaborator
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@sztomek sztomek added [Type] Other Issues not covered by other types, such as refactoring and documentation. [Type] Tech Debt Involving upgrades or refactoring to maintain or enhance the codebase. [Area] Compose labels Nov 3, 2026
@sztomek sztomek added this to the 8.25 milestone Nov 3, 2026

@Composable
private fun BannerAdItem(ad: BlazeAd, listener: PodcastsPageListener, modifier: Modifier = Modifier) {
LaunchedEffect(ad.id) {

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) LaunchedEffect also runs for items that LazyVerticalGrid prefetches. When a user scrolls back up toward the top, the ad's impression can be counted while the ad is still one row off-screen. The old BannerAdAdapter.onViewAttachedToWindow only fired once the view was actually attached. If impression accuracy matters here, gate the effect on the ad key being in gridState.layoutInfo.visibleItemsInfo. For example, wrap that check in snapshotFlow and use filter { it }.first() before tracking.

PodcastGridLayoutType.LIST_VIEW -> 1
}
}
val resources = context.resources
@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] Compose [Type] Other Issues not covered by other types, such as refactoring and documentation. [Type] Tech Debt Involving upgrades or refactoring to maintain or enhance the codebase.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants