before_code stringlengths 14 465k | reviewer_comment stringlengths 16 64.5k | after_code stringlengths 9 467k | diff_context stringlengths 0 97k | file_path stringlengths 5 226 | comment_line int32 0 26 | language stringclasses 37
values | quality_score float32 0.07 1 | comment_type stringclasses 9
values | comment_length int32 16 64.5k | before_lines int32 1 17.2k | after_lines int32 1 12.1k | is_negative bool 2
classes | pr_title stringlengths 1 308 | pr_number int32 1 299k | repo_name stringclasses 533
values | repo_stars int64 321 419k | repo_language stringclasses 27
values | reviewer_username stringlengths 0 39 | author_username stringlengths 2 39 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
trackStoryShown(story)
viewModelScope.launch {
countDownJob?.cancelAndJoin()
progress.value = 0f
val previewDuration = story.previewDuration
if (previewDuration != null) {
val progressDelay = previewDuration / 100
countDownJ... | The grace period duration of 2000ms is hardcoded. Consider extracting this value to a named constant (e.g., `COVER_STORY_GRACE_PERIOD_MS`) to improve code readability and maintainability. |
internal fun onStoryChanged(story: Story) {
trackStoryShown(story)
viewModelScope.launch {
countDownJob?.cancelAndJoin()
progress.value = 0f
val previewDuration = story.previewDuration
if (previewDuration != null) {
val progressDelay =... | @@ -180,7 +225,25 @@ class EndOfYearViewModel @AssistedInject constructor(
progress.value = currentProgress
delay(progressDelay)
}
- _switchStory.emit(Unit)
+
+ if (story == Story.Cover && !coverStoryGracePeriod... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/EndOfYearViewModel.kt | 26 | Kotlin | 0.571 | refactor | 187 | 51 | 51 | false | [Playback] Loading and error handling updates | 4,736 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
package au.com.shiftyjelly.pocketcasts.account.onboarding.recommendations
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import au.com.shiftyjelly.pocketcasts.analytics.AnalyticsEvent
import au.com.shiftyjelly.pocketcasts.analytics.AnalyticsTracker
import au.com.shiftyjelly.pocketcasts.re... | 💡 Next time it would be worth considering adding the flow as an assisted ctor arg: `@Assisted val onboardingFlow: OnboardingFlow`
That would probably have less code impact (no need to change the tracker methods) | package au.com.shiftyjelly.pocketcasts.account.onboarding.recommendations
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import au.com.shiftyjelly.pocketcasts.analytics.AnalyticsTracker
import au.com.shiftyjelly.pocketcasts.repositories.categories.CategoriesManager
import au.com.shiftyjel... | modules/features/account/src/main/java/au/com/shiftyjelly/pocketcasts/account/onboarding/recommendations/OnboardingInterestsViewModel.kt | 18 | Kotlin | 0.643 | suggestion | 211 | 43 | 43 | false | Improve Onboarding events | 4,738 | Automattic/pocket-casts-android | 1,688 | Kotlin | sztomek | geekygecko | |
package au.com.shiftyjelly.pocketcasts.endofyear
import android.app.Activity
import androidx.compose.runtime.Immutable
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import au.com.shiftyjelly.pocketcasts.analytics.AnalyticsEvent
import au.com.shiftyjelly.pocketcasts.analytics.AnalyticsTra... | [nitpick] The property ordering differs between the button share analytics (line 266-269 in SharingClient.kt) and the screenshot analytics here. For consistency and easier comparison, consider using the same order: "from", "story", "year", "activity" (where applicable). This would make the analytics data easier to anal... | }
private fun getRandomShowIds(stats: EndOfYearStats): RandomShowIds? {
val showIds = stats.playedPodcastIds
return if (showIds.isNotEmpty()) {
val showChunks = showIds.chunked(4)
val topShowIds = showChunks[0].padEnd(4)
val bottomShowIds = showChunks.getOrNu... | @@ -306,6 +307,18 @@ class EndOfYearViewModel @AssistedInject constructor(
}
}
+ fun screenshotDetected(story: Story, activity: Activity) {
+ analyticsTracker.track(
+ event = AnalyticsEvent.END_OF_YEAR_STORY_SHARED,
+ properties = mapOf(
+ "activity" to ac... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/EndOfYearViewModel.kt | 26 | Kotlin | 0.857 | suggestion | 536 | 365 | 51 | false | Analytics event if Playback screenshots | 4,742 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
package au.com.shiftyjelly.pocketcasts.endofyear.ui
import android.graphics.Typeface
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxScope
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.la... | The import `androidx.compose.ui.semantics.contentDescription` is unused. The `contentDescription` parameter is set on the `Image` composable but doesn't require this import.
```suggestion
``` | package au.com.shiftyjelly.pocketcasts.endofyear.ui
import android.graphics.Typeface
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxScope
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.la... | @@ -16,6 +16,8 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.pluralStringResource
import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.semantics.contentDescription | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/YearVsYearStory.kt | 19 | Kotlin | 0.786 | suggestion | 192 | 44 | 44 | false | Improving Playback accessibility | 4,743 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
)
is Story.Ending -> EndingStory(
story = story,
measurements = measurements,
onRestartPlayback = onRestartPlayback,
)
}
}
}
@Composable
internal fun BoxScope.TopControls(
pagerState: PagerState,
progress: Float,
... | The `isTalkbackOn` state is captured with `remember` without dependencies, which means it will only be evaluated once during composition. If the user enables or disables TalkBack while the stories are displayed, this state won't update.
Consider using a side effect to observe accessibility state changes, or document i... | progress = progress,
activeColor = color,
modifier = Modifier.padding(horizontal = 16.dp),
)
Row(
horizontalArrangement = Arrangement.End,
modifier = Modifier.fillMaxWidth(),
) {
if (isTalkbackOn) {
TopContro... | @@ -268,50 +282,81 @@ internal fun BoxScope.TopControls(
color: Color,
measurements: EndOfYearMeasurements,
onClose: () -> Unit,
+ onNextStory: () -> Unit,
controller: StoryCaptureController,
) {
val density = LocalDensity.current
// Calculate the height so that we can remove it from t... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/StoriesPage.kt | 26 | Kotlin | 0.643 | suggestion | 431 | 51 | 51 | false | Improving Playback accessibility | 4,743 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
}
add(
Story.PlusInterstitial(
subscriptionTier = subscription?.tier,
),
)
add(
Story.YearVsYear(
lastYearDuration = stats.lastYearPlaybackTime,
thisYearDuration = stats.playbackTime,
subs... | The TalkBack state is checked on every story change without caching. Consider caching this value in the ViewModel or using a StateFlow to avoid repeated accessibility service queries on every story transition. | )
}
}
private fun createStories(
stats: EndOfYearStats,
randomShowIds: RandomShowIds?,
subscription: Subscription?,
topPodcastsLink: String?,
): List<Story> = buildList {
add(Story.Cover)
if (randomShowIds != null) {
add(
... | @@ -168,11 +172,12 @@ class EndOfYearViewModel @AssistedInject constructor(
internal fun onStoryChanged(story: Story) {
trackStoryShown(story)
+ val isTalkbackOn = Util.isTalkbackOn(context) | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/EndOfYearViewModel.kt | 26 | Kotlin | 0.5 | suggestion | 209 | 51 | 51 | false | Improving Playback accessibility | 4,743 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.windowInsetsPadding
import a... | The import `androidx.compose.ui.graphics.vector.VectorPainter` is unused. The `rememberVectorPainter` function returns a `VectorPainter`, but the type is captured by the `Painter` parameter type in `TopControlButton`.
```suggestion
``` | import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.pager.HorizontalPager
import androidx.compose.foundation.pager.PagerState
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.rounded.ArrowBack
import androidx.compose.material.i... | @@ -38,15 +41,24 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
+import androidx.compose.ui.graphics.painter.Painter
+import androidx.compose.ui.graphics.vector.VectorPainter | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/StoriesPage.kt | 26 | Kotlin | 1 | suggestion | 236 | 51 | 51 | false | Improving Playback accessibility | 4,743 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
import androidx.compose.material.icons.automirrored.rounded.ArrowForward
import androidx.compose.material.ripple
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.set... | The imports `CustomAccessibilityAction`, `contentDescription`, `customActions`, and `stateDescription` are unused in this file. These semantics imports were added but are not being used in the code.
```suggestion
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.semantics.semantics
``` | import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.graphics.vector.rememberVectorPainter
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose... | @@ -38,15 +41,24 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
+import androidx.compose.ui.graphics.painter.Painter
+import androidx.compose.ui.graphics.vector.VectorPainter
+import androidx.compos... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/StoriesPage.kt | 26 | Kotlin | 0.857 | suggestion | 305 | 51 | 51 | false | Improving Playback accessibility | 4,743 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.CustomAccessibilityAction
import androidx.compose.ui.semantics.Role
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.customActions
import androidx.compose.ui.semantics.semantics
import androidx... | The import `timber.log.Timber` is unused. It was added but there are no `Timber` logging calls in the code.
```suggestion
``` | import au.com.shiftyjelly.pocketcasts.models.to.Story
import au.com.shiftyjelly.pocketcasts.utils.Util
import java.io.File
import kotlin.time.Duration.Companion.milliseconds
import kotlin.time.TimeSource
import au.com.shiftyjelly.pocketcasts.images.R as IR
import au.com.shiftyjelly.pocketcasts.localization.R as LR
@Co... | @@ -62,6 +74,7 @@ import au.com.shiftyjelly.pocketcasts.utils.Util
import java.io.File
import kotlin.time.Duration.Companion.milliseconds
import kotlin.time.TimeSource
+import timber.log.Timber | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/StoriesPage.kt | 26 | Kotlin | 0.786 | suggestion | 126 | 51 | 51 | false | Improving Playback accessibility | 4,743 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
package au.com.shiftyjelly.pocketcasts.endofyear.ui.components
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowIns... | The import `androidx.compose.ui.semantics.contentDescription` is unused. The `contentDescription` parameter is set on the `Image` composable but doesn't require this import.
```suggestion
``` | package au.com.shiftyjelly.pocketcasts.endofyear.ui.components
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowIns... | @@ -13,6 +13,8 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.semantics.contentDescription | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/components/HeaderText.kt | 16 | Kotlin | 0.786 | suggestion | 192 | 41 | 41 | false | Improving Playback accessibility | 4,743 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
}
}
}
@Composable
internal fun BoxScope.TopControls(
pagerState: PagerState,
progress: Float,
color: Color,
measurements: EndOfYearMeasurements,
isTalkbackOn: Boolean,
onClose: () -> Unit,
onPreviousStory: () -> Unit,
onNextStory: () -> Unit,
controller: StoryCaptureCont... | The "Next story" button is always shown when TalkBack is enabled, even on the last story. Similar to how the "Previous story" button is conditionally shown only when `pagerState.currentPage > 0` (line 307), you should also check if the user is on the last page before showing the "Next story" button.
Consider checking ... | state = pagerState,
progress = progress,
activeColor = color,
modifier = Modifier.padding(horizontal = 16.dp),
)
Row(
horizontalArrangement = Arrangement.End,
modifier = Modifier.fillMaxWidth(),
) {
if (isTalkbac... | @@ -281,37 +291,74 @@ internal fun BoxScope.TopControls(
.align(Alignment.TopCenter)
.fillMaxWidth()
.windowInsetsPadding(measurements.statusBarInsets)
- .padding(start = 16.dp, end = 16.dp)
.onGloballyPositioned { controller.topControlsHeightPx = it.size.h... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/StoriesPage.kt | 26 | Kotlin | 0.857 | suggestion | 941 | 51 | 51 | false | Improving Playback accessibility | 4,743 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
val stats = endOfYearManager.getStats(year)
topPodcastsLinkAction.run(stats.topPodcasts, scope = viewModelScope)
stats to getRandomShowIds(stats)
}
private val topPodcastsLink = MutableStateFlow<String?>(null)
private val topPodcastsLinkAction = CachedAction<List<TopPodcast>, Unit> ... | The `AccessibilityStateChangeListener` only monitors changes to `AccessibilityManager.isEnabled`, but `Util.isTalkbackOn()` (line 82) checks both `isEnabled` AND `isTouchExplorationEnabled`. This means if touch exploration is toggled while accessibility services are already enabled, the TalkBack state won't update.
Co... | internal val syncFailedSignal: Deferred<Unit> get() = _syncFailedSignal
private val eoyStatsAction = CachedAction<Year, Pair<EndOfYearStats, RandomShowIds?>> {
val stats = endOfYearManager.getStats(year)
topPodcastsLinkAction.run(stats.topPodcasts, scope = viewModelScope)
stats to getRa... | @@ -71,6 +77,13 @@ class EndOfYearViewModel @AssistedInject constructor(
}
}
+ // monitor if talkback is enabled
+ private val accessibilityManager = context.getSystemService(Context.ACCESSIBILITY_SERVICE) as? AccessibilityManager?
+ private val talkbackEnabledState = MutableStateFlow(Util.isTa... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/EndOfYearViewModel.kt | 26 | Kotlin | 0.857 | suggestion | 723 | 51 | 51 | false | Improving Playback accessibility | 4,743 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
onClick = onPreviousStory,
iconPadding = 12.dp,
)
}
TopControlButton(
painter = rememberVectorPainter(Icons.AutoMirrored.Rounded.ArrowForward),
contentDescription = stringResource(... | The `TopControlButton` function should be marked as `private` since it's only used within this file. Keeping composable functions with the narrowest possible visibility is a best practice.
```suggestion
private fun TopControlButton(
``` | iconPadding: Dp,
modifier: Modifier = Modifier,
enabled: Boolean = true,
) {
Image(
painter = painter,
contentDescription = contentDescription,
colorFilter = ColorFilter.tint(color),
alpha = if (enabled) 1f else 0.4f,
modifier = modifier
.size(48.dp)
... | @@ -281,37 +291,74 @@ internal fun BoxScope.TopControls(
.align(Alignment.TopCenter)
.fillMaxWidth()
.windowInsetsPadding(measurements.statusBarInsets)
- .padding(start = 16.dp, end = 16.dp)
.onGloballyPositioned { controller.topControlsHeightPx = it.size.h... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/StoriesPage.kt | 26 | Kotlin | 0.857 | suggestion | 236 | 51 | 36 | false | Improving Playback accessibility | 4,743 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
import java.io.File
import java.time.Year
import kotlinx.coroutines.Job
import kotlinx.coroutines.cancelAndJoin
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.as... | The test suite will fail to compile because the `EndOfYearViewModel` constructor now requires a `context` parameter (added on line 55 in the production code), but the test setup on line 114 doesn't provide it. You need to add a mock `Context` parameter to the `EndOfYearViewModel` instantiation in the test. | import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.Deferred
import kotlinx.coroutines.Job
import kotlinx.coroutines.cancelAndJoin
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharingSt... | @@ -47,6 +52,7 @@ class EndOfYearViewModel @AssistedInject constructor(
private val listServiceManager: ListServiceManager,
private val sharingClient: StorySharingClient,
private val analyticsTracker: AnalyticsTracker,
+ @ApplicationContext private val context: Context, | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/EndOfYearViewModel.kt | 26 | Kotlin | 0.643 | bug | 307 | 51 | 51 | false | Improving Playback accessibility | 4,743 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
import android.content.Context
import android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener
import au.com.shiftyjelly.pocketcasts.utils.Util
import dagger.hilt.android.qualifiers.ApplicationContext
import javax.inject.Inject
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.corou... | The `AccessibilityStateChangeListener` only detects changes to `AccessibilityManager.isEnabled`, but `Util.isTalkbackOn()` also checks `isTouchExplorationEnabled`. This means the listener won't accurately track when TalkBack is enabled or disabled.
To properly detect TalkBack state changes, you should also listen to t... | import android.content.Context
import au.com.shiftyjelly.pocketcasts.utils.Util
import dagger.hilt.android.qualifiers.ApplicationContext
import javax.inject.Inject
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
import android.view.acce... | @@ -0,0 +1,38 @@
+package au.com.shiftyjelly.pocketcasts.utils.accessibility
+
+import android.content.Context
+import android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener
+import au.com.shiftyjelly.pocketcasts.utils.Util
+import dagger.hilt.android.qualifiers.ApplicationContext
+import java... | modules/services/utils/src/main/java/au/com/shiftyjelly/pocketcasts/utils/accessibility/AccessibilityManager.kt | 26 | Kotlin | 0.857 | suggestion | 1,035 | 37 | 36 | false | Improving Playback accessibility | 4,743 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
) = podcastListUrl.await()
override suspend fun openPodcastList(listId: String) = PodcastList(
title = "",
description = "",
podcasts = emptyList(),
date = null,
hash = null,
)
override fun extractShareListIdFromWebUrl(webUrl:... | The constructor parameter `isTalkBackEnabled` is not used. The `isTalkBackOnFlow` property always returns a `MutableStateFlow(false)` regardless of the constructor parameter value. To make the fake properly testable, use the parameter:
```kotlin
private class FakeAccessibilityManager(isTalkBackEnabled: Boolean) : Acce... | package au.com.shiftyjelly.pocketcasts.endofyear
import app.cash.turbine.Turbine
import app.cash.turbine.TurbineTestContext
import app.cash.turbine.test
import au.com.shiftyjelly.pocketcasts.analytics.AnalyticsTracker
import au.com.shiftyjelly.pocketcasts.models.entity.Podcast
import au.com.shiftyjelly.pocketcasts.mod... | @@ -737,4 +740,12 @@ class EndOfYearViewModelTest {
)
}
}
+
+ private class FakeAccessibilityManager(isTalkBackEnabled: Boolean) : AccessibilityManager {
+ override val isTalkBackOnFlow: StateFlow<Boolean>
+ get() = MutableStateFlow(false) | modules/features/endofyear/src/test/kotlin/au/com/shiftyjelly/pocketcasts/endofyear/EndOfYearViewModelTest.kt | 26 | Kotlin | 0.857 | suggestion | 606 | 32 | 722 | false | Improving Playback accessibility | 4,743 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
): EndOfYearViewModel
}
}
@Immutable
internal sealed interface UiState {
val storyProgress: Float get() = 0f
val storyCount: Int get() = 0
data class Syncing(
val stories: List<Story>,
override val storyProgress: Float,
) : UiState {
override val storyCount: Int
... | The `Synced` data class is missing the `storyCount` override. The `Syncing` class has `override val storyCount: Int get() = stories.size`, but `Synced` doesn't. This will cause `pagerState` to use the default value of 0 instead of the actual story count, breaking pagination. Add `override val storyCount: Int get() = st... | @Immutable
data class Synced(
val isPaidAccount: Boolean,
override val storyProgress: Float,
override val stories: List<Story>,
override val isTalkBackOn: Boolean,
) : UiState
}
private sealed interface SyncState {
data object Syncing : SyncState
data object Synced :... | @@ -417,10 +432,8 @@ internal sealed interface UiState {
val stories: List<Story>,
val isPaidAccount: Boolean,
override val storyProgress: Float,
- ) : UiState {
- override val storyCount: Int
- get() = stories.size
- }
+ val isTalkBackOn: Boolean,
+ ) : UiSt... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/EndOfYearViewModel.kt | 26 | Kotlin | 0.857 | suggestion | 471 | 41 | 28 | false | Improving Playback accessibility | 4,743 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
}
private var saveUpNextJob: Job? = null
private var playAllJob: Job? = null
fun saveUpNextAsPlaylist(saveUpNext: Boolean, upNextTranslation: String) {
analyticsTracker.track(
AnalyticsEvent.FILTER_PLAY_ALL_REPLACE_AND_PLAY_TAPPED,
mapOf(
"filter_type" t... | The user's preference choice for `saveUpNext` is not being persisted to `settings.saveUpNextAsPlaylist`. This means the user's selection won't be remembered for the next time they tap "Play all".
Consider adding `settings.saveUpNextAsPlaylist.set(saveUpNext, updateModifiedAt = false)` after line 120 to persist the us... | }
private var saveUpNextJob: Job? = null
private var playAllJob: Job? = null
fun saveUpNextAsPlaylist(saveUpNext: Boolean, upNextTranslation: String) {
analyticsTracker.track(
AnalyticsEvent.FILTER_PLAY_ALL_REPLACE_AND_PLAY_TAPPED,
mapOf(
"filter_type" t... | @@ -106,25 +108,26 @@ class PlaylistViewModel @AssistedInject constructor(
}
private var saveUpNextJob: Job? = null
-
- fun saveUpNextAsPlaylist(upNextTranslation: String) {
- if (saveUpNextJob?.isActive == true) {
- return
- }
- saveUpNextJob = viewModelScope.launch(NonCa... | modules/features/filters/src/main/java/au/com/shiftyjelly/pocketcasts/playlists/PlaylistViewModel.kt | 26 | Kotlin | 0.643 | suggestion | 332 | 51 | 51 | false | Update Play all flow | 4,744 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
): @Composable () -> Unit {
val topPaddingForGenericContent = if (index != 0) 16.dp else 0.dp
return {
when (this) {
is UpgradePagerContent.Features -> FeaturesContent(
modifier = modifier
.padding(
horizontal = 24.dp,
... | The variant mapping is reversed according to the PR description. The `FeaturesContent` displays 'How does the free trial work?' (LR.string.onboarding_upgrade_features_trial_schedule at line 722) and should use variant A, but it's using `FEATURES_FIRST` which maps to 'A'. However, based on the naming and the PR descript... | }
}
@Composable
private fun UpgradePagerContent.toComponent(
index: Int,
scrollToNext: () -> Unit,
onClickSeeAllFeatures: (OnboardingUpgradeFeaturesState.NewOnboardingVariant) -> Unit,
modifier: Modifier = Modifier,
): @Composable () -> Unit {
val topPaddingForGenericContent = if (index != 0) 1... | @@ -648,7 +657,10 @@ private fun UpgradePagerContent.toComponent(
top = topPaddingForGenericContent,
),
features = this,
- onCtaClick = scrollToNext,
+ onCtaClick = {
+ onClickSeeAllFeatures(OnboardingUpgrade... | modules/features/account/src/main/java/au/com/shiftyjelly/pocketcasts/account/onboarding/upgrade/OnboardingUpgradeScreen.kt | 26 | Kotlin | 0.643 | style | 574 | 51 | 51 | false | [Onboarding] Add `plus_promotion_details_tapped` event | 4,745 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
is UpgradePagerContent.TrialSchedule -> ScheduleContent(
modifier = modifier
.padding(
horizontal = 24.dp,
)
.padding(
top = topPaddingForGenericContent,
),
... | The variant mapping appears reversed. The `ScheduleContent` displays 'See all Plus features' (LR.string.onboarding_upgrade_schedule_see_features at line 744) but uses `TRIAL_FIRST_WHEN_ELIGIBLE` mapped to variant B. According to the PR description, 'variant=B is for the See all Plus features CTA', but TRIAL_FIRST_WHEN_... | .padding(
horizontal = 24.dp,
)
.padding(
top = topPaddingForGenericContent,
),
features = this,
onCtaClick = {
onClickSeeAllFeatures(Onboar... | @@ -660,7 +672,10 @@ private fun UpgradePagerContent.toComponent(
top = topPaddingForGenericContent,
),
trialSchedule = this,
- onCtaClick = scrollToNext,
+ onCtaClick = {
+ onClickSeeAllFeatures(OnboardingUp... | modules/features/account/src/main/java/au/com/shiftyjelly/pocketcasts/account/onboarding/upgrade/OnboardingUpgradeScreen.kt | 26 | Kotlin | 0.643 | suggestion | 488 | 51 | 51 | false | [Onboarding] Add `plus_promotion_details_tapped` event | 4,745 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
import androidx.fragment.compose.content
import androidx.navigation.compose.rememberNavController
import au.com.shiftyjelly.pocketcasts.compose.CallOnce
import au.com.shiftyjelly.pocketcasts.compose.components.AnimatedNonNullVisibility
import au.com.shiftyjelly.pocketcasts.compose.components.ThemedSnackbarHost
import a... | The `isDoneTapped` flag is not saved in `savedInstanceState`, which means it will be lost during configuration changes (e.g., screen rotation). If a user taps "Done" and then the device rotates before the dialog is dismissed, the changes won't be committed and the snackbar won't be shown.
Consider saving and restoring... | import androidx.navigation.compose.rememberNavController
import au.com.shiftyjelly.pocketcasts.compose.CallOnce
import au.com.shiftyjelly.pocketcasts.compose.components.AnimatedNonNullVisibility
import au.com.shiftyjelly.pocketcasts.compose.components.ThemedSnackbarHost
import au.com.shiftyjelly.pocketcasts.models.to.P... | @@ -46,6 +46,8 @@ import au.com.shiftyjelly.pocketcasts.localization.R as LR
internal class AddToPlaylistFragment : BaseDialogFragment() {
private val args get() = requireArguments().requireParcelable<Args>(NEW_INSTANCE_ARGS)
+ private var isDoneTapped = false
+
private val viewModel by viewModels<AddTo... | modules/features/filters/src/main/java/au/com/shiftyjelly/pocketcasts/playlists/manual/AddToPlaylistFragment.kt | 26 | Kotlin | 0.857 | suggestion | 1,005 | 51 | 51 | false | Commit playlist changes only when tapping CTA | 4,746 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.rxkotlin.plusAssign
import io.reactivex.rxkotlin.subscribeBy
import au.com.shiftyjelly.pocketcasts.images.R as IR
import au.com.shiftyjelly.pocketcasts.localization.R as LR
import au.com.shiftyjelly.pocketcasts.ui.R as UR
abstract class BaseEpisod... | The `isPlaying` field is not reset when binding a new episode, which could cause the play button to briefly show the wrong state when a ViewHolder is recycled. For example, if a ViewHolder previously showed a playing episode and is recycled to show a non-playing episode, `isPlaying` will still be `true` until the obser... | import io.reactivex.disposables.CompositeDisposable
import io.reactivex.rxkotlin.plusAssign
import io.reactivex.rxkotlin.subscribeBy
import au.com.shiftyjelly.pocketcasts.images.R as IR
import au.com.shiftyjelly.pocketcasts.localization.R as LR
import au.com.shiftyjelly.pocketcasts.ui.R as UR
abstract class BaseEpisod... | @@ -51,7 +51,11 @@ abstract class BaseEpisodeViewHolder<T : Any>(
private var boundItem: T? = null
- private val episode get() = toPodcastEpisode(requireNotNull(boundItem))
+ private var isPlaying = false | modules/features/podcasts/src/main/java/au/com/shiftyjelly/pocketcasts/podcasts/view/podcast/BaseEpisodeViewHolder.kt | 26 | Kotlin | 1 | bug | 824 | 51 | 51 | false | Fix unplayed episode UI state | 4,749 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
)
LottieAnimation(
composition = composition,
progress = { if (freezeAnimation) 1f else progress },
modifier = Modifier
.matchParentSize()
.scale(1.2f),
contentScale = ContentScale.FillWidth,
)
val coverSiz... | The share button is inside the `capturable` so it will be included in the share image. | iterations = LottieConstants.IterateForever,
isPlaying = !freezeAnimation,
)
LottieAnimation(
composition = composition,
progress = { if (freezeAnimation) 1f else progress },
modifier = Modifier
.matchParentSize()
... | @@ -48,105 +57,140 @@ internal fun NumberOfShowsStory(
controller: StoryCaptureController,
onShareStory: (File) -> Unit,
) {
- val smallCoverSize = 160.dp * measurements.scale
- val smallSpacingSize = smallCoverSize / 10
- val largeCoverSize = 200.dp * measurements.scale
- val largeSpacingSize = ... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/NumberOfShowsStory.kt | 26 | Kotlin | 0.357 | suggestion | 86 | 51 | 51 | false | [Playback] Number of shows and episodes | 4,752 | Automattic/pocket-casts-android | 1,688 | Kotlin | geekygecko | sztomek |
uuid = podcastId,
cornerSize = 4.dp,
modifier = Modifier
.size(coverSize)
.graphicsLayer {
scaleX = scale
scaleY = scale
transla... | It's really close but there's something not quite smooth enough to match the design (on the left).
https://github.com/user-attachments/assets/25e94520-acae-4c13-805e-24f7e7a61c6e | pageSize = PageSize.Fixed(coverSize),
pageSpacing = -coverSize * (1f - peekFraction) + 8.dp,
contentPadding = PaddingValues(vertical = coverSize * peekFraction * peekingItems),
) { page ->
if (podcastIds.isEmpty()) return@VerticalPager
val podcastId = ... | @@ -48,105 +57,140 @@ internal fun NumberOfShowsStory(
controller: StoryCaptureController,
onShareStory: (File) -> Unit,
) {
- val smallCoverSize = 160.dp * measurements.scale
- val smallSpacingSize = smallCoverSize / 10
- val largeCoverSize = 200.dp * measurements.scale
- val largeSpacingSize = ... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/NumberOfShowsStory.kt | 26 | Kotlin | 0.429 | suggestion | 179 | 34 | 46 | false | [Playback] Number of shows and episodes | 4,752 | Automattic/pocket-casts-android | 1,688 | Kotlin | geekygecko | sztomek |
initialPage = Int.MAX_VALUE / 2,
pageCount = { Int.MAX_VALUE },
)
val isPreview = LocalInspectionMode.current
val freezeAnimation = freezeAnimation || isPreview
LaunchedEffect(freezeAnimation) {
while (true) {
delay(700)
if (!freezeAnimation) {
... | When `freezeAnimation` is true, the LaunchedEffect will continue running its infinite loop and keep calling `delay(700)` indefinitely without doing anything useful. This wastes resources during sharing.
Consider cancelling the coroutine when `freezeAnimation` is true:
```kotlin
LaunchedEffect(freezeAnimation) {
i... | freezeAnimation: Boolean = false,
peekFraction: Float = .1f,
peekingItems: Int = 3,
) {
val pagerState = rememberPagerState(
initialPage = PAGE_COUNT / 2,
pageCount = { PAGE_COUNT },
)
val isPreview = LocalInspectionMode.current
val freezeAnimation = freezeAnimation || isPre... | @@ -48,105 +58,144 @@ internal fun NumberOfShowsStory(
controller: StoryCaptureController,
onShareStory: (File) -> Unit,
) {
- val smallCoverSize = 160.dp * measurements.scale
- val smallSpacingSize = smallCoverSize / 10
- val largeCoverSize = 200.dp * measurements.scale
- val largeSpacingSize = ... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/NumberOfShowsStory.kt | 26 | Kotlin | 0.857 | bug | 686 | 51 | 51 | false | [Playback] Number of shows and episodes | 4,752 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
freezeAnimation = controller.isSharing,
)
ShareStoryButton(
modifier = Modifier
.padding(bottom = 18.dp)
.align(alignment = Alignment.BottomCenter),
story = story,
controller = controller,
onShare = onShareStory... | Using `Int.MAX_VALUE` for the page count creates an extremely large pager that could cause memory or performance issues. Since the initial page is set to `Int.MAX_VALUE / 2`, users would need to scroll billions of pages to reach the end, which is unlikely but theoretically possible and would cause issues.
Consider usi... | modifier = Modifier.align(alignment = Alignment.Center),
freezeAnimation = controller.isSharing,
)
ShareStoryButton(
modifier = Modifier
.padding(bottom = 18.dp)
.align(alignment = Alignment.BottomCenter),
story = story,
... | @@ -48,105 +58,144 @@ internal fun NumberOfShowsStory(
controller: StoryCaptureController,
onShareStory: (File) -> Unit,
) {
- val smallCoverSize = 160.dp * measurements.scale
- val smallSpacingSize = smallCoverSize / 10
- val largeCoverSize = 200.dp * measurements.scale
- val largeSpacingSize = ... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/NumberOfShowsStory.kt | 26 | Kotlin | 1 | performance | 613 | 51 | 51 | false | [Playback] Number of shows and episodes | 4,752 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
animationSpec = tween(
durationMillis = 650,
easing = CubicBezierEasing(.9f, 0f, .08f, 1f),
),
)
}
}
}
Box(
modifier = modifier.height(coverSize + coverSize * peekFraction * peeki... | Multiple magic numbers are used without explanation: `.1f` (peekFraction), `3` (peekingItems), `1.2f` (scale), `8.dp` (pageSpacing offset). These should be extracted as named constants to improve code maintainability:
```kotlin
private const val PEEK_FRACTION = 0.1f
private const val PEEKING_ITEMS = 3
private const va... | delay(SCROLL_INTERVAL)
while (true) {
if (!freezeAnimation) {
pagerState.animateScrollToPage(
page = pagerState.currentPage + 1,
animationSpec = tween(
durationMillis = SCROLL_ANIM_DURATION_MS,
... | @@ -48,105 +58,144 @@ internal fun NumberOfShowsStory(
controller: StoryCaptureController,
onShareStory: (File) -> Unit,
) {
- val smallCoverSize = 160.dp * measurements.scale
- val smallSpacingSize = smallCoverSize / 10
- val largeCoverSize = 200.dp * measurements.scale
- val largeSpacingSize = ... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/NumberOfShowsStory.kt | 26 | Kotlin | 0.857 | refactor | 390 | 51 | 51 | false | [Playback] Number of shows and episodes | 4,752 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
.capturable(controller.captureController(story))
.fillMaxSize()
.background(story.backgroundColor)
.padding(top = measurements.closeButtonBottomEdge + 16.dp),
) {
val windowSize = currentWindowAdaptiveInfo().windowSizeClass
TextH10(
text = ... | The `TextH10` component is set to the top of the screen with `textAlign = TextAlign.Center`, but there's no alignment modifier to center it horizontally. The text will be centered within its own width, but the composable itself may not be horizontally centered.
Add `.align(Alignment.TopCenter)` to ensure the text is c... | modifier = Modifier
.capturable(controller.captureController(story))
.fillMaxSize()
.background(story.backgroundColor)
.padding(top = measurements.closeButtonBottomEdge + 16.dp),
) {
val windowSize = currentWindowAdaptiveInfo().windowSizeClass
... | @@ -48,105 +58,144 @@ internal fun NumberOfShowsStory(
controller: StoryCaptureController,
onShareStory: (File) -> Unit,
) {
- val smallCoverSize = 160.dp * measurements.scale
- val smallSpacingSize = smallCoverSize / 10
- val largeCoverSize = 200.dp * measurements.scale
- val largeSpacingSize = ... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/NumberOfShowsStory.kt | 26 | Kotlin | 0.786 | suggestion | 958 | 51 | 51 | false | [Playback] Number of shows and episodes | 4,752 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
),
)
}
}
}
Box(
modifier = modifier.height(coverSize + coverSize * peekFraction * peekingItems * 2),
contentAlignment = Alignment.Center,
) {
VerticalPager(
state = pagerState,
beyondViewportPageCount = ... | The `podcastIds` list could be empty, which would cause a division by zero error on this line: `podcastIds[page % podcastIds.size]`.
Consider adding a check for empty list:
```kotlin
if (podcastIds.isEmpty()) return
val podcastId = podcastIds[page % podcastIds.size]
``` | pagerState.animateScrollToPage(
page = pagerState.currentPage + 1,
animationSpec = tween(
durationMillis = SCROLL_ANIM_DURATION_MS,
easing = CubicBezierEasing(.9f, 0f, .08f, 1f),
),
... | @@ -48,105 +58,144 @@ internal fun NumberOfShowsStory(
controller: StoryCaptureController,
onShareStory: (File) -> Unit,
) {
- val smallCoverSize = 160.dp * measurements.scale
- val smallSpacingSize = smallCoverSize / 10
- val largeCoverSize = 200.dp * measurements.scale
- val largeSpacingSize = ... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/NumberOfShowsStory.kt | 26 | Kotlin | 1 | suggestion | 273 | 51 | 51 | false | [Playback] Number of shows and episodes | 4,752 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
private fun PodcastCoverCarousel(
podcastIds: List<String>,
coverSize: Dp,
modifier: Modifier = Modifier,
freezeAnimation: Boolean = false,
peekFraction: Float = .1f,
peekingItems: Int = 3,
) {
val pagerState = rememberPagerState(
initialPage = Int.MAX_VALUE / 2,
pageCount = ... | The magic numbers 700ms (delay) and 650ms (animation duration) should be extracted as named constants to improve code maintainability and make their purpose clearer. Consider defining them at the top of the file or as function parameters:
```kotlin
private const val CAROUSEL_SCROLL_DELAY_MS = 700
private const val CAR... | private const val PAGE_COUNT = 100
private val SCROLL_INTERVAL = 700.milliseconds
private val SCROLL_ANIM_DURATION_MS = 650
@Composable
private fun PodcastCoverCarousel(
podcastIds: List<String>,
coverSize: Dp,
modifier: Modifier = Modifier,
freezeAnimation: Boolean = false,
peekFraction: Float = .... | @@ -48,105 +58,144 @@ internal fun NumberOfShowsStory(
controller: StoryCaptureController,
onShareStory: (File) -> Unit,
) {
- val smallCoverSize = 160.dp * measurements.scale
- val smallSpacingSize = smallCoverSize / 10
- val largeCoverSize = 200.dp * measurements.scale
- val largeSpacingSize = ... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/NumberOfShowsStory.kt | 26 | Kotlin | 0.857 | refactor | 538 | 51 | 51 | false | [Playback] Number of shows and episodes | 4,752 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
initialPage = Int.MAX_VALUE / 2,
pageCount = { Int.MAX_VALUE },
)
val isPreview = LocalInspectionMode.current
val freezeAnimation = freezeAnimation || isPreview
LaunchedEffect(freezeAnimation) {
while (true) {
delay(700)
if (!freezeAnimation) {
... | The `LaunchedEffect` will execute the infinite loop immediately without waiting for the first delay. This means the first page transition will happen almost instantly (after 700ms), but subsequent transitions may have a shorter or inconsistent delay if the animation duration (650ms) is close to the delay (700ms).
Cons... | freezeAnimation: Boolean = false,
peekFraction: Float = .1f,
peekingItems: Int = 3,
) {
val pagerState = rememberPagerState(
initialPage = PAGE_COUNT / 2,
pageCount = { PAGE_COUNT },
)
val isPreview = LocalInspectionMode.current
val freezeAnimation = freezeAnimation || isPre... | @@ -48,105 +58,144 @@ internal fun NumberOfShowsStory(
controller: StoryCaptureController,
onShareStory: (File) -> Unit,
) {
- val smallCoverSize = 160.dp * measurements.scale
- val smallSpacingSize = smallCoverSize / 10
- val largeCoverSize = 200.dp * measurements.scale
- val largeSpacingSize = ... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/NumberOfShowsStory.kt | 26 | Kotlin | 0.857 | bug | 903 | 51 | 51 | false | [Playback] Number of shows and episodes | 4,752 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
)
TextP40(
text = stringResource(R.string.end_of_year_story_listened_to_numbers_subtitle),
fontSize = 15.sp,
disableAutoScale = true,
color = colorResource(UR.color.coolgrey_90),
modifier = Modifier.padding(horizonta... | The `PAGE_COUNT` constant is set to 100, creating 100 pages with only 7 podcast IDs. This means the same 7 podcasts will cycle many times. When the user reaches page 100, the pager will stop advancing. Consider either:
1. Using a much larger `PAGE_COUNT` (e.g., `Int.MAX_VALUE / 2`) to effectively create infinite scrol... | )
val coverSize = if (windowSize.isAtMostMediumHeight()) {
180.dp
} else {
260.dp
}
PodcastCoverCarousel(
podcastIds = story.randomShowIds,
coverSize = coverSize,
modifier = Modifier.align(alignment = Alignment.Center),... | @@ -48,105 +59,150 @@ internal fun NumberOfShowsStory(
controller: StoryCaptureController,
onShareStory: (File) -> Unit,
) {
- val smallCoverSize = 160.dp * measurements.scale
- val smallSpacingSize = smallCoverSize / 10
- val largeCoverSize = 200.dp * measurements.scale
- val largeSpacingSize = ... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/NumberOfShowsStory.kt | 26 | Kotlin | 1 | suggestion | 673 | 51 | 51 | false | [Playback] Number of shows and episodes | 4,752 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
uuid = podcastId,
elevation = coverElevation,
cornerSize = 4.dp,
modifier = Modifier.size(coverSize),
)
}
}
@Preview(device = Devices.PORTRAIT_REGULAR)
@Composable
private fun NumberOfShowsPreview() {
PreviewBox(currentPage = 1) { measurements ->
... | The `LaunchedEffect` has a logic issue where animations will never resume after being frozen. When `freezeAnimation` is true, the coroutine enters an infinite loop without yielding, but the `if (!freezeAnimation)` check inside means it will never progress. The loop should either break when frozen or use a proper state ... | peekFraction: Float = .1f,
peekingItems: Int = 3,
) {
val pagerState = rememberPagerState(
initialPage = PAGE_COUNT / 2,
pageCount = { PAGE_COUNT },
)
val isPreview = LocalInspectionMode.current
val freezeAnimation = freezeAnimation || isPreview
LaunchedEffect(freezeAnimati... | @@ -48,105 +59,150 @@ internal fun NumberOfShowsStory(
controller: StoryCaptureController,
onShareStory: (File) -> Unit,
) {
- val smallCoverSize = 160.dp * measurements.scale
- val smallSpacingSize = smallCoverSize / 10
- val largeCoverSize = 200.dp * measurements.scale
- val largeSpacingSize = ... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/NumberOfShowsStory.kt | 26 | Kotlin | 0.857 | bug | 847 | 26 | 51 | false | [Playback] Number of shows and episodes | 4,752 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
),
manager.getAutoPlayEpisodes("playlist-id-0", currentEpisodeUuid = null),
)
manager.updateSortType("playlist-id-0", PlaylistEpisodeSortType.OldestToNewest)
assertEquals(
listOf(
podcastEpisode(index = 2, podcastIndex = 0),
po... | Grammatical error: "ignore" should be "ignored".
```suggestion
// Make sure that current episode is added even if it is ignored to correctly determine the next episode.
``` | ),
manager.getAutoPlayEpisodes("playlist-id-0", currentEpisodeUuid = null),
)
manager.updateSortType("playlist-id-0", PlaylistEpisodeSortType.OldestToNewest)
assertEquals(
listOf(
podcastEpisode(index = 2, podcastIndex = 0),
po... | @@ -569,4 +569,54 @@ class PlaylistManagerSmartTest {
expectRearrangeTooltipSet()
}
+
+ @Test
+ fun getAutoPlayEpisodes() = dsl.test {
+ insertSmartPlaylist(index = 0)
+ insertPodcast(index = 0)
+ repeat(3) { index ->
+ insertPodcastEpisode(index = index, podcastInd... | app/src/androidTest/java/au/com/shiftyjelly/pocketcasts/repositories/playlist/PlaylistManagerSmartTest.kt | 26 | Kotlin | 0.929 | suggestion | 180 | 38 | 38 | false | Continue auto play from the correct position | 4,755 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
podcastEpisode(index = 2, podcastIndex = 0),
),
manager.getAutoPlayEpisodes("playlist-id-0", currentEpisodeUuid = null),
)
manager.updateSortType("playlist-id-0", PlaylistEpisodeSortType.OldestToNewest)
assertEquals(
listOf(
po... | Grammatical error: "ignore" should be "ignored".
```suggestion
// Make sure that current episode is added even if it is ignored to correctly determine the next episode.
``` | podcastEpisode(index = 2, podcastIndex = 0),
),
manager.getAutoPlayEpisodes("playlist-id-0", currentEpisodeUuid = null),
)
manager.updateSortType("playlist-id-0", PlaylistEpisodeSortType.OldestToNewest)
assertEquals(
listOf(
po... | @@ -751,4 +751,54 @@ class PlaylistManagerManualTest {
expectRearrangeTooltipSet()
}
+
+ @Test
+ fun getAutoPlayEpisodes() = dsl.test {
+ insertManualPlaylist(index = 0)
+ insertPodcast(index = 0)
+ repeat(3) { index ->
+ insertPodcastEpisode(index = index, podcastI... | app/src/androidTest/java/au/com/shiftyjelly/pocketcasts/repositories/playlist/PlaylistManagerManualTest.kt | 26 | Kotlin | 0.929 | suggestion | 180 | 38 | 38 | false | Continue auto play from the correct position | 4,755 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
package au.com.shiftyjelly.pocketcasts.repositories.playlist
import app.cash.turbine.test
import au.com.shiftyjelly.pocketcasts.models.entity.PlaylistEntity.Companion.SYNC_STATUS_NOT_SYNCED
import au.com.shiftyjelly.pocketcasts.models.entity.PodcastEpisode
import au.com.shiftyjelly.pocketcasts.models.type.EpisodePlayi... | Typo in comment: "ignore" should be "ignored". | podcastEpisode(index = 2, podcastIndex = 0),
),
manager.getAutoPlayEpisodes("playlist-id-0", currentEpisodeUuid = null),
)
manager.updateSortType("playlist-id-0", PlaylistEpisodeSortType.OldestToNewest)
assertEquals(
listOf(
po... | @@ -751,4 +751,54 @@ class PlaylistManagerManualTest {
expectRearrangeTooltipSet()
}
+
+ @Test
+ fun getAutoPlayEpisodes() = dsl.test {
+ insertManualPlaylist(index = 0)
+ insertPodcast(index = 0)
+ repeat(3) { index ->
+ insertPodcastEpisode(index = index, podcastI... | app/src/androidTest/java/au/com/shiftyjelly/pocketcasts/repositories/playlist/PlaylistManagerManualTest.kt | 26 | Kotlin | 0.143 | suggestion | 46 | 755 | 38 | false | Continue auto play from the correct position | 4,755 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
package au.com.shiftyjelly.pocketcasts.repositories.playlist
import au.com.shiftyjelly.pocketcasts.models.entity.ManualPlaylistEpisodeSource
import au.com.shiftyjelly.pocketcasts.models.entity.ManualPlaylistPodcastSource
import au.com.shiftyjelly.pocketcasts.models.entity.PodcastEpisode
import au.com.shiftyjelly.pocke... | Missing documentation for the new `getAutoPlayEpisodes` function. Add a KDoc comment explaining:
- The purpose of this function (retrieving episodes for auto-play functionality)
- The behavior when `currentEpisodeUuid` is null vs. non-null
- That it includes archived episodes only if they match the `currentEpisodeUuid`... | package au.com.shiftyjelly.pocketcasts.repositories.playlist
import au.com.shiftyjelly.pocketcasts.models.entity.ManualPlaylistEpisodeSource
import au.com.shiftyjelly.pocketcasts.models.entity.ManualPlaylistPodcastSource
import au.com.shiftyjelly.pocketcasts.models.entity.PodcastEpisode
import au.com.shiftyjelly.pocke... | @@ -8,15 +8,16 @@ import au.com.shiftyjelly.pocketcasts.models.to.PlaylistEpisodeMetadata
import au.com.shiftyjelly.pocketcasts.models.to.PlaylistPreviewForEpisode
import au.com.shiftyjelly.pocketcasts.models.type.SmartRules
import kotlinx.coroutines.flow.Flow
-import kotlinx.coroutines.flow.MutableStateFlow
import... | modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/playlist/PlaylistManager.kt | 19 | Kotlin | 0.929 | suggestion | 1,728 | 44 | 44 | false | Continue auto play from the correct position | 4,755 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
@Composable
private fun CenterContent(
story: Story.TopShow,
modifier: Modifier = Modifier,
) = BoxWithConstraints(
modifier = modifier,
contentAlignment = Alignment.Center,
) {
val composition by rememberLottieComposition(
spec = LottieCompositionSpec.RawRes(R.raw.playback_top_show_lottie),... | The animation duration and cubic bezier easing values are hardcoded magic numbers. Consider extracting these as named constants (e.g., `ANIMATION_DURATION_MS = 1000` and a descriptive constant for the bezier curve) to improve maintainability and make it easier to adjust animations consistently if design specs change ag... | controller = controller,
onShare = onShareStory,
)
}
}
@Composable
private fun CenterContent(
story: Story.TopShow,
modifier: Modifier = Modifier,
) = BoxWithConstraints(
modifier = modifier,
contentAlignment = Alignment.Center,
) {
val composition by rememberLot... | @@ -129,9 +129,13 @@ private fun CenterContent(
iterations = 1,
)
val isPlaying = progress > 0f
+ val animationSpec = tween<Float>(
+ durationMillis = 1000,
+ easing = CubicBezierEasing(.33f, 0f, 0f, 1f),
+ ) | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/TopShowStory.kt | 26 | Kotlin | 0.643 | refactor | 324 | 51 | 51 | false | [Playback] Tweak top show animation | 4,758 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
started = SharingStarted.Eagerly,
initialValue = 0,
)
internal fun onScreenShown() {
tracker.track(AnalyticsEvent.PROFILE_SHOWN)
}
internal fun onSettingsClick() {
tracker.track(AnalyticsEvent.PROFILE_SETTINGS_BUTTON_TAPPED)
}
internal fun onHeaderClick() {
... | Inconsistent analytics parameter usage. The analytics tracking here uses a raw `mapOf("year" to ...)` instead of using `AnalyticsParameter.YEAR` constant like the new methods in `AnalyticsTracker`. Consider using:
```kotlin
tracker.track(
AnalyticsEvent.END_OF_YEAR_PROFILE_CARD_SHOWN,
mapOf(AnalyticsParameter.Y... | started = SharingStarted.Eagerly,
initialValue = 0,
)
internal fun onScreenShown() {
tracker.track(AnalyticsEvent.PROFILE_SHOWN)
}
internal fun onSettingsClick() {
tracker.track(AnalyticsEvent.PROFILE_SETTINGS_BUTTON_TAPPED)
}
internal fun onHeaderClick() {
... | @@ -144,6 +144,13 @@ class ProfileViewModel @Inject constructor(
refreshStatsTrigger.tryEmit(Unit)
}
+ internal fun onEndOfYearCardShown() {
+ tracker.track(
+ AnalyticsEvent.END_OF_YEAR_PROFILE_CARD_SHOWN,
+ mapOf("year" to EndOfYearManager.YEAR_TO_SYNC.value),
+ ... | modules/features/profile/src/main/java/au/com/shiftyjelly/pocketcasts/profile/ProfileViewModel.kt | 26 | Kotlin | 0.857 | suggestion | 526 | 51 | 51 | false | Fix Playback model showing | 4,760 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
scope = viewModelScope,
started = SharingStarted.Eagerly,
initialValue = 0,
)
internal fun onScreenShown() {
tracker.track(AnalyticsEvent.PROFILE_SHOWN)
}
internal fun onSettingsClick() {
tracker.track(AnalyticsEvent.PROFILE_SETTINGS_BUTTON_TAPPED)
}
in... | Use the `AnalyticsParameter.YEAR` constant instead of the hardcoded string `\"year\"` for consistency with the new tracking methods in `AnalyticsTracker.kt` (lines 223, 232, 241). | scope = viewModelScope,
started = SharingStarted.Eagerly,
initialValue = 0,
)
internal fun onScreenShown() {
tracker.track(AnalyticsEvent.PROFILE_SHOWN)
}
internal fun onSettingsClick() {
tracker.track(AnalyticsEvent.PROFILE_SETTINGS_BUTTON_TAPPED)
}
in... | @@ -144,6 +144,13 @@ class ProfileViewModel @Inject constructor(
refreshStatsTrigger.tryEmit(Unit)
}
+ internal fun onEndOfYearBannerShown() {
+ tracker.track(
+ AnalyticsEvent.END_OF_YEAR_PROFILE_CARD_SHOWN,
+ mapOf("year" to EndOfYearManager.YEAR_TO_SYNC.value),
+ ... | modules/features/profile/src/main/java/au/com/shiftyjelly/pocketcasts/profile/ProfileViewModel.kt | 26 | Kotlin | 0.571 | suggestion | 179 | 51 | 51 | false | Improve Playback analytics | 4,761 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
modifier = modifier.height(coverSize + coverSize * peekFraction * peekingItems * 2),
contentAlignment = Alignment.Center,
) {
VerticalPager(
state = pagerState,
beyondViewportPageCount = peekingItems,
userScrollEnabled = false,
pageSize = PageS... | The alpha calculation has a logic issue at the boundary condition. When `pageOffset = maxOffset - 1f` (e.g., 3.0 when peekingItems = 4), the condition `pageOffset <= (maxOffset - 1f)` is true, so alpha is 1f. However, the fade-out should start at this point.
Consider changing the condition to use `<` instead of `<=`:
... | contentAlignment = Alignment.Center,
) {
VerticalPager(
state = pagerState,
beyondViewportPageCount = peekingItems,
userScrollEnabled = false,
pageSize = PageSize.Fixed(coverSize),
pageSpacing = -coverSize * (1f - peekFraction) + 8.dp,
... | @@ -191,6 +194,13 @@ private fun PodcastCoverCarousel(
if (pageOffset <= peekingItems) {
val scale = 1f - (pageOffset * peekFraction).coerceAtMost(peekFraction * peekingItems)
+ val maxOffset = peekingItems.toFloat()
+ val imageAlpha = if (pageOffset >= 0.0f... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/NumberOfShowsStory.kt | 26 | Kotlin | 0.857 | suggestion | 660 | 51 | 51 | false | Animate alpha of the last cover in the number of shows story | 4,763 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
)
}
}
Box(
modifier = modifier.height(coverSize + coverSize * peekFraction * peekingItems * 2),
contentAlignment = Alignment.Center,
) {
VerticalPager(
state = pagerState,
beyondViewportPageCount = peekingItems,
userScrollEnabl... | The condition `pageOffset >= 0.0f` is redundant. Since `pageOffset` is computed as `relativePosition.absoluteValue` on line 193, it's guaranteed to be non-negative. The condition can be simplified to:
```kotlin
val imageAlpha = if (pageOffset <= (maxOffset - 1f)) {
```
```suggestion
val imageAlpha = if ... | }
}
Box(
modifier = modifier.height(coverSize + coverSize * peekFraction * peekingItems * 2),
contentAlignment = Alignment.Center,
) {
VerticalPager(
state = pagerState,
beyondViewportPageCount = peekingItems,
userScrollEnabled = false,
... | @@ -191,6 +194,13 @@ private fun PodcastCoverCarousel(
if (pageOffset <= peekingItems) {
val scale = 1f - (pageOffset * peekFraction).coerceAtMost(peekFraction * peekingItems)
+ val maxOffset = peekingItems.toFloat()
+ val imageAlpha = if (pageOffset >= 0.0f... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/NumberOfShowsStory.kt | 26 | Kotlin | 0.786 | suggestion | 358 | 51 | 51 | false | Animate alpha of the last cover in the number of shows story | 4,763 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
Box(
modifier = modifier.height(coverSize + coverSize * peekFraction * peekingItems * 2),
contentAlignment = Alignment.Center,
) {
VerticalPager(
state = pagerState,
beyondViewportPageCount = peekingItems,
userScrollEnabled = false,
pageSiz... | The `LinearEasing.transform()` call is redundant since linear easing is an identity function (returns the input unchanged). You can simplify this to just `normalizedOffset`:
```kotlin
val imageAlpha = if (pageOffset <= (maxOffset - 1f)) {
1f
} else {
(-pageOffset + maxOffset).coerceIn(0f, 1f)
}
```
This would... | modifier = modifier.height(coverSize + coverSize * peekFraction * peekingItems * 2),
contentAlignment = Alignment.Center,
) {
VerticalPager(
state = pagerState,
beyondViewportPageCount = peekingItems,
userScrollEnabled = false,
pageSize = PageS... | @@ -191,6 +194,13 @@ private fun PodcastCoverCarousel(
if (pageOffset <= peekingItems) {
val scale = 1f - (pageOffset * peekFraction).coerceAtMost(peekFraction * peekingItems)
+ val maxOffset = peekingItems.toFloat()
+ val imageAlpha = if (pageOffset <= (max... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/NumberOfShowsStory.kt | 26 | Kotlin | 0.857 | refactor | 415 | 51 | 51 | false | Animate alpha of the last cover in the number of shows story | 4,763 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
private fun createStories(
stats: EndOfYearStats,
randomShowIds: RandomShowIds?,
subscription: Subscription?,
topPodcastsLink: String?,
): List<Story> = buildList {
add(Story.Cover)
if (randomShowIds != null) {
add(
Story.NumberOfShows(... | The `progress.value = 0f` assignment on line 191 is redundant with the same assignment inside the `Duration.INFINITE` branch (line 195) and the `else` branch (line 203). Consider removing the duplicate assignments inside the branches to avoid redundancy. | add(
Story.YearVsYear(
lastYearDuration = stats.lastYearPlaybackTime,
thisYearDuration = stats.playbackTime,
subscriptionTier = subscription?.tier,
),
)
add(
Story.CompletionRate(
listenedCount = ... | @@ -220,41 +188,31 @@ class EndOfYearViewModel @AssistedInject constructor(
internal fun onStoryChanged(story: Story) {
trackStoryShown(story)
viewModelScope.launch {
- countDownJob?.cancelAndJoin()
progress.value = 0f
- val previewDuration = story.previewDurati... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/EndOfYearViewModel.kt | 26 | Kotlin | 0.643 | refactor | 254 | 51 | 51 | false | Fix manual progress interactions | 4,764 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
): List<Story> = buildList {
add(Story.Cover)
if (randomShowIds != null) {
add(
Story.NumberOfShows(
showCount = stats.playedPodcastCount,
episodeCount = stats.playedEpisodeCount,
randomShowIds = (randomShowIds.t... | The `when` expression can be simplified since both `Duration.INFINITE` and the `else` branch set `progress.value = 0f`. Consider combining these cases or restructuring the logic to reduce duplication.
```suggestion
null -> {
progress.value = 1f
}
Durat... | ),
)
add(
Story.CompletionRate(
listenedCount = stats.playedEpisodeCount,
completedCount = stats.completedEpisodeCount,
subscriptionTier = subscription?.tier,
),
)
add(Story.Ending)
}
internal fu... | @@ -220,41 +188,31 @@ class EndOfYearViewModel @AssistedInject constructor(
internal fun onStoryChanged(story: Story) {
trackStoryShown(story)
viewModelScope.launch {
- countDownJob?.cancelAndJoin()
progress.value = 0f
- val previewDuration = story.previewDurati... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/EndOfYearViewModel.kt | 26 | Kotlin | 1 | suggestion | 399 | 51 | 51 | false | Fix manual progress interactions | 4,764 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
OnboardingLauncher.openOnboardingFlow(requireActivity(), onboardingFlow)
},
onCancelSubscription = { winbackParams ->
analyticsTracker.track(AnalyticsEvent.ACCOUNT_DETAILS_CANCEL_TAPPED)
WinbackFragment
.create(winbackParams)
... | The `flow` property should use the `analyticsValue` property of the `OnboardingFlow` object. Currently, it's passing the object itself instead of its string value. This should be:
```kotlin
"flow" to OnboardingFlow.NewOnboardingAccountUpgrade.analyticsValue,
```
```suggestion
"flow" to Onboardin... | OnboardingLauncher.openOnboardingFlow(requireActivity(), onboardingFlow)
},
onCancelSubscription = { winbackParams ->
analyticsTracker.track(AnalyticsEvent.ACCOUNT_DETAILS_CANCEL_TAPPED)
WinbackFragment
.create(winbackParams)
... | @@ -156,7 +157,12 @@ class AccountDetailsFragment : BaseFragment() {
onSignOut = { signOut() },
onDeleteAccount = { deleteAccount() },
onAccountUpgradeClick = {
- analyticsTracker.track(AnalyticsEvent.PLUS_PROMOTION_UPGRADE_BUTTON_TAPPED, mapOf("version" to "1"))
+ ... | modules/features/profile/src/main/java/au/com/shiftyjelly/pocketcasts/profile/AccountDetailsFragment.kt | 26 | Kotlin | 0.857 | suggestion | 373 | 51 | 51 | false | [Onboarding] Fix analytics on Upgrade screens | 4,765 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
},
onCancelSubscription = { winbackParams ->
analyticsTracker.track(AnalyticsEvent.ACCOUNT_DETAILS_CANCEL_TAPPED)
WinbackFragment
.create(winbackParams)
.show(childFragmentManager, "subscription_winback")
},
... | The "flow" property should be passed as `OnboardingFlow.NewOnboardingAccountUpgrade.analyticsValue` instead of just the object. Analytics tracking expects a String value, not the flow object itself.
```suggestion
"flow" to OnboardingFlow.NewOnboardingAccountUpgrade.analyticsValue,
``` | },
onCancelSubscription = { winbackParams ->
analyticsTracker.track(AnalyticsEvent.ACCOUNT_DETAILS_CANCEL_TAPPED)
WinbackFragment
.create(winbackParams)
.show(childFragmentManager, "subscription_winback")
},
... | @@ -156,7 +157,13 @@ class AccountDetailsFragment : BaseFragment() {
onSignOut = { signOut() },
onDeleteAccount = { deleteAccount() },
onAccountUpgradeClick = {
- analyticsTracker.track(AnalyticsEvent.PLUS_PROMOTION_UPGRADE_BUTTON_TAPPED, mapOf("version" to "1"))
+ ... | modules/features/profile/src/main/java/au/com/shiftyjelly/pocketcasts/profile/AccountDetailsFragment.kt | 26 | Kotlin | 0.857 | suggestion | 309 | 51 | 51 | false | [Onboarding] Fix analytics on Upgrade screens | 4,765 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
"product" to "com.pocketcasts.plus.yearly",
"source" to "purchase_source",
"error" to "unknown",
"error_code" to 404,
),
)
}
@Test
fun `legacy product property`() = runTest {
val keys = listOf(
Subscript... | ❓ Was this discussed somewhere in details? This change can potentially break any dashboards that we have and rely on the `product` analytics value. | "error_code" to 404,
),
)
}
@Test
fun `legacy product property`() = runTest {
val keys = listOf(
SubscriptionPlan.PlusMonthlyPreview.key,
SubscriptionPlan.PlusYearlyPreview.key,
SubscriptionPlan.PatronMonthlyPreview.key,
... | @@ -101,8 +104,8 @@ class AnalyticsPaymentListenerTest {
val productProperties = tracker.events.map { it.properties["product"] }
assertEquals(
listOf(
- "monthly",
- "yearly",
+ "com.pocketcasts.plus.monthly",
+ "com.pocketcasts.... | modules/services/repositories/src/test/java/au/com/shiftyjelly/pocketcasts/repositories/payment/AnalyticsPaymentListenerTest.kt | 26 | Kotlin | 0.571 | suggestion | 147 | 51 | 51 | false | [Onboarding] Fix analytics on Upgrade screens | 4,765 | Automattic/pocket-casts-android | 1,688 | Kotlin | MiSikora | sztomek |
is OnboardingUpgradeFeaturesState.Loaded -> {
if (FeatureFlag.isEnabled(Feature.NEW_ONBOARDING_UPGRADE)) {
OnboardingUpgradeScreen(
onClosePress = {
if (source == OnboardingUpgradeSource.RECOMMENDATIONS) {
onNotN... | The `changeBillingCycle` call in the old onboarding flow (when `NEW_ONBOARDING_UPGRADE` feature flag is disabled) is missing the `source` parameter, while the new onboarding flow includes it. This creates inconsistent analytics tracking between the two flows.
The call should be updated to: `viewModel.changeBillingCycl... | is OnboardingUpgradeFeaturesState.Loaded -> {
if (FeatureFlag.isEnabled(Feature.NEW_ONBOARDING_UPGRADE)) {
OnboardingUpgradeScreen(
onClosePress = {
if (source == OnboardingUpgradeSource.RECOMMENDATIONS) {
onNotN... | @@ -161,8 +161,8 @@ internal fun OnboardingUpgradeFeaturesPage(
onChangeBillingCycle = { viewModel.changeBillingCycle(it) }, | modules/features/account/src/main/java/au/com/shiftyjelly/pocketcasts/account/onboarding/upgrade/OnboardingUpgradeFeaturesPage.kt | 26 | Kotlin | 0.857 | suggestion | 441 | 51 | 51 | false | [Onboarding] Fix analytics on Upgrade screens | 4,765 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
val properties = analyticsProps(flow = flow, variant = experimentProvider.getVariation(Experiment.NewOnboardingABTest).toNewOnboardingVariant()).toMutableMap().apply {
put("value", tier.analyticsValue)
}
analyticsTracker.track(AnalyticsEvent.PLUS_PROMOTION_SUBSCRIPTION_TIER_CHANGED, ... | Inconsistent `flow` value in purchase analytics. When `source` is `FINISHED_ONBOARDING`, the `analyticsProps` function (line 226) converts the flow to `InitialOnboarding`, but here the `purchaseFlow` parameter uses `flow.analyticsValue` directly without this conversion. This will cause the purchase event to have `flow=... | }
}
fun changeSubscriptionTier(tier: SubscriptionTier) {
val properties = analyticsProps(flow = flow, variant = experimentProvider.getVariation(Experiment.NewOnboardingABTest).toNewOnboardingVariant()).toMutableMap().apply {
put("value", tier.analyticsValue)
}
analyt... | @@ -120,13 +124,14 @@ class OnboardingUpgradeFeaturesViewModel @AssistedInject constructor(
fun purchaseSelectedPlan(
activity: Activity,
onComplete: () -> Unit,
+ source: OnboardingUpgradeSource? = null,
) {
_state.update { value -> (value as? OnboardingUpgradeFeaturesState.... | modules/features/account/src/main/java/au/com/shiftyjelly/pocketcasts/account/viewmodel/OnboardingUpgradeFeaturesViewModel.kt | 26 | Kotlin | 0.857 | suggestion | 1,256 | 51 | 51 | false | [Onboarding] Fix analytics on Upgrade screens | 4,765 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
playButtonListener: PlayButtonListener,
onScroll: () -> Unit,
filterOptions: List<ResultsFilters>,
selectedFilterIndex: Int,
onFilterSelect: (ResultsFilters) -> Unit,
onResultsShown: () -> Unit,
onEmptyResultsShown: () -> Unit,
modifier: Modifier = Modifier,
) {
val nestedScrollConne... | The `LaunchedEffect` will re-trigger whenever `state` changes, including when filters are changed via `selectFilter()`. This could cause duplicate analytics tracking.
For example, if a user performs a search and gets results, then changes from "Top Results" to "Podcasts" filter, the `LaunchedEffect` will fire again an... | playButtonListener: PlayButtonListener,
onScroll: () -> Unit,
filterOptions: List<ResultsFilters>,
selectedFilterIndex: Int,
onFilterSelect: (ResultsFilters) -> Unit,
onResultsShow: () -> Unit,
onEmptyResultsShow: () -> Unit,
modifier: Modifier = Modifier,
) {
val nestedScrollConnect... | @@ -112,6 +126,14 @@ private fun ImprovedSearchResultsView(
}
val listState = rememberLazyListState()
+ LaunchedEffect(state) {
+ if (!state.results.filteredResults.isEmpty()) {
+ onResultsShown()
+ } else if (!state.searchTerm.isEmpty()){
+ onEmptyResultsShown()
+ ... | modules/features/search/src/main/java/au/com/shiftyjelly/pocketcasts/search/ImprovedSearchResultsPage.kt | 26 | Kotlin | 0.786 | refactor | 548 | 51 | 51 | false | [Improved Search] Fix analytics | 4,772 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
onPodcastClick: (ImprovedSearchResultItem.PodcastItem) -> Unit,
onFolderClick: (Folder, List<Podcast>) -> Unit,
onFollowPodcast: (ImprovedSearchResultItem.PodcastItem) -> Unit,
playButtonListener: PlayButtonListener,
onScroll: () -> Unit,
filterOptions: List<ResultsFilters>,
selectedFilterIn... | Missing space before the closing parenthesis. Should be `isEmpty()` instead of `isEmpty()`.
```suggestion
} else if (!state.searchTerm.isEmpty()) {
``` | onPodcastClick: (ImprovedSearchResultItem.PodcastItem) -> Unit,
onFolderClick: (Folder, List<Podcast>) -> Unit,
onFollowPodcast: (ImprovedSearchResultItem.PodcastItem) -> Unit,
playButtonListener: PlayButtonListener,
onScroll: () -> Unit,
filterOptions: List<ResultsFilters>,
selectedFilterIn... | @@ -112,6 +126,14 @@ private fun ImprovedSearchResultsView(
}
val listState = rememberLazyListState()
+ LaunchedEffect(state) {
+ if (!state.results.filteredResults.isEmpty()) {
+ onResultsShown()
+ } else if (!state.searchTerm.isEmpty()){ | modules/features/search/src/main/java/au/com/shiftyjelly/pocketcasts/search/ImprovedSearchResultsPage.kt | 26 | Kotlin | 0.786 | suggestion | 159 | 51 | 51 | false | [Improved Search] Fix analytics | 4,772 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
emptyFlow()
} else if (query.isBlank()) {
flowOf(SearchUiState.SearchOperation.Success(searchTerm = query, results = SearchResults.ImprovedResults(results = emptyList(), filter = ResultsFilters.TOP_RESULTS)))
} else {
flow {
emi... | `SEARCH_PERFORMED` analytics event is not tracked when the search query starts with "http" (URL search). The event tracking at line 364 is only executed in the `else` block, so URL-based searches won't be tracked.
Consider moving the analytics tracking before the `if (query.startsWith("http"))` check (around line 347)... | emptyFlow()
} else if (query.isBlank()) {
flowOf(SearchUiState.SearchOperation.Success(searchTerm = query, results = SearchResults.ImprovedResults(results = emptyList(), filter = ResultsFilters.TOP_RESULTS)))
} else {
flow {
emi... | @@ -361,6 +361,7 @@ class SearchHandler @Inject constructor(
emit(SearchUiState.SearchOperation.Success(searchTerm = query, results = SearchResults.ImprovedResults(results = localResults, filter = ResultsFilters.TOP_RESULTS)))
}
val apiResul... | modules/features/search/src/main/java/au/com/shiftyjelly/pocketcasts/search/SearchHandler.kt | 26 | Kotlin | 0.786 | suggestion | 373 | 51 | 51 | false | [Improved Search] Fix analytics | 4,772 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
bottomInset: Dp,
onEpisodeClick: (ImprovedSearchResultItem.EpisodeItem) -> Unit,
onPodcastClick: (ImprovedSearchResultItem.PodcastItem) -> Unit,
onFolderClick: (Folder, List<Podcast>) -> Unit,
onFollowPodcast: (ImprovedSearchResultItem.PodcastItem) -> Unit,
playButtonListener: PlayButtonListener... | [nitpick] Use the `isNotEmpty()` extension function instead of the negated `isEmpty()` for better readability and Kotlin idiomatic style.
```suggestion
if (state.results.filteredResults.isNotEmpty()) {
``` | bottomInset: Dp,
onEpisodeClick: (ImprovedSearchResultItem.EpisodeItem) -> Unit,
onPodcastClick: (ImprovedSearchResultItem.PodcastItem) -> Unit,
onFolderClick: (Folder, List<Podcast>) -> Unit,
onFollowPodcast: (ImprovedSearchResultItem.PodcastItem) -> Unit,
playButtonListener: PlayButtonListener... | @@ -112,6 +126,14 @@ private fun ImprovedSearchResultsView(
}
val listState = rememberLazyListState()
+ LaunchedEffect(state, onResultsShow, onEmptyResultsShow) {
+ if (!state.results.filteredResults.isEmpty()) { | modules/features/search/src/main/java/au/com/shiftyjelly/pocketcasts/search/ImprovedSearchResultsPage.kt | 26 | Kotlin | 0.857 | suggestion | 213 | 51 | 51 | false | [Improved Search] Fix analytics | 4,772 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
onPodcastClick: (ImprovedSearchResultItem.PodcastItem) -> Unit,
onFolderClick: (Folder, List<Podcast>) -> Unit,
onFollowPodcast: (ImprovedSearchResultItem.PodcastItem) -> Unit,
playButtonListener: PlayButtonListener,
onScroll: () -> Unit,
filterOptions: List<ResultsFilters>,
selectedFilterIn... | [nitpick] Use the `isNotEmpty()` extension function instead of the negated `isEmpty()` for better readability and Kotlin idiomatic style.
```suggestion
} else if (state.searchTerm.isNotEmpty()) {
``` | onPodcastClick: (ImprovedSearchResultItem.PodcastItem) -> Unit,
onFolderClick: (Folder, List<Podcast>) -> Unit,
onFollowPodcast: (ImprovedSearchResultItem.PodcastItem) -> Unit,
playButtonListener: PlayButtonListener,
onScroll: () -> Unit,
filterOptions: List<ResultsFilters>,
selectedFilterIn... | @@ -112,6 +126,14 @@ private fun ImprovedSearchResultsView(
}
val listState = rememberLazyListState()
+ LaunchedEffect(state, onResultsShow, onEmptyResultsShow) {
+ if (!state.results.filteredResults.isEmpty()) {
+ onResultsShow()
+ } else if (!state.searchTerm.isEmpty()) { | modules/features/search/src/main/java/au/com/shiftyjelly/pocketcasts/search/ImprovedSearchResultsPage.kt | 26 | Kotlin | 0.857 | suggestion | 207 | 51 | 51 | false | [Improved Search] Fix analytics | 4,772 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
onPodcastClick: (ImprovedSearchResultItem.PodcastItem) -> Unit,
onFolderClick: (Folder, List<Podcast>) -> Unit,
onFollowPodcast: (ImprovedSearchResultItem.PodcastItem) -> Unit,
playButtonListener: PlayButtonListener,
onScroll: () -> Unit,
filterOptions: List<ResultsFilters>,
selectedFilterIn... | The `LaunchedEffect` with `state` as a key will re-trigger analytics events every time the state changes, including when filters are selected or results are updated. This could lead to duplicate analytics tracking for the same search result view.
Consider using more specific keys that uniquely identify when results sh... | onPodcastClick: (ImprovedSearchResultItem.PodcastItem) -> Unit,
onFolderClick: (Folder, List<Podcast>) -> Unit,
onFollowPodcast: (ImprovedSearchResultItem.PodcastItem) -> Unit,
playButtonListener: PlayButtonListener,
onScroll: () -> Unit,
filterOptions: List<ResultsFilters>,
selectedFilterIn... | @@ -112,6 +126,14 @@ private fun ImprovedSearchResultsView(
}
val listState = rememberLazyListState()
+ LaunchedEffect(state, onResultsShow, onEmptyResultsShow) {
+ if (!state.results.filteredResults.isEmpty()) {
+ onResultsShow()
+ } else if (!state.searchTerm.isEmpty()) { | modules/features/search/src/main/java/au/com/shiftyjelly/pocketcasts/search/ImprovedSearchResultsPage.kt | 26 | Kotlin | 0.857 | refactor | 731 | 51 | 51 | false | [Improved Search] Fix analytics | 4,772 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
package au.com.shiftyjelly.pocketcasts.models.to
import au.com.shiftyjelly.pocketcasts.payment.SubscriptionTier
import kotlin.math.roundToInt
import kotlin.time.Duration
import kotlin.time.Duration.Companion.seconds
import au.com.shiftyjelly.pocketcasts.models.to.LongestEpisode as LongestEpisodeData
sealed interface ... | [nitpick] Removing this override changes the Cover story's preview duration from 5 seconds to 7 seconds (the default defined in the Story interface). This behavior change seems unrelated to the PR's main purpose of fixing the top shows story title. If this is intentional, consider mentioning it in the PR description or... | package au.com.shiftyjelly.pocketcasts.models.to
import au.com.shiftyjelly.pocketcasts.payment.SubscriptionTier
import kotlin.math.roundToInt
import kotlin.time.Duration
import kotlin.time.Duration.Companion.seconds
import au.com.shiftyjelly.pocketcasts.models.to.LongestEpisode as LongestEpisodeData
sealed interface ... | @@ -22,7 +22,6 @@ sealed interface Story {
data object Cover : Story {
override val isShareable = false
override val analyticsValue = "cover" | modules/services/model/src/main/java/au/com/shiftyjelly/pocketcasts/models/to/Story.kt | 24 | Kotlin | 0.857 | suggestion | 477 | 49 | 49 | false | Playback: Fix top shows story title | 4,784 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import au.com.shiftyjelly.pocketcasts.compose.Devices
import au.com.... | These constants should follow Kotlin naming conventions. Since they're only used within this file, they should be `private const val` with UPPER_SNAKE_CASE naming:
```kotlin
private const val ANIMATION_END_SCALE = 1.3f
private const val ANIMATION_START_SCALE = 1.8f
``` | import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import au.com.shiftyjelly.pocketcasts.compose.Devices
import au.com.... | @@ -59,7 +58,8 @@ import kotlin.time.Duration.Companion.days
import au.com.shiftyjelly.pocketcasts.localization.R as LR
import au.com.shiftyjelly.pocketcasts.ui.R as UR
-private const val MEDIUM_HEIGHT_FACTOR = .6f
+val AnimationEndScale = 1.3f
+val AnimationStartScale = 1.8f | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/TopShowStory.kt | 26 | Kotlin | 0.857 | suggestion | 269 | 51 | 51 | false | [Playback] Top Story fix scale issues | 4,795 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
var footerHeight by remember { mutableStateOf(0.dp) }
val density = LocalDensity.current
Header(
measurements = measurements,
modifier = Modifier
.fillMaxWidth()
.onSizeChanged { size ->
... | The growth calculation may be incorrect. The animation scales from `AnimationStartScale` (1.8f) to `AnimationEndScale` (1.3f), so the maximum scale factor is 1.8f, not 1.3f. The calculation should account for the start scale:
```kotlin
val contentHeightMinusGrowth = contentHeight / AnimationStartScale
```
This ensures ... | var footerHeight by remember { mutableStateOf(0.dp) }
val density = LocalDensity.current
Header(
measurements = measurements,
modifier = Modifier
.fillMaxWidth()
.onSizeChanged { size ->
... | @@ -77,34 +77,40 @@ internal fun TopShowStory(
.background(story.backgroundColor)
.padding(top = measurements.closeButtonBottomEdge + 16.dp, bottom = 64.dp),
) {
- val windowSize = currentWindowAdaptiveInfo().windowSizeClass
- val sizeFactor = if (windowS... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/TopShowStory.kt | 26 | Kotlin | 1 | bug | 617 | 51 | 51 | false | [Playback] Top Story fix scale issues | 4,795 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
package au.com.shiftyjelly.pocketcasts.wear.ui.episode
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.re... | These imports are no longer used after migrating from `rememberColumnState(factory = ScalingLazyColumnDefaults.belowTimeText(...))` to `rememberResponsiveColumnState(...)`. Both `ScalingLazyColumnDefaults` and `rememberColumnState` can be removed.
```suggestion
``` |
package au.com.shiftyjelly.pocketcasts.wear.ui.episode
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.re... | @@ -24,6 +24,7 @@ import au.com.shiftyjelly.pocketcasts.wear.ui.player.NowPlayingScreen
import au.com.shiftyjelly.pocketcasts.wear.ui.player.StreamingConfirmationScreen
import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults
import com.google.android.horologist.compose.layout.rememberColumnStat... | wear/src/main/kotlin/au/com/shiftyjelly/pocketcasts/wear/ui/episode/EpisodeScreenFlow.kt | 26 | Kotlin | 0.857 | suggestion | 266 | 51 | 51 | false | Upgrade Compose, Wear Compose, and Horologist | 4,796 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
package au.com.shiftyjelly.pocketcasts.wear.ui.episode
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
im... | The import `com.google.android.horologist.compose.layout.rememberColumnState` is no longer used after migrating to `rememberResponsiveColumnState`. This unused import should be removed.
```suggestion
``` | package au.com.shiftyjelly.pocketcasts.wear.ui.episode
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
im... | @@ -20,6 +20,7 @@ import com.google.android.horologist.compose.layout.ScalingLazyColumnDefaults
import com.google.android.horologist.compose.layout.ScalingLazyColumnState
import com.google.android.horologist.compose.layout.ScreenScaffold
import com.google.android.horologist.compose.layout.rememberColumnState | wear/src/main/kotlin/au/com/shiftyjelly/pocketcasts/wear/ui/episode/UpNextOptionsScreen.kt | 22 | Kotlin | 0.857 | suggestion | 204 | 47 | 47 | false | Upgrade Compose, Wear Compose, and Horologist | 4,796 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
import com.google.android.horologist.compose.pager.PagerScreen
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch
object NowPlayingPager {
const val PAGE_COUNT = 3
}
/**
* Pager with three pages:
*
* 1. [firstPageContent] (passed in as a composable argument)
* 2. [NowPlayingScreen]
* 3. [UpN... | Typo: `columState` should be `columnState` to match the property name in the `NowPlayingPagerScope` class (line 122). | import com.google.android.horologist.compose.pager.PagerScreen
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch
object NowPlayingPager {
const val PAGE_COUNT = 3
}
/**
* Pager with three pages:
*
* 1. [firstPageContent] (passed in as a composable argument)
* 2. [NowPlayingScreen]
* 3. [UpN... | @@ -44,7 +44,7 @@ fun NowPlayingPager(
firstPageContent: @Composable NowPlayingPagerScope.() -> Unit,
) {
val pagerState = rememberPagerState { NowPlayingPager.PAGE_COUNT }
- val columState = rememberColumnState()
+ val columState = rememberResponsiveColumnState() | wear/src/main/kotlin/au/com/shiftyjelly/pocketcasts/wear/ui/component/NowPlayingPager.kt | 26 | Kotlin | 0.571 | suggestion | 117 | 51 | 51 | false | Upgrade Compose, Wear Compose, and Horologist | 4,796 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
disableAutoScale = true,
color = colorResource(UR.color.white),
modifier = Modifier.padding(horizontal = 24.dp),
)
TextP40(
text = stringResource(
LR.string.end_of_year_story_longest_episode_subtitle,
story.episode.episodeTi... | The `modifier` parameter is being used twice in this function. Line 255 uses it for the `Column`, and line 257 uses it again for the `Box`, which will cause the Column's modifier to be overridden. The Box should use `Modifier` instead of `modifier` to avoid this conflict.
```suggestion
modifier = Modifier,
``` | color = colorResource(UR.color.white),
modifier = Modifier.padding(horizontal = 24.dp),
)
TextP40(
text = stringResource(
LR.string.end_of_year_story_longest_episode_subtitle,
story.episode.episodeTitle,
story.episode.po... | @@ -261,18 +254,18 @@ private fun Footer(
modifier: Modifier = Modifier,
) = Column(modifier = modifier, horizontalAlignment = Alignment.CenterHorizontally) {
Box(
- modifier = Modifier.weight(1f),
- contentAlignment = Alignment.Center,
+ modifier = modifier, | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/LongestEpisodeStory.kt | 26 | Kotlin | 0.857 | suggestion | 319 | 51 | 51 | false | [Playback] Fix Longest episode analytics scaling | 4,797 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import au.com.shiftyjelly.pocketcasts.compose.Devices
import au.com.shiftyjelly.pocketcasts.compose.components.Podca... | The constant `SMALL_SCREEN_SIZE_FACTOR` was changed from `.6f` to `.7f`, but this constant is no longer used in the code after the refactoring. Consider removing this unused constant.
```suggestion
``` | import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import au.com.shiftyjelly.pocketcasts.compose.Devices
import au.com.shiftyjelly.pocketcasts.compose.components.Podca... | @@ -64,7 +61,7 @@ import java.io.File
import au.com.shiftyjelly.pocketcasts.localization.R as LR
import au.com.shiftyjelly.pocketcasts.ui.R as UR
-private const val SMALL_SCREEN_SIZE_FACTOR = .6f
+private const val SMALL_SCREEN_SIZE_FACTOR = .7f | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/LongestEpisodeStory.kt | 26 | Kotlin | 0.857 | refactor | 202 | 51 | 51 | false | [Playback] Fix Longest episode analytics scaling | 4,797 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
internal fun trackStoriesShown() {
trackEvent(
AnalyticsEvent.END_OF_YEAR_STORIES_SHOWN,
mapOf("source" to source.value),
)
}
internal fun trackStoriesClosed(source: String, story: Story?) {
trackStoriesDismissed(
story = story,
source... | ℹ️ Could the arguments order between this and `trackStoriesClosed()` functions be aligned? | internal fun trackStoriesShown() {
trackEvent(
AnalyticsEvent.END_OF_YEAR_STORIES_SHOWN,
mapOf("source" to source.value),
)
}
internal fun trackStoriesClosed(source: String, story: Story?) {
trackStoriesDismissed(
story = story,
source... | @@ -307,21 +307,31 @@ class EndOfYearViewModel @AssistedInject constructor(
)
}
- internal fun trackStoriesClosed(source: String) {
- trackEvent(
- AnalyticsEvent.END_OF_YEAR_STORIES_DISMISSED,
- mapOf("source" to source),
+ internal fun trackStoriesClosed(source: Stri... | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/EndOfYearViewModel.kt | 26 | Kotlin | 0.429 | question | 90 | 51 | 51 | false | [Playback] App review | 4,803 | Automattic/pocket-casts-android | 1,688 | Kotlin | MiSikora | geekygecko |
if (showScreenshotDialog) {
ScreenshotDetectedDialog(
onNotNow = {
showScreenshotDialog = false
viewModel.resumeStoryAutoProgress(StoryProgressPauseReason.ScreenshotDialog)
},
onShare = {
show... | ℹ️ Not a part of this PR but we can simplify this to `state.stories`. | if (showScreenshotDialog) {
ScreenshotDetectedDialog(
onNotNow = {
showScreenshotDialog = false
viewModel.resumeStoryAutoProgress(StoryProgressPauseReason.ScreenshotDialog)
},
onShare = {
show... | @@ -213,8 +215,9 @@ class StoriesActivity : ComponentActivity() {
LaunchedEffect(Unit) {
viewModel.switchStory.collect {
val stories = (state as? UiState.Synced)?.stories ?: (state as? UiState.Syncing)?.stories.orEmpty() | modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/StoriesActivity.kt | 26 | Kotlin | 0.429 | refactor | 69 | 51 | 51 | false | [Playback] App review | 4,803 | Automattic/pocket-casts-android | 1,688 | Kotlin | MiSikora | geekygecko |
import au.com.shiftyjelly.pocketcasts.repositories.download.DownloadManager
import au.com.shiftyjelly.pocketcasts.repositories.playback.PlayAllHandler
import au.com.shiftyjelly.pocketcasts.repositories.playback.PlayAllResponse
import au.com.shiftyjelly.pocketcasts.repositories.playback.PlaybackManager
import au.com.shi... | The import `au.com.shiftyjelly.pocketcasts.views.R as VR` is unused. It should be removed to keep the code clean.
```suggestion
``` | import au.com.shiftyjelly.pocketcasts.repositories.download.DownloadManager
import au.com.shiftyjelly.pocketcasts.repositories.playback.PlayAllHandler
import au.com.shiftyjelly.pocketcasts.repositories.playback.PlayAllResponse
import au.com.shiftyjelly.pocketcasts.repositories.playback.PlaybackManager
import au.com.shi... | @@ -35,6 +36,7 @@ import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.launch
+import au.com.shiftyjelly.pocketcasts.views.R as VR | modules/features/filters/src/main/java/au/com/shiftyjelly/pocketcasts/playlists/PlaylistViewModel.kt | 26 | Kotlin | 0.929 | suggestion | 132 | 51 | 51 | false | Open a playlist on startup | 4,808 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.com... | Unused import: `verticalNavigationBars` is imported but never used in the code. This import should be removed.
```suggestion
``` | import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.com... | @@ -65,6 +66,7 @@ import au.com.shiftyjelly.pocketcasts.compose.components.PagerDotIndicator
import au.com.shiftyjelly.pocketcasts.compose.components.TextH30
import au.com.shiftyjelly.pocketcasts.compose.components.TextH40
import au.com.shiftyjelly.pocketcasts.compose.components.TextP40
+import au.com.shiftyjelly.po... | modules/features/reimagine/src/main/kotlin/au/com/shiftyjelly/pocketcasts/reimagine/clip/ShareClipPage.kt | 26 | Kotlin | 0.786 | suggestion | 129 | 51 | 51 | false | Fix sharing edge-to-edge issues | 4,810 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
}
@Composable
private fun VerticalClipPage(
episode: PodcastEpisode?,
podcast: Podcast?,
clipRange: Clip.Range,
playbackProgress: Duration,
isPlaying: Boolean,
sharingState: SharingState,
shareColors: ShareColors,
platforms: Set<SocialPlatform>,
useEpisodeArtwork: Boolean,
useKe... | Missing navigation bar padding in horizontal layout: The `HorizontalClipPage` function (line 284-377) doesn't have `.navigationBarsPadding()` applied, while `VerticalClipPage` does. In landscape mode with 3-button navigation, the UI may still be obstructed. Consider applying the same fix to the horizontal layout for co... |
@Composable
private fun VerticalClipPage(
episode: PodcastEpisode?,
podcast: Podcast?,
clipRange: Clip.Range,
playbackProgress: Duration,
isPlaying: Boolean,
sharingState: SharingState,
shareColors: ShareColors,
platforms: Set<SocialPlatform>,
useEpisodeArtwork: Boolean,
useKeyb... | @@ -205,7 +207,8 @@ private fun VerticalClipPage(
Box(
modifier = Modifier
.background(shareColors.background)
- .fillMaxSize(),
+ .fillMaxSize()
+ .navigationBarsPadding(), | modules/features/reimagine/src/main/kotlin/au/com/shiftyjelly/pocketcasts/reimagine/clip/ShareClipPage.kt | 26 | Kotlin | 0.643 | suggestion | 330 | 51 | 51 | false | Fix sharing edge-to-edge issues | 4,810 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.ksp)
alias(libs.plugins.hilt)
alias(libs.plugins.sentry)
alias(libs.plugins.google.services)
alias(libs.plugins.compose.compiler)
}
sentry {
p... | The `project.property()` call can return `null` if the property is not defined, which would set `projectName` to `null`. This could cause issues with Sentry configuration. Consider using a pattern similar to other properties in the codebase that require non-null values, or provide a fallback/validation.
For example, y... | plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.ksp)
alias(libs.plugins.hilt)
alias(libs.plugins.sentry)
alias(libs.plugins.google.services)
alias(libs.plugins.compose.compiler)
}
sentry {
p... | @@ -9,6 +9,10 @@ plugins {
alias(libs.plugins.compose.compiler)
}
+sentry {
+ projectName = project.property("sentryAndroidProject")?.toString() | app/build.gradle.kts | 13 | Kotlin | 1 | suggestion | 670 | 38 | 38 | false | Use per-project Sentry configuration | 4,818 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.ksp)
alias(libs.plugins.hilt)
alias(libs.plugins.sentry)
alias(libs.plugins.aboutlibraries)
alias(libs.plugins.aboutlibraries.android)
alias(libs.plugins.compose.compiler)
}
sentry {
... | The `project.property()` call can return `null` if the property is not defined, which would set `projectName` to `null`. This could cause issues with Sentry configuration. Consider using a pattern similar to other properties in the codebase that require non-null values, or provide a fallback/validation.
For example, y... | plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.ksp)
alias(libs.plugins.hilt)
alias(libs.plugins.sentry)
alias(libs.plugins.aboutlibraries)
alias(libs.plugins.aboutlibraries.android)
alias(libs.plugins.compose.compiler)
}
sentry {
... | @@ -9,6 +9,10 @@ plugins {
alias(libs.plugins.compose.compiler)
}
+sentry {
+ projectName = project.property("sentryAutomotiveProject")?.toString() | automotive/build.gradle.kts | 13 | Kotlin | 1 | suggestion | 682 | 38 | 38 | false | Use per-project Sentry configuration | 4,818 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.ksp)
alias(libs.plugins.hilt)
alias(libs.plugins.sentry)
alias(l... | The `project.property()` call can return `null` if the property is not defined, which would set `projectName` to `null`. This could cause issues with Sentry configuration. Consider using a pattern similar to other properties in the codebase that require non-null values, or provide a fallback/validation.
For example, y... | import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.ksp)
alias(libs.plugins.hilt)
alias(libs.plugins.sentry)
alias(l... | @@ -11,6 +11,10 @@ plugins {
alias(libs.plugins.compose.compiler)
}
+sentry {
+ projectName = project.property("sentryWearProject")?.toString() | wear/build.gradle.kts | 15 | Kotlin | 1 | suggestion | 658 | 40 | 40 | false | Use per-project Sentry configuration | 4,818 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.ksp)
alias(libs.plugins.hilt)
alias(libs.plugins.sentry)
alias(libs.plugins.google.services)
alias(libs.plugins.compose.compiler)
}
sentry {
p... | Using `project.property()` will throw a `MissingPropertyException` if the property doesn't exist. Use `project.findProperty()` instead, which returns `null` when the property is missing.
Change to:
```kotlin
projectName = project.findProperty("sentryAndroidProject")?.toString()
``` | plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.ksp)
alias(libs.plugins.hilt)
alias(libs.plugins.sentry)
alias(libs.plugins.google.services)
alias(libs.plugins.compose.compiler)
}
sentry {
p... | @@ -9,6 +9,10 @@ plugins {
alias(libs.plugins.compose.compiler)
}
+sentry {
+ projectName = project.property("sentryAndroidProject")?.toString() | app/build.gradle.kts | 13 | Kotlin | 1 | suggestion | 283 | 38 | 38 | false | Use per-project Sentry configuration | 4,818 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
}
}
buildFeatures {
buildConfig = true
viewBinding = true
compose = true
}
buildTypes {
named("debug") {
manifestPlaceholders["appIcon"] = "@mipmap/ic_launcher_radioactive"
}
named("debugProd") {
manifestPlaceholders["app... | Using `project.property()` will throw a `MissingPropertyException` if the property doesn't exist. Use `project.findProperty()` instead, which returns `null` when the property is missing.
Change to:
```kotlin
if (project.findProperty("sentryAndroidProject")?.toString().isNullOrBlank()) {
``` | }
}
buildFeatures {
buildConfig = true
viewBinding = true
compose = true
}
buildTypes {
named("debug") {
manifestPlaceholders["appIcon"] = "@mipmap/ic_launcher_radioactive"
}
named("debugProd") {
manifestPlaceholders["app... | @@ -46,8 +50,8 @@ android {
named("release") {
manifestPlaceholders["appIcon"] = "@mipmap/ic_launcher"
- if (!file("${project.rootDir}/sentry.properties").exists()) {
- println("WARNING: Sentry configuration file 'sentry.properties' not found. The ProGuard mapping files... | app/build.gradle.kts | 26 | Kotlin | 1 | suggestion | 292 | 51 | 51 | false | Use per-project Sentry configuration | 4,818 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.ksp)
alias(libs.plugins.hilt)
alias(libs.plugins.sentry)
alias(libs.plugins.aboutlibraries)
alias(libs.plugins.aboutlibraries.android)
alias(libs.plugins.compose.compiler)
}
sentry {
... | Using `project.property()` will throw a `MissingPropertyException` if the property doesn't exist. Use `project.findProperty()` instead, which returns `null` when the property is missing.
Change to:
```kotlin
projectName = project.findProperty("sentryAutomotiveProject")?.toString()
```
```suggestion
projectName = p... | plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.ksp)
alias(libs.plugins.hilt)
alias(libs.plugins.sentry)
alias(libs.plugins.aboutlibraries)
alias(libs.plugins.aboutlibraries.android)
alias(libs.plugins.compose.compiler)
}
sentry {
... | @@ -9,6 +9,10 @@ plugins {
alias(libs.plugins.compose.compiler)
}
+sentry {
+ projectName = project.property("sentryAutomotiveProject")?.toString() | automotive/build.gradle.kts | 13 | Kotlin | 1 | suggestion | 382 | 38 | 38 | false | Use per-project Sentry configuration | 4,818 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
defaultConfig {
minSdk = project.property("minSdkVersionAutomotive") as Int
targetSdk = project.property("targetSdkVersionAutomotive") as Int
applicationId = project.property("applicationId").toString()
}
buildFeatures {
buildConfig = true
viewBinding = true
... | Using `project.property()` will throw a `MissingPropertyException` if the property doesn't exist. Use `project.findProperty()` instead, which returns `null` when the property is missing.
Change to:
```kotlin
if (project.findProperty("sentryAutomotiveProject")?.toString().isNullOrBlank()) {
``` |
defaultConfig {
minSdk = project.property("minSdkVersionAutomotive") as Int
targetSdk = project.property("targetSdkVersionAutomotive") as Int
applicationId = project.property("applicationId").toString()
}
buildFeatures {
buildConfig = true
viewBinding = true
... | @@ -35,6 +39,10 @@ android {
named("release") {
manifestPlaceholders["appIcon"] = "@mipmap/ic_launcher"
+
+ if (project.property("sentryAutomotiveProject")?.toString().isNullOrBlank()) { | automotive/build.gradle.kts | 26 | Kotlin | 1 | suggestion | 295 | 51 | 51 | false | Use per-project Sentry configuration | 4,818 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.ksp)
alias(libs.plugins.hilt)
alias(libs.plugins.sentry)
alias(l... | Using `project.property()` will throw a `MissingPropertyException` if the property doesn't exist. Use `project.findProperty()` instead, which returns `null` when the property is missing.
Change to:
```kotlin
projectName = project.findProperty("sentryWearProject")?.toString()
``` | import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompilerOptions
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.ksp)
alias(libs.plugins.hilt)
alias(libs.plugins.sentry)
alias(l... | @@ -11,6 +11,10 @@ plugins {
alias(libs.plugins.compose.compiler)
}
+sentry {
+ projectName = project.property("sentryWearProject")?.toString() | wear/build.gradle.kts | 15 | Kotlin | 1 | suggestion | 280 | 40 | 40 | false | Use per-project Sentry configuration | 4,818 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
sentry {
projectName = project.property("sentryWearProject")?.toString()
}
android {
namespace = "au.com.shiftyjelly.pocketcasts"
defaultConfig {
minSdk = project.property("minSdkVersionWear") as Int
targetSdk = project.property("targetSdkVersionWear") as Int
applicationId = projec... | Using `project.property()` will throw a `MissingPropertyException` if the property doesn't exist. Use `project.findProperty()` instead, which returns `null` when the property is missing.
Change to:
```kotlin
if (project.findProperty("sentryWearProject")?.toString().isNullOrBlank()) {
```
```suggestion
if (... | sentry {
projectName = project.findProperty("sentryWearProject")?.toString()
}
android {
namespace = "au.com.shiftyjelly.pocketcasts"
defaultConfig {
minSdk = project.property("minSdkVersionWear") as Int
targetSdk = project.property("targetSdkVersionWear") as Int
applicationId = pr... | @@ -32,8 +36,8 @@ android {
named("release") {
manifestPlaceholders["appIcon"] = "@mipmap/ic_launcher"
- if (!file("${project.rootDir}/sentry.properties").exists()) {
- println("WARNING: Sentry configuration file 'sentry.properties' not found. The ProGuard mapping files... | wear/build.gradle.kts | 26 | Kotlin | 1 | suggestion | 396 | 51 | 51 | false | Use per-project Sentry configuration | 4,818 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
import android.graphics.PorterDuff
import android.graphics.PorterDuffXfermode
import au.com.shiftyjelly.pocketcasts.ui.R
import au.com.shiftyjelly.pocketcasts.ui.extensions.getThemeColor
import au.com.shiftyjelly.pocketcasts.ui.theme.Theme
import coil3.size.Size
import coil3.transform.Transformation
class ThemedImageT... | ⛏️ This could be imported `as CoilBitmap`. | import android.graphics.PorterDuff
import android.graphics.PorterDuffXfermode
import au.com.shiftyjelly.pocketcasts.ui.R
import au.com.shiftyjelly.pocketcasts.ui.extensions.getThemeColor
import au.com.shiftyjelly.pocketcasts.ui.theme.Theme
import coil3.size.Size
import coil3.transform.Transformation
import coil3.Bitmap... | @@ -32,7 +32,7 @@ class ThemedImageTintTransformation(context: Context) : Transformation {
return id.hashCode()
}
- override suspend fun transform(input: Bitmap, size: Size): Bitmap {
+ override suspend fun transform(input: coil3.Bitmap, size: Size): coil3.Bitmap { | modules/services/ui/src/main/java/au/com/shiftyjelly/pocketcasts/ui/images/ThemedImageTintTransformation.kt | 26 | Kotlin | 0.286 | suggestion | 42 | 51 | 51 | false | Migrate Coil from 2.7.0 to 3.3.0 | 4,821 | Automattic/pocket-casts-android | 1,688 | Kotlin | MiSikora | geekygecko |
appLifecycleAnalytics.onNewApplicationInstall()
// new installs default to not forcing up next to use the dark theme
settings.useDarkUpNextTheme.set(false, updateModifiedAt = false)
// new installations default to not displaying the tooltip
settings.showPodc... | The test `handlesNewInstallPhone()` in `AppLifecycleObserverTest.kt` needs to be updated to account for the new conditional logic. The test currently expects `autoDownloadOnFollowPodcastSetting.set(true, updateModifiedAt = false)` to be called unconditionally, but now it will only be called when the key doesn't exist i... | appLifecycleAnalytics.onNewApplicationInstall()
// new installs default to not forcing up next to use the dark theme
settings.useDarkUpNextTheme.set(false, updateModifiedAt = false)
// new installations default to not displaying the tooltip
settings.showPodc... | @@ -139,7 +139,10 @@ class AppLifecycleObserver(
settings.autoPlayNextEpisodeOnEmpty.set(true, updateModifiedAt = false)
// For new users we want to auto download on follow podcast by default
- settings.autoDownloadOnFollowPodcast.set(true, updateModifiedAt... | modules/features/shared/src/main/java/au/com/shiftyjelly/pocketcasts/shared/AppLifecycleObserver.kt | 26 | Kotlin | 0.786 | suggestion | 513 | 43 | 46 | false | Allow to pre-initialize auto downloads setting | 4,823 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | MiSikora |
val trackColor = ThemeColor.playerHighlight07(theme.activeTheme, tintColor)
val bufferingColor = ThemeColor.playerHighlight07(theme.activeTheme, tintColor)
binding.progressBar.apply {
// play progress color
progressTintList = ColorStateList.valueOf(progressColor)
... | The Up Next count in `PlayerContainerFragment.kt` (line 196-204) also displays the queue size without applying the same 999 cap. This could lead to the same overflow issue in the full-screen player's Up Next button. Consider applying the same `coerceAtMost(MAX_UP_NEXT_COUNT)` logic here for consistency. | // play progress color
progressTintList = ColorStateList.valueOf(progressColor)
// buffering progress color
secondaryProgressTintList = ColorStateList.valueOf(bufferingColor)
// track color
setBackgroundColor(trackColor)
}
}
fun se... | @@ -151,7 +155,8 @@ class MiniPlayer @JvmOverloads constructor(context: Context, attrs: AttributeSet
}
}
- val upNextCount: Int = upNextState.queueSize()
+ // cap the episode count to avoid small text or overflow issues
+ val upNextCount = upNextState.queueSize().coerceAtMos... | modules/features/player/src/main/java/au/com/shiftyjelly/pocketcasts/player/view/MiniPlayer.kt | 26 | Kotlin | 0.786 | bug | 304 | 51 | 51 | false | Fix mini player Up Next count overflow | 4,826 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
val trackColor = ThemeColor.playerHighlight07(theme.activeTheme, tintColor)
val bufferingColor = ThemeColor.playerHighlight07(theme.activeTheme, tintColor)
binding.progressBar.apply {
// play progress color
progressTintList = ColorStateList.valueOf(progressColor)
... | [nitpick] The comment says "cap" but technically the code limits/caps the count display while the actual queue size remains unchanged. Consider clarifying: "cap the displayed episode count to avoid small text or overflow issues"
```suggestion
// cap the displayed episode count to avoid small text or overflow is... | val progressColor = ThemeColor.playerHighlight01(theme.activeTheme, tintColor)
val trackColor = ThemeColor.playerHighlight07(theme.activeTheme, tintColor)
val bufferingColor = ThemeColor.playerHighlight07(theme.activeTheme, tintColor)
binding.progressBar.apply {
// play progr... | @@ -151,8 +152,9 @@ class MiniPlayer @JvmOverloads constructor(context: Context, attrs: AttributeSet
}
}
- val upNextCount: Int = upNextState.queueSize()
- binding.countText.text = upNextCount.toString()
+ // cap the episode count to avoid small text or overflow issues | modules/features/player/src/main/java/au/com/shiftyjelly/pocketcasts/player/view/MiniPlayer.kt | 26 | Kotlin | 1 | bug | 328 | 51 | 51 | false | Fix mini player Up Next count overflow | 4,826 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
}
LogBuffer.i(LogBuffer.TAG_BACKGROUND_TASKS, "Auto Downloading $numberOfEpisodes episodes after subscribing to $podcastUuid")
DownloadHelper.addAutoDownloadedEpisodeToQueue(
episode,
... | The `execute()` method is a suspend function that returns an `ImageResult`, but the result is not being awaited here. This means the image caching requests will be fired but the function will complete before the images are actually downloaded and cached to disk.
Since this is within an `rxCompletable` block which supp... |
LogBuffer.i(LogBuffer.TAG_BACKGROUND_TASKS, "Auto Downloading $numberOfEpisodes episodes after subscribing to $podcastUuid")
DownloadHelper.addAutoDownloadedEpisodeToQueue(
episode,
"Auto Download a... | @@ -133,14 +135,19 @@ class SubscribeManager @Inject constructor(
}
}
- private fun cacheArtworkRxCompletable(podcast: Podcast): Completable {
- return Completable.fromAction {
- val request = imageRequestFactory.create(podcast)
- .newBuilder()
- .m... | modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/podcast/SubscribeManager.kt | 26 | Kotlin | 0.857 | performance | 678 | 51 | 51 | false | When following a podcast cache the smaller podcast images | 4,827 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
}
LogBuffer.i(LogBuffer.TAG_BACKGROUND_TASKS, "Auto Downloading $numberOfEpisodes episodes after subscribing to $podcastUuid")
DownloadHelper.addAutoDownloadedEpisodeToQueue(
episode,
... | ❓ Why is it wrapped in a `Completable` if it enqueues? |
LogBuffer.i(LogBuffer.TAG_BACKGROUND_TASKS, "Auto Downloading $numberOfEpisodes episodes after subscribing to $podcastUuid")
DownloadHelper.addAutoDownloadedEpisodeToQueue(
episode,
"Auto Download a... | @@ -133,14 +135,19 @@ class SubscribeManager @Inject constructor(
}
}
- private fun cacheArtworkRxCompletable(podcast: Podcast): Completable {
- return Completable.fromAction {
- val request = imageRequestFactory.create(podcast)
- .newBuilder()
- .m... | modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/podcast/SubscribeManager.kt | 26 | Kotlin | 0.357 | question | 54 | 51 | 51 | false | When following a podcast cache the smaller podcast images | 4,827 | Automattic/pocket-casts-android | 1,688 | Kotlin | MiSikora | geekygecko |
package au.com.shiftyjelly.pocketcasts.repositories.podcast
import android.annotation.SuppressLint
import android.content.Context
import au.com.shiftyjelly.pocketcasts.analytics.SourceView
import au.com.shiftyjelly.pocketcasts.models.db.AppDatabase
import au.com.shiftyjelly.pocketcasts.models.entity.ChapterIndices
imp... | The `imageRequestFactory` field is no longer used after refactoring `cacheArtworkRxCompletable()` to directly build `ImageRequest` objects. This field and its associated import (`PocketCastsImageRequestFactory`) should be removed to avoid maintaining unused code. | package au.com.shiftyjelly.pocketcasts.repositories.podcast
import android.annotation.SuppressLint
import android.content.Context
import au.com.shiftyjelly.pocketcasts.analytics.SourceView
import au.com.shiftyjelly.pocketcasts.models.db.AppDatabase
import au.com.shiftyjelly.pocketcasts.models.entity.ChapterIndices
imp... | @@ -15,16 +15,19 @@ import au.com.shiftyjelly.pocketcasts.preferences.Settings
import au.com.shiftyjelly.pocketcasts.repositories.download.DownloadHelper
import au.com.shiftyjelly.pocketcasts.repositories.download.DownloadManager
import au.com.shiftyjelly.pocketcasts.repositories.images.PocketCastsImageRequestFactor... | modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/podcast/SubscribeManager.kt | 17 | Kotlin | 0.786 | performance | 263 | 42 | 42 | false | When following a podcast cache the smaller podcast images | 4,827 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
if (podcast == null) {
emit(UiState.Empty)
return@flow
}
episodeManager.findEpisodesByPodcastOrderedFlow(podcast)
.map { episodes ->
val filtered = episodes.filterNot { it.isArchived || it.isFinished }
podcast.grouping.sortFunc... | The `flow { ... .collect { emit() } }` pattern is an anti-pattern and unnecessarily complex. This should be simplified using `flatMapLatest` or similar operators.
**Suggested refactoring:**
```kotlin
val uiState: StateFlow<UiState> = flow {
val podcast = podcastManager.findPodcastByUuid(podcastUuid)
if (podcas... | val podcast = podcastManager.findPodcastByUuid(podcastUuid)
if (podcast == null) {
emit(UiState.Empty)
} else {
emitAll(
episodeManager.findEpisodesByPodcastOrderedFlow(podcast)
.map { episodes ->
val filtered = ... | @@ -42,32 +39,32 @@ class PodcastViewModel @Inject constructor(
val artworkConfiguration = settings.artworkConfiguration.flow
- var uiState: UiState by mutableStateOf(UiState.Empty)
- private set
+ var uiState: StateFlow<UiState> = flow {
+ val podcast = podcastManager.findPodcastByUuid(pod... | wear/src/main/kotlin/au/com/shiftyjelly/pocketcasts/wear/ui/podcast/PodcastViewModel.kt | 26 | Kotlin | 1 | refactor | 1,206 | 28 | 27 | false | Wear OS hide archived or played episodes | 4,831 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
sealed class UiState {
object Empty : UiState()
data class Loaded(
val podcast: Podcast? = null,
val episodes: List<PodcastEpisode> = emptyList(),
val theme: Theme,
) : UiState()
}
val artworkConfiguration = settings.artworkConfiguration.flow
... | The new episode filtering logic (hiding archived and played episodes) is not covered by tests. The PodcastViewModel contains critical business logic that should be tested, including:
- Episode filtering based on `isArchived` and `isFinished` flags
- Sorting logic with `podcast.grouping.sortFunction`
- Null podcast hand... | private val podcastUuid: String = savedStateHandle[PodcastScreen.ARGUMENT] ?: ""
sealed class UiState {
object Empty : UiState()
data class Loaded(
val podcast: Podcast? = null,
val episodes: List<PodcastEpisode> = emptyList(),
val theme: Theme,
) : U... | @@ -42,32 +39,32 @@ class PodcastViewModel @Inject constructor(
val artworkConfiguration = settings.artworkConfiguration.flow
- var uiState: UiState by mutableStateOf(UiState.Empty)
- private set
+ var uiState: StateFlow<UiState> = flow {
+ val podcast = podcastManager.findPodcastByUuid(pod... | wear/src/main/kotlin/au/com/shiftyjelly/pocketcasts/wear/ui/podcast/PodcastViewModel.kt | 26 | Kotlin | 0.786 | suggestion | 627 | 42 | 41 | false | Wear OS hide archived or played episodes | 4,831 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.stateIn
@HiltViewModel
class PodcastViewModel @Inject constructor(
savedStateHandle: SavedStateHandle,
private val episodeManager: EpisodeManager,
private val podcastManager: PodcastManager,
private val theme: Theme,
settings: Settin... | The `uiState` property should be declared as `val` instead of `var` since it's a `StateFlow` that's initialized once and never reassigned. Using `var` suggests mutability that doesn't actually exist.
**Suggested change:**
```kotlin
val uiState: StateFlow<UiState> = flow {
```
```suggestion
val uiState: StateFlow<U... | import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.stateIn
@HiltViewModel
class PodcastViewModel @Inject constructor(
savedStateHandle: SavedStateHandle,
private val episodeManager: EpisodeManager,
private val podcastManager: PodcastManager,
private va... | @@ -42,32 +39,32 @@ class PodcastViewModel @Inject constructor(
val artworkConfiguration = settings.artworkConfiguration.flow
- var uiState: UiState by mutableStateOf(UiState.Empty)
- private set
+ var uiState: StateFlow<UiState> = flow { | wear/src/main/kotlin/au/com/shiftyjelly/pocketcasts/wear/ui/podcast/PodcastViewModel.kt | 26 | Kotlin | 0.857 | suggestion | 340 | 51 | 51 | false | Wear OS hide archived or played episodes | 4,831 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import au.com.shiftyjelly.pocketcasts.models.entity.PodcastEpisode
import au.com.shiftyjelly.pocketcasts.preferences.Settings
import au.com.shiftyjelly.pocketcasts.repositories.podcast.EpisodeManager
import dagger.hilt.android.lifecycle.HiltV... | The `UiState` sealed class should use `data object` instead of `object` for `Loading` and `Empty` states to follow Kotlin best practices. This is consistent with newer Kotlin code patterns and provides better equality semantics.
```kotlin
sealed class UiState {
data object Loading : UiState()
data object Empty... |
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import au.com.shiftyjelly.pocketcasts.models.entity.PodcastEpisode
import au.com.shiftyjelly.pocketcasts.preferences.Settings
import au.com.shiftyjelly.pocketcasts.repositories.podcast.EpisodeManager
import dagger.hilt.android.lifecycle.HiltV... | @@ -2,23 +2,41 @@ package au.com.shiftyjelly.pocketcasts.wear.ui.downloads
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
+import au.com.shiftyjelly.pocketcasts.models.entity.PodcastEpisode
import au.com.shiftyjelly.pocketcasts.preferences.Settings
import au.com.shiftyjelly.pocketcas... | wear/src/main/kotlin/au/com/shiftyjelly/pocketcasts/wear/ui/downloads/DownloadsScreenViewModel.kt | 26 | Kotlin | 1 | suggestion | 423 | 42 | 42 | false | Improve Wear OS downloads page with a loading spinner and empty message | 4,837 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
package au.com.shiftyjelly.pocketcasts.wear.ui.component
import androidx.annotation.StringRes
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compos... | Unused imports detected: `Arrangement`, `Column`, and `fillMaxWidth` are imported but not used in this file.
```suggestion
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
``` | package au.com.shiftyjelly.pocketcasts.wear.ui.component
import androidx.annotation.StringRes
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import an... | @@ -0,0 +1,45 @@
+package au.com.shiftyjelly.pocketcasts.wear.ui.component
+
+import androidx.annotation.StringRes
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.fillMaxSiz... | wear/src/main/kotlin/au/com/shiftyjelly/pocketcasts/wear/ui/component/NoContentScreen.kt | 8 | Kotlin | 0.857 | suggestion | 226 | 33 | 33 | false | Improve Wear OS downloads page with a loading spinner and empty message | 4,837 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
}
item {
WatchListChip(
title = stringResource(LR.string.profile_navigation_files),
iconRes = IR.drawable.ic_file,
onClick = {
viewModel.onFilesClicked()
navigateToRoute(FilesScreen.ROUTE)
... | `showSystemUi` was showing the Pocket Casts icon in the middle of the screen. It might be an Android Studio issue but I have removed it for now. | }
item {
WatchListChip(
title = stringResource(LR.string.profile_navigation_files),
iconRes = IR.drawable.ic_file,
onClick = {
viewModel.onFilesClicked()
navigateToRoute(FilesScreen.ROUTE)
... | @@ -117,7 +129,7 @@ fun WatchListScreen(
}
}
-@Preview(device = WearDevices.SMALL_ROUND, showSystemUi = true) | wear/src/main/kotlin/au/com/shiftyjelly/pocketcasts/wear/ui/WatchListScreen.kt | 26 | Kotlin | 0.714 | suggestion | 144 | 49 | 49 | false | Wear OS: Add starred episode screen | 4,838 | Automattic/pocket-casts-android | 1,688 | Kotlin | geekygecko | geekygecko |
import au.com.shiftyjelly.pocketcasts.localization.R as LR
@HiltViewModel
class ProfileEpisodeListViewModel @Inject constructor(
val episodeManager: EpisodeManager,
val playbackManager: PlaybackManager,
private val analyticsTracker: AnalyticsTracker,
private val settings: Settings,
private val user... | Variable name is outdated. The variable `episodeListFlowable` should be renamed to `episodeListFlow` since it now returns a Kotlin `Flow` instead of an RxJava `Flowable`. | import au.com.shiftyjelly.pocketcasts.localization.R as LR
@HiltViewModel
class ProfileEpisodeListViewModel @Inject constructor(
val episodeManager: EpisodeManager,
val playbackManager: PlaybackManager,
private val analyticsTracker: AnalyticsTracker,
private val settings: Settings,
private val user... | @@ -57,9 +56,9 @@ class ProfileEpisodeListViewModel @Inject constructor(
fun setup(mode: Mode) {
this.mode = mode
val episodeListFlowable = when (mode) { | modules/features/podcasts/src/main/java/au/com/shiftyjelly/pocketcasts/podcasts/view/ProfileEpisodeListViewModel.kt | 26 | Kotlin | 0.571 | suggestion | 170 | 51 | 51 | false | Wear OS: Add starred episode screen | 4,838 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
title = stringResource(LR.string.playlists),
iconRes = IR.drawable.ic_playlists,
onClick = {
viewModel.onPlaylistsClicked()
navigateToRoute(PlaylistsScreen.ROUTE)
},
)
}
item {
... | Incorrect analytics tracking method. This should call a `viewModel.onStarredClicked()` method (which needs to be added to WatchListScreenViewModel) instead of `viewModel.onFilesClicked()` to properly track when users tap the starred episodes option.
```suggestion
viewModel.onStarredClicked()
``` | title = stringResource(LR.string.playlists),
iconRes = IR.drawable.ic_playlists,
onClick = {
viewModel.onPlaylistsClicked()
navigateToRoute(PlaylistsScreen.ROUTE)
},
)
}
item {
... | @@ -104,6 +105,17 @@ fun WatchListScreen(
)
}
+ item {
+ WatchListChip(
+ title = stringResource(LR.string.profile_navigation_starred),
+ iconRes = IR.drawable.ic_starred,
+ onClick = {
+ viewModel.onFilesClicked() | wear/src/main/kotlin/au/com/shiftyjelly/pocketcasts/wear/ui/WatchListScreen.kt | 26 | Kotlin | 0.857 | bug | 316 | 51 | 51 | false | Wear OS: Add starred episode screen | 4,838 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
useEpisodeArtwork: Boolean,
onItemClick: (PodcastEpisode) -> Unit,
) {
ScalingLazyColumn(
columnState = columnState,
) {
item {
ScreenHeaderChip(text = title)
}
items(
items = episodes,
key = { it.uuid },
) { episode ->
... | Preview function name is misleading. Since this is now a generic `EpisodeListScreen` component (not specific to Downloads), the preview should have a more generic name like `EpisodeListScreenPreview` instead of `DownloadsScreenPreview`.
```suggestion
private fun EpisodeListScreenPreview() {
``` | useEpisodeArtwork: Boolean,
onItemClick: (PodcastEpisode) -> Unit,
) {
ScalingLazyColumn(
columnState = columnState,
) {
item {
ScreenHeaderChip(text = title)
}
items(
items = episodes,
key = { it.uuid },
) { episode ->
... | @@ -0,0 +1,121 @@
+package au.com.shiftyjelly.pocketcasts.wear.ui.component
+
+import androidx.annotation.StringRes
+import androidx.compose.foundation.layout.padding
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.tooling.preview.Preview
+import androidx.wea... | wear/src/main/kotlin/au/com/shiftyjelly/pocketcasts/wear/ui/component/EpisodeListScreen.kt | 26 | Kotlin | 0.857 | suggestion | 295 | 51 | 51 | false | Wear OS: Add starred episode screen | 4,838 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
class ProfileEpisodeListViewModel @Inject constructor(
val episodeManager: EpisodeManager,
val playbackManager: PlaybackManager,
private val analyticsTracker: AnalyticsTracker,
private val settings: Settings,
private val userManager: UserManager,
) : ViewModel(),
CoroutineScope {
override va... | I converted these methods to flow for Wear OS, so it seems sensible to switch these at the same time. | class ProfileEpisodeListViewModel @Inject constructor(
val episodeManager: EpisodeManager,
val playbackManager: PlaybackManager,
private val analyticsTracker: AnalyticsTracker,
private val settings: Settings,
private val userManager: UserManager,
) : ViewModel(),
CoroutineScope {
override va... | @@ -57,9 +56,9 @@ class ProfileEpisodeListViewModel @Inject constructor(
fun setup(mode: Mode) {
this.mode = mode
val episodeListFlowable = when (mode) {
- is Mode.Downloaded -> episodeManager.findDownloadEpisodesFlow().asFlowable()
- is Mode.Starred -> episodeManager.findSt... | modules/features/podcasts/src/main/java/au/com/shiftyjelly/pocketcasts/podcasts/view/ProfileEpisodeListViewModel.kt | 26 | Kotlin | 0.357 | suggestion | 101 | 51 | 51 | false | Wear OS: Add starred episode screen | 4,838 | Automattic/pocket-casts-android | 1,688 | Kotlin | geekygecko | geekygecko |
import au.com.shiftyjelly.pocketcasts.localization.R as LR
fun podcastImageCornerSize(width: Dp): Dp {
return when {
width <= 50.dp -> 3.dp
width <= 200.dp -> 4.dp
else -> 8.dp
}
}
@Composable
fun PodcastImage(
uuid: String,
modifier: Modifier = Modifier,
imageSize: Dp = 56... | `imageSize` should be included in the `remember` dependencies since it's used inside the block (line 58). Without this, changes to `imageSize` won't trigger a new image request, potentially loading the wrong image resolution.
```kotlin
val imageRequest = remember(uuid, placeholderType, imageSize) {
```
```suggestion
... | import au.com.shiftyjelly.pocketcasts.localization.R as LR
fun podcastImageCornerSize(width: Dp): Dp {
return when {
width <= 50.dp -> 3.dp
width <= 200.dp -> 4.dp
else -> 8.dp
}
}
@Composable
fun PodcastImage(
uuid: String,
modifier: Modifier = Modifier,
imageSize: Dp = 56... | @@ -52,7 +52,11 @@ fun PodcastImage(
) {
val context = LocalContext.current
val imageRequest = remember(uuid, placeholderType) { | modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/components/PodcastImage.kt | 26 | Kotlin | 1 | bug | 390 | 51 | 51 | false | Fix performance of image loading | 4,844 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
maxWidth <= 200.dp -> 2.dp
else -> 4.dp
}
Card(
elevation = elevation,
shape = RoundedCornerShape(corners),
backgroundColor = color,
) {
Box(
modifier = Modifier
... | The migration from `PodcastImageDeprecated` to `PodcastImage` is missing the `imageSize` parameter. The deprecated version used `BoxWithConstraints` to determine the actual display size, but `PodcastImage` requires an explicit `imageSize` parameter. Without it, this defaults to 56.dp which may not match the actual size... | maxWidth <= 50.dp -> 1.dp
maxWidth <= 200.dp -> 2.dp
else -> 4.dp
}
Card(
elevation = elevation,
shape = RoundedCornerShape(corners),
backgroundColor = color,
) {
Box(
... | @@ -204,8 +205,7 @@ private fun FolderPodcastImage(
}
}
} else {
- @Suppress("DEPRECATION")
- PodcastImageDeprecated(
+ PodcastImage(
uuid = uuid,
modifier = modifier,
) | modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/folder/FolderImage.kt | 26 | Kotlin | 1 | suggestion | 630 | 51 | 51 | false | Fix performance of image loading | 4,844 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
maxWidth <= 50.dp -> 1.dp
maxWidth <= 200.dp -> 2.dp
else -> 4.dp
}
Card(
elevation = elevation,
shape = RoundedCornerShape(corners),
backgroundColor = color,
) {
Box(
... | The `modifier.size(imageSize)` is redundant since `PodcastImage` already applies `.size(imageSize)` internally (line 71 in PodcastImage.kt). This results in the size being set twice, which is unnecessary.
Remove the redundant size modifier: `modifier = modifier`
```suggestion
modifier = modifier,
``` | maxWidth <= 50.dp -> 1.dp
maxWidth <= 200.dp -> 2.dp
else -> 4.dp
}
Card(
elevation = elevation,
shape = RoundedCornerShape(corners),
backgroundColor = color,
) {
Box(
... | @@ -204,10 +206,10 @@ private fun FolderPodcastImage(
}
}
} else {
- @Suppress("DEPRECATION")
- PodcastImageDeprecated(
+ PodcastImage(
uuid = uuid,
- modifier = modifier,
+ imageSize = imageSize,
+ modifier = modifier.size(im... | modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/folder/FolderImage.kt | 26 | Kotlin | 1 | suggestion | 314 | 51 | 51 | false | Fix performance of image loading | 4,844 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | geekygecko |
"type" to "end_of_year_story",
"story" to "longest_episode",
"source" to "unknown",
"action" to "system_sheet",
"current_year" to 1000,
),
)
}
@Test
fun `log year vs year story sharing`() {
val story... | The story value should remain "year_vs_year" (matching Story.YearVsYear.analyticsValue), not "current_year_vs_year". Only the property key "year" should be renamed to "current_year" (which is correctly done on line 641). The story type identifier should not change.
```suggestion
"story" to "year_vs_year... | "type" to "end_of_year_story",
"story" to "longest_episode",
"source" to "unknown",
"action" to "system_sheet",
"current_year" to 1000,
),
)
}
@Test
fun `log year vs year story sharing`() {
val story... | @@ -635,10 +635,10 @@ class SharingAnalyticsTest {
event.assertProperties(
mapOf(
"type" to "end_of_year_story",
- "story" to "year_vs_year",
+ "story" to "current_year_vs_year", | modules/services/sharing/src/test/kotlin/au/com/shiftyjelly/pocketcasts/sharing/SharingAnalyticsTest.kt | 26 | Kotlin | 1 | suggestion | 326 | 51 | 51 | false | [Playback] Rename `year` prop to `current_year` | 4,845 | Automattic/pocket-casts-android | 1,688 | Kotlin | Copilot | sztomek |
// all the podcasts that need to be in the database
val podcastUuids = changes
.mapNotNull { change -> change.podcast }
.toSet()
val databaseSubscribedPodcastUuids = podcastManager.findSubscribedUuids().toHashSet()
// add the missing podcasts or update the podcas... | I noticed this variable wasn't being used so I have cleaned it up. |
// all the podcasts that need to be in the database
val podcastUuids = changes
.mapNotNull { change -> change.podcast }
.toSet()
val databaseSubscribedPodcastUuids = podcastManager.findSubscribedUuids().toHashSet()
// add the missing podcasts or update the podcas... | @@ -63,8 +63,6 @@ class HistoryManager @Inject constructor(
.toList()
.await()
- val skeletonEpisodes = mutableListOf<PodcastEpisode>() | modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/podcast/HistoryManager.kt | 26 | Kotlin | 0.286 | suggestion | 66 | 51 | 51 | false | Fix auto-play playing completed episodes | 4,846 | Automattic/pocket-casts-android | 1,688 | Kotlin | geekygecko | geekygecko |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.