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
override fun onDestroy() { super.onDestroy() if (!requireActivity().isChangingConfigurations) { viewModel.trackEditDismissed() } } private fun openDownloadLimit() { if (parentFragmentManager.findFragmentByTag("auto_download_limit") != null) { return ...
❓ In my testing, when i tapped the confirmation to delete the playlist, the app went back to the Discover tab. Is that intentional? I'd expect to return to the Playlists
override fun onDestroy() { super.onDestroy() if (!requireActivity().isChangingConfigurations) { viewModel.trackEditDismissed() } } private fun openDownloadLimit() { if (parentFragmentManager.findFragmentByTag("auto_download_limit") != null) { return ...
@@ -84,4 +89,20 @@ internal class SettingsFragment : BaseFragment() { } DownloadLimitFragment().show(parentFragmentManager, "auto_download_limit") } + + private fun openDeleteConfirmation() { + if (parentFragmentManager.findFragmentByTag("delete_playlist_confirmation") != null) { + ...
modules/features/filters/src/main/java/au/com/shiftyjelly/pocketcasts/playlists/SettingsFragment.kt
26
Kotlin
0.357
suggestion
169
31
31
false
Add delete playlist option
4,635
Automattic/pocket-casts-android
1,688
Kotlin
sztomek
MiSikora
} else { PlaybackState() } }.distinctUntilChanged(), ) { episode, playbackState -> RowState.Loaded(episode, playbackState) } .catch { emit(RowState.Error(it)) } ...
The `stopTimeoutMillis` and `replayExpirationMillis` values of 300ms are very short for a caching mechanism. This may cause cached flows to be cleared too quickly when users briefly navigate away, defeating the purpose of caching. Consider increasing these values to at least 5000ms to provide a meaningful cache duratio...
System.currentTimeMillis() } else { episode.playedUpToModified }, ).also { val isPlaying = playbackState.episodeUuid == episodeUuid && playbackState.state == PlaybackState.State.PLAYING ...
@@ -47,84 +49,92 @@ import au.com.shiftyjelly.pocketcasts.repositories.podcast.PodcastManager import au.com.shiftyjelly.pocketcasts.ui.theme.Theme import au.com.shiftyjelly.pocketcasts.views.buttons.PlayButton import au.com.shiftyjelly.pocketcasts.views.helper.PlayButtonListener -import dagger.assisted.Assisted -imp...
modules/features/search/src/main/java/au/com/shiftyjelly/pocketcasts/search/component/ImprovedSearchEpisodeResultRow.kt
26
Kotlin
0.857
performance
545
51
51
false
[Improved Search] Search results improvements
4,637
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
combine<BaseEpisode, PlaybackState, RowState>( episodeFlow, episodePlaybackFlow.map { if (it.episodeUuid == episodeUuid) { it } else { PlaybackState() } ...
The condition `playbackState.episodeUuid == episodeUuid` is repeated 4 times in this block. Consider extracting it to a local variable `val isCurrentEpisode = playbackState.episodeUuid == episodeUuid` at the beginning of the `also` block to improve readability and reduce duplication.
} }.distinctUntilChanged(), ) { episode, playbackState -> val changedEpisode = episode.copy( playedUpToModified = if (playbackState.episodeUuid == episodeUuid) { System.currentTimeMillis() } e...
@@ -47,84 +49,92 @@ import au.com.shiftyjelly.pocketcasts.repositories.podcast.PodcastManager import au.com.shiftyjelly.pocketcasts.ui.theme.Theme import au.com.shiftyjelly.pocketcasts.views.buttons.PlayButton import au.com.shiftyjelly.pocketcasts.views.helper.PlayButtonListener -import dagger.assisted.Assisted -imp...
modules/features/search/src/main/java/au/com/shiftyjelly/pocketcasts/search/component/ImprovedSearchEpisodeResultRow.kt
26
Kotlin
0.643
refactor
284
51
51
false
[Improved Search] Search results improvements
4,637
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
@Assisted("episodeUuid") episodeUuid: String, @Assisted("podcastUuid") podcastUuid: String, ): ImprovedEpisodeRowViewModel } private val _uiState = MutableStateFlow<RowState>(RowState.Idle) private val episodeFlow = podcastManager.findOrDownloadPodcastRxSingle(podcastUuid) ...
The `playedUpToModified` timestamp is being updated on every playback state change for the current episode, even when the play position hasn't actually changed. This will cause unnecessary timestamp updates that don't reflect actual progress changes. The timestamp should only be updated when `playedUpToMs` actually cha...
) private val episodeFlowCache = mutableMapOf<EpisodeKey, StateFlow<RowState>>() fun getEpisodeFlow(episodeUuid: String, podcastUuid: String): StateFlow<RowState> { return episodeFlowCache.getOrPut(EpisodeKey(episodeUuid, podcastUuid)) { val flow = combine<PodcastEpisode, PlaybackState...
@@ -47,84 +49,92 @@ import au.com.shiftyjelly.pocketcasts.repositories.podcast.PodcastManager import au.com.shiftyjelly.pocketcasts.ui.theme.Theme import au.com.shiftyjelly.pocketcasts.views.buttons.PlayButton import au.com.shiftyjelly.pocketcasts.views.helper.PlayButtonListener -import dagger.assisted.Assisted -imp...
modules/features/search/src/main/java/au/com/shiftyjelly/pocketcasts/search/component/ImprovedSearchEpisodeResultRow.kt
26
Kotlin
0.643
suggestion
363
51
51
false
[Improved Search] Search results improvements
4,637
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
} } override suspend fun playNextBlocking(episode: BaseEpisode, downloadManager: DownloadManager, onAdd: (() -> Unit)?) { playNextNowBlocking(episode, downloadManager, onAdd) } private suspend fun playNextNowBlocking(episode: BaseEpisode, downloadManager: DownloadManager, onAdd: (() ->...
The `playAllNext` function uses `runInTransaction` but also calls `replaceAll` which calls `saveChangesBlocking`. This creates nested transactions that may fail or cause unexpected behavior depending on the database implementation. Consider restructuring to avoid nested transaction boundaries.
// when the upNextQueue is empty, save the source for auto playing the next episode automaticUpNextSource?.let { settings.lastAutoPlaySource.set(value = it, updateModifiedAt = true) } saveChangesBlocking(UpNextAction.ClearAll) } saveChanges...
@@ -200,24 +209,41 @@ class UpNextQueueImpl @Inject constructor( } override suspend fun playAllNext(episodes: List<BaseEpisode>, downloadManager: DownloadManager) = withContext(coroutineContext) { - if (episodes.isEmpty()) { - return@withContext + appDatabase.runInTransaction {
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/playback/UpNextQueueImpl.kt
26
Kotlin
0.643
bug
294
51
51
false
Improve performance of bulk Up Next operations
4,641
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
episodes.forEach { playLastNowBlocking(it, downloadManager, null) } } } private fun playLastNowBlocking(episode: BaseEpisode, downloadManager: DownloadManager, onAdd: (() -> Unit)?) { saveChangesBlocking(UpNextAction.PlayLast(episode, onAdd)) downloadIfPossible(episode, down...
The `playAllLast` function uses `runInTransaction` but also calls `replaceAll` which calls `saveChangesBlocking`. This creates nested transactions that may fail or cause unexpected behavior depending on the database implementation. Consider restructuring to avoid nested transaction boundaries.
episodes.forEach { episode -> downloadIfPossible(episode, downloadManager) if (episode.isFinished) { episodeManager.markAsNotPlayedBlocking(episode) } } } private fun replaceAll(episodes: List<BaseEpisode>, downloadManager: DownloadManager) { ...
@@ -234,7 +260,21 @@ class UpNextQueueImpl @Inject constructor( override suspend fun playAllLast(episodes: List<BaseEpisode>, downloadManager: DownloadManager) = withContext(coroutineContext) { appDatabase.runInTransaction {
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/playback/UpNextQueueImpl.kt
26
Kotlin
0.643
bug
294
51
51
false
Improve performance of bulk Up Next operations
4,641
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
import au.com.shiftyjelly.pocketcasts.helper.BuildConfig private val isDebugOrPrototypeBuild = BuildConfig.DEBUG || BuildConfig.IS_PROTOTYPE enum class Feature( val key: String, val title: String, val defaultValue: Boolean, val tier: FeatureTier, val hasFirebaseRemoteFlag: Boolean, val hasDevT...
Disabling Firebase remote flag for the 2025 feature differs from the 2024 implementation which had it enabled. This change means the feature can only be controlled via build configuration or dev toggle, removing the ability to remotely enable/disable it for production users. Consider whether this is intentional or if r...
import au.com.shiftyjelly.pocketcasts.helper.BuildConfig private val isDebugOrPrototypeBuild = BuildConfig.DEBUG || BuildConfig.IS_PROTOTYPE enum class Feature( val key: String, val title: String, val defaultValue: Boolean, val tier: FeatureTier, val hasFirebaseRemoteFlag: Boolean, val hasDevT...
@@ -20,12 +20,12 @@ enum class Feature( hasFirebaseRemoteFlag = true, hasDevToggle = false, ), - END_OF_YEAR_2024( - key = "end_of_year_2024", - title = "End of Year 2024", - defaultValue = false, + END_OF_YEAR_2025( + key = "end_of_year_2025", + title = "...
modules/services/utils/src/main/java/au/com/shiftyjelly/pocketcasts/utils/featureflag/Feature.kt
26
Kotlin
0.857
suggestion
411
51
51
false
Playback feature flag
4,650
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
geekygecko
onClickDonate = onClickDonate, onClickSettings = onClickSettings, ) } } @Composable private fun PodcastCategoriesLabel( category: String, author: String, onClickCategory: () -> Unit, ) { val text = remember(category, author, onClickCategory) { val text = list...
The `TextLinkStyles` configuration is missing styling for the hover and pressed states. Consider adding `hoveredStyle` and `pressedStyle` parameters to provide consistent visual feedback across all interaction states, not just focus. ```suggestion focusedStyle = SpanStyle(textDecoration = Te...
onClickFolder = onClickFolder, onClickNotification = onClickNotification, onClickDonate = onClickDonate, onClickSettings = onClickSettings, ) } } @Composable private fun PodcastCategoriesLabel( category: String, author: String, onClickCategory: ()...
@@ -328,9 +330,13 @@ private fun PodcastCategoriesLabel( LinkAnnotation.Clickable( tag = "category", linkInteractionListener = LinkInteractionListener { onClickCategory() }, + styles = TextLinkStyles( + ...
modules/features/podcasts/src/main/java/au/com/shiftyjelly/pocketcasts/podcasts/view/podcast/PodcastHeader.kt
26
Kotlin
0.857
suggestion
542
51
51
false
Remove podcast category underline style
4,658
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
geekygecko
import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import au.com.shiftyjelly.pocketcasts.compose.components.TextH30 import au.com.shiftyjelly.pocketcasts.compose.components.TextH70 import au.com.shiftyjelly.pocketcasts.images.R as IR imp...
I wasn't sure this was the best way to size the component, but it seemed to produce the best results in both portrait and landscape orientation.
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import au.com.shiftyjelly.pocketcasts.compose.components.TextH30 import au.com.shiftyjelly.po...
@@ -8,66 +8,80 @@ import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.aspectRatio +import androidx.compose.foundation.layout.fillMaxSize...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/EndOfYearPromptCard.kt
26
Kotlin
0.357
suggestion
145
51
51
false
New Playback entry point design for Profile tab
4,659
Automattic/pocket-casts-android
1,688
Kotlin
geekygecko
geekygecko
package au.com.shiftyjelly.pocketcasts.repositories.search import au.com.shiftyjelly.pocketcasts.models.to.ImprovedSearchResultItem import au.com.shiftyjelly.pocketcasts.models.to.SearchAutoCompleteItem import au.com.shiftyjelly.pocketcasts.preferences.Settings import au.com.shiftyjelly.pocketcasts.servers.podcast.Pod...
The `author` field in `SearchAutoCompleteItem.Podcast` is non-nullable (as seen in the data class definition), but the source field `it.value.author` is now nullable. Using `.orEmpty()` converts null to an empty string, which may not be the intended behavior. Consider whether an empty string is semantically appropriate...
package au.com.shiftyjelly.pocketcasts.repositories.search import au.com.shiftyjelly.pocketcasts.models.to.ImprovedSearchResultItem import au.com.shiftyjelly.pocketcasts.models.to.SearchAutoCompleteItem import au.com.shiftyjelly.pocketcasts.servers.podcast.PodcastCacheService import au.com.shiftyjelly.pocketcasts.serv...
@@ -14,14 +13,13 @@ import kotlin.time.Duration.Companion.seconds class ImprovedSearchManagerImpl @Inject constructor( private val autoCompleteSearchService: AutoCompleteSearchService, private val combinedSearchService: PodcastCacheService, - private val settings: Settings, ) : ImprovedSearchManager { ...
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/search/ImprovedSearchManagerImpl.kt
22
Kotlin
1
security
661
47
47
false
[Improved Search] Remove limits from autocomplete query
4,665
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
.padding(horizontal = 16.dp), thickness = 0.5.dp, color = MaterialTheme.theme.colors.secondaryText02, ) } } } if (results.isNotEmpty()) { ...
The clickable \"View all\" button lacks a semantic role indicator. Add `.semantics { role = Role.Button }` to the modifier chain to ensure screen readers properly announce this as a button for better accessibility.
HorizontalDivider( modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp), thickness = 0.5.dp, color = MaterialTheme.theme.colors.secondar...
@@ -124,6 +127,22 @@ fun SearchAutoCompleteResultsPage( } } } + + if (results.isNotEmpty()) { + item { + TextP40( + modifier = Modifier + .clickable( + ...
modules/features/search/src/main/java/au/com/shiftyjelly/pocketcasts/search/SearchAutoCompleteResultsPage.kt
26
Kotlin
0.643
suggestion
214
51
51
false
[Improved Search] Display "view all for x" under search suggestions
4,667
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
item(contentType = "divider") { HorizontalDivider( modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp), thickness = 0.5.dp, ...
The modifier order should be adjusted: padding should be applied before clickable to ensure the clickable area includes the padding. Change to `.padding(vertical = 8.dp, horizontal = 16.dp).clickable(onClick = { onTermClick(SearchAutoCompleteItem.Term(searchTerm)) })`. ```suggestion .padding...
} } if (results.indices.last != index) { item(contentType = "divider") { HorizontalDivider( modifier = Modifier .fillMaxWidth() .pad...
@@ -124,6 +127,22 @@ fun SearchAutoCompleteResultsPage( } } } + + if (results.isNotEmpty()) { + item { + TextP40( + modifier = Modifier + .clickable( + ...
modules/features/search/src/main/java/au/com/shiftyjelly/pocketcasts/search/SearchAutoCompleteResultsPage.kt
26
Kotlin
0.857
suggestion
600
51
51
false
[Improved Search] Display "view all for x" under search suggestions
4,667
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
.padding(horizontal = 16.dp), thickness = 0.5.dp, color = MaterialTheme.theme.colors.secondaryText02, ) } } } if (results.isNotEmpty()) { ...
```suggestion color = MaterialTheme.theme.colors.primaryInteractive01, maxLines = 1, ) ``` This is very minor but I wonder if we should limit it to 1 line. | Before | After | | --- | --- | | <img width="1198" height="2531" alt="Image" src="https://git...
HorizontalDivider( modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp), thickness = 0.5.dp, color = MaterialTheme.theme.colors.secondar...
@@ -124,6 +127,22 @@ fun SearchAutoCompleteResultsPage( } } } + + if (results.isNotEmpty()) { + item { + TextP40( + modifier = Modifier + .clickable( + ...
modules/features/search/src/main/java/au/com/shiftyjelly/pocketcasts/search/SearchAutoCompleteResultsPage.kt
26
Kotlin
0.857
suggestion
533
51
51
false
[Improved Search] Display "view all for x" under search suggestions
4,667
Automattic/pocket-casts-android
1,688
Kotlin
geekygecko
sztomek
} } if (results.indices.last != index) { item(contentType = "divider") { HorizontalDivider( modifier = Modifier .fillMaxWidth() .pad...
The modifier chain order is incorrect. The `clickable` modifier should come before `padding` to ensure the entire padded area is clickable. Additionally, when using `.clickable()`, the `role` parameter should be passed directly to `clickable()` rather than using a separate `.semantics` modifier. See the pattern used el...
} } if (results.indices.last != index) { item(contentType = "divider") { HorizontalDivider( modifier = Modifier .fillMaxWidth() .pad...
@@ -124,6 +130,24 @@ fun SearchAutoCompleteResultsPage( } } } + + if (results.isNotEmpty()) { + item { + TextP40( + modifier = Modifier + .semantics { role = Role.Button } + ...
modules/features/search/src/main/java/au/com/shiftyjelly/pocketcasts/search/SearchAutoCompleteResultsPage.kt
26
Kotlin
0.857
bug
1,017
51
51
false
[Improved Search] Display "view all for x" under search suggestions
4,667
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
} } if (results.indices.last != index) { item(contentType = "divider") { HorizontalDivider( modifier = Modifier .fillMaxWidth() .pad...
The `.semantics { role = Role.Button }` modifier is redundant because `.clickable()` already provides button role semantics by default. The explicit semantics modifier should be removed, and the clickable modifier should be applied first in the chain. ```suggestion ```
is SearchAutoCompleteItem.Folder -> ImprovedSearchFolderResultRow( folder = item, onClick = { onFolderClick(item) }, modifier = Modifier.fillMaxWidth(), ) } ...
@@ -124,6 +130,24 @@ fun SearchAutoCompleteResultsPage( } } } + + if (results.isNotEmpty()) { + item { + TextP40( + modifier = Modifier + .semantics { role = Role.Button }
modules/features/search/src/main/java/au/com/shiftyjelly/pocketcasts/search/SearchAutoCompleteResultsPage.kt
26
Kotlin
0.857
suggestion
270
51
51
false
[Improved Search] Display "view all for x" under search suggestions
4,667
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
h1 = typography.h1.copy(fontSize = 144.sp), h2 = typography.h2.copy(fontSize = 90.sp), h3 = typography.h3.copy(fontSize = 72.sp), h4 = typography.h4.copy(fontSize = 51.sp), h5 = typography.h5.copy(fontSize = 36.sp), h6 = typ...
<img width="500" alt="Image" src="https://github.com/user-attachments/assets/97d7ad20-1bb0-4182-8b8c-b9395f3b96e0" />
MaterialTheme( colors = buildMaterialColors(colors = theme.colors, isLight = theme.isLight), typography = typography.copy( h1 = typography.h1.copy(fontSize = 144.sp), h2 = typography.h2.copy(fontSize = 90.sp), h3 = typography.h3.copy(fontSi...
@@ -92,12 +95,18 @@ fun AutomotiveTheme(content: @Composable () -> Unit) { } } +private val radioactiveColorFilter = ColorFilter.tint( + color = Color.radioactiveGreen, + blendMode = BlendMode.Modulate, +)
modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/Theme.kt
26
Kotlin
0.429
suggestion
117
51
51
false
Update Playback modal for 2025
4,668
Automattic/pocket-casts-android
1,688
Kotlin
geekygecko
geekygecko
) } } if (results.indices.last != index) { item(contentType = "divider") { HorizontalDivider( modifier = Modifier .fillMaxWidth() ...
The modifier order places `.semantics` before `.clickable`. For proper accessibility support, semantic modifiers should be placed after clickable/selectable modifiers. Move `.semantics { role = Role.Button }` after `.clickable()` to ensure the role is properly applied to the clickable element. ```suggestion ...
) is SearchAutoCompleteItem.Folder -> ImprovedSearchFolderResultRow( folder = item, onClick = { onFolderClick(item) }, modifier = Modifier.fillMaxWidth(), ...
@@ -124,6 +130,24 @@ fun SearchAutoCompleteResultsPage( } } } + + if (results.isNotEmpty()) { + item { + TextP40( + modifier = Modifier + .semantics { role = Role.Button } + ...
modules/features/search/src/main/java/au/com/shiftyjelly/pocketcasts/search/SearchAutoCompleteResultsPage.kt
26
Kotlin
0.857
suggestion
612
51
51
false
[Improved Search] Cherry pick changes from master to be included in beta
4,673
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
} if (localResults.isNotEmpty()) { emit(SearchUiState.SearchOperation.Success(searchTerm = query, results = SearchResults.ImprovedResults(results = localResults, filter = ResultsFilters.TOP_RESULTS))) } ...
Catching `Throwable` is overly broad and can mask critical errors like `OutOfMemoryError` or `StackOverflowError`. Consider catching `Exception` instead to allow system errors to propagate properly. ```suggestion } catch (e: Exception) { if (localResults.isEmpty()) { ...
val podcastSearch = serviceManager .searchForPodcastsRx(query) .map { list -> list.searchResults.map { ImprovedSearchResultItem.PodcastItem(uuid = it.uuid, title = it.title, author = it.author, isFollowed = subscribedUuids.contains(it.uuid)...
@@ -349,11 +349,19 @@ class SearchHandler @Inject constructor( if (localResults.isNotEmpty()) { emit(SearchUiState.SearchOperation.Success(searchTerm = query, results = SearchResults.ImprovedResults(results = localResults, filter = ResultsFilters.TOP_RESULTS))) ...
modules/features/search/src/main/java/au/com/shiftyjelly/pocketcasts/search/SearchHandler.kt
26
Kotlin
1
bug
363
51
51
false
[Improved Search] Cherry pick changes from master to be included in beta
4,673
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
import kotlin.math.roundToInt import au.com.shiftyjelly.pocketcasts.localization.R as LR @OptIn(ExperimentalComposeUiApi::class) @Composable internal fun CompletionRateStory( story: Story.CompletionRate, measurements: EndOfYearMeasurements, controller: StoryCaptureController, onShareStory: (File) -> Un...
The range boundaries for selecting animations are inconsistent and potentially incorrect. The 0.7f..0.75f range for 80% is very narrow (only 5%), and values from 0.75f to 1.0f will fall through to the 100% animation. This likely doesn't match the intended design where 80% should cover a broader range. Consider adjustin...
import kotlin.math.roundToInt import au.com.shiftyjelly.pocketcasts.localization.R as LR @OptIn(ExperimentalComposeUiApi::class) @Composable internal fun CompletionRateStory( story: Story.CompletionRate, measurements: EndOfYearMeasurements, controller: StoryCaptureController, onShareStory: (File) -> Un...
@@ -1,325 +1,155 @@ package au.com.shiftyjelly.pocketcasts.endofyear.ui -import androidx.compose.animation.core.Spring -import androidx.compose.animation.core.animateFloat -import androidx.compose.animation.core.animateIntOffset -import androidx.compose.animation.core.spring -import androidx.compose.animation.core.u...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/CompletionRateStory.kt
26
Kotlin
0.857
bug
472
51
51
false
Playback Completion Rate Story
4,674
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
geekygecko
is Story.YearVsYear -> yearVsYear is Story.CompletionRate -> completionRate is Story.Ending -> ending } override suspend fun capture(story: Story): File? { _isSharing = true delay(50) // A small delay to settle stor...
The magic number 1.5f used for positioning the PC logo lacks explanation. Consider extracting this to a named constant like `LOGO_BOTTOM_SPACING_MULTIPLIER` or adding a comment explaining why the logo is positioned at 1.5x its height from the bottom. ```suggestion height - (pcLogo.height...
is Story.YearVsYear -> yearVsYear is Story.CompletionRate -> completionRate is Story.Ending -> ending } override suspend fun capture(story: Story): File? { _isSharing = true delay(50) // A small delay to settle stor...
@@ -84,35 +74,20 @@ internal fun rememberStoryCaptureController(): StoryCaptureController { .asAndroidBitmap() .copy(Bitmap.Config.ARGB_8888, false) - val logoHeight = (buttonHeightPx * 0.5f).roundToInt() - val log...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/StoryCaptureController.kt
26
Kotlin
0.857
refactor
359
51
51
false
Playback Completion Rate Story
4,674
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
geekygecko
is Story.Ending -> Color(0xFFEE661C) } internal data class EndOfYearMeasurements( val width: Dp, val height: Dp, val statusBarInsets: WindowInsets, val coverFontSize: TextUnit, val coverTextHeight: Dp, val closeButtonBottomEdge: Dp, ) { val scale = width / 393.dp val smallDe...
The design has the touch target at 34.dp but it feels very small on Android so I might ask the designers to try it at 48.dp first. It also matches the Material spec. https://m3.material.io/foundations/designing/structure#b421e522-35a6-47cd-bfc6-bf94cbacf7bb <img width="109" height="134" alt="Image" src="https://github...
is Story.Ending -> Color(0xFFEE661C) } internal data class EndOfYearMeasurements( val width: Dp, val height: Dp, val statusBarInsets: WindowInsets, val coverFontSize: TextUnit, val coverTextHeight: Dp, val closeButtonBottomEdge: Dp, ) { val scale = width / 393.dp val smallDe...
@@ -82,8 +84,12 @@ internal fun ShareStoryButton( ) { val scope = rememberCoroutineScope() - OutlinedEoyButton( - text = stringResource(LR.string.end_of_year_share_story), + CircleIconButton( + size = 48.dp,
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/Common.kt
26
Kotlin
0.5
suggestion
389
51
51
false
Playback Completion Rate Story
4,674
Automattic/pocket-casts-android
1,688
Kotlin
geekygecko
geekygecko
}.collectAsState() val episodeCount by remember(playlist.uuid) { getEpisodeCountFlow(playlist.uuid) }.collectAsState() LaunchedEffect(playlist.uuid, refreshArtworkUuids) { refreshArtworkUuids(playlist.uuid) } LaunchedEffect(playlist.uuid, refreshEpisodeCount) { refresh...
The `textMeasurer` is included in the `remember` dependencies but is no longer used within the calculation block. This causes unnecessary recomposition when `textMeasurer` changes. Remove `textMeasurer` from the dependencies list since only `deleteIconSize` and `deleteIconPadding` (which depend on `density`) are now us...
val episodeCount by remember(playlist.uuid) { getEpisodeCountFlow(playlist.uuid) }.collectAsState() LaunchedEffect(playlist.uuid, refreshArtworkUuids) { refreshArtworkUuids(playlist.uuid) } LaunchedEffect(playlist.uuid, refreshEpisodeCount) { refreshEpisodeCount(playlist.u...
@@ -118,11 +116,10 @@ internal fun PlaylistPreviewRow( val density = LocalDensity.current val windowWidth = LocalWindowInfo.current.containerSize.width val textMeasurer = rememberTextMeasurer() - val deleteText = stringResource(LR.string.delete) - val draggableAnchors = remember...
modules/features/filters/src/main/java/au/com/shiftyjelly/pocketcasts/playlists/component/PlaylistPreviewRow.kt
26
Kotlin
0.857
suggestion
438
51
51
false
Update playlist deletion logic
4,681
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
getArtworkUuidsFlow(playlist.uuid) }.collectAsState() val episodeCount by remember(playlist.uuid) { getEpisodeCountFlow(playlist.uuid) }.collectAsState() LaunchedEffect(playlist.uuid, refreshArtworkUuids) { refreshArtworkUuids(playlist.uuid) } LaunchedEffect(playlist.u...
The `textMeasurer` is no longer used after replacing the text-based delete action with an icon. This variable should be removed to avoid unnecessary memory allocation and composition overhead.
}.collectAsState() val episodeCount by remember(playlist.uuid) { getEpisodeCountFlow(playlist.uuid) }.collectAsState() LaunchedEffect(playlist.uuid, refreshArtworkUuids) { refreshArtworkUuids(playlist.uuid) } LaunchedEffect(playlist.uuid, refreshEpisodeCount) { refresh...
@@ -118,11 +116,10 @@ internal fun PlaylistPreviewRow( val density = LocalDensity.current val windowWidth = LocalWindowInfo.current.containerSize.width val textMeasurer = rememberTextMeasurer()
modules/features/filters/src/main/java/au/com/shiftyjelly/pocketcasts/playlists/component/PlaylistPreviewRow.kt
26
Kotlin
0.714
suggestion
192
51
51
false
Update playlist deletion logic
4,681
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
.flowWithLifecycle(viewLifecycleOwner.lifecycle) .collect { inset -> miniPlayerInset = inset binding.content.updatePadding(bottom = initialPadding + miniPlayerInset + keyboardInset) } } ViewCompat.setOnApplyWindowIns...
The `interactionSource` parameter should not be null. When setting `indication = null` to remove click effects, you should provide a `remember { MutableInteractionSource() }` instead of passing null to `interactionSource`. Passing null for `interactionSource` is deprecated and can lead to runtime issues. ```suggestion ...
viewModel.bottomInset .flowWithLifecycle(viewLifecycleOwner.lifecycle) .collect { inset -> miniPlayerInset = inset binding.content.updatePadding(bottom = initialPadding + miniPlayerInset + keyboardInset) } } ...
@@ -331,7 +332,14 @@ class PlaylistFragment : val noContentData = rememberNoContentData() val transition = updateTransition(contentState) AppTheme(theme.activeTheme) { - Box { + Box( + // Clickable to intercept events below the overlay + mod...
modules/features/filters/src/main/java/au/com/shiftyjelly/pocketcasts/playlists/PlaylistFragment.kt
26
Kotlin
1
suggestion
444
51
51
false
Keep episode selection scroll position
4,682
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
.background(story.backgroundColor) .padding(top = measurements.closeButtonBottomEdge), horizontalAlignment = Alignment.CenterHorizontally, ) { val animations = screenAnimations() Spacer( modifier = Modifier.weight(1f), ) Image( ...
The epilogue title string no longer accepts a year parameter based on the updated string resource, but the code is still passing `2025` as an argument. This will cause a runtime error or display the year incorrectly. Remove the year parameter from the stringResource call. ```suggestion text = stringResource...
.fillMaxSize() .background(story.backgroundColor) .padding(top = measurements.closeButtonBottomEdge), horizontalAlignment = Alignment.CenterHorizontally, ) { val animations = screenAnimations() Spacer( modifier = Modifier.weight(1f), )...
@@ -45,116 +53,138 @@ internal fun EndingStory( .fillMaxSize() .background(story.backgroundColor) .padding(top = measurements.closeButtonBottomEdge), + horizontalAlignment = Alignment.CenterHorizontally, ) { - ByeByeSection( - measurements = measureme...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/EndingStory.kt
26
Kotlin
1
bug
369
51
51
false
[Playback] Thank you stroy
4,684
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
.flowWithLifecycle(viewLifecycleOwner.lifecycle) .collect { inset -> miniPlayerInset = inset binding.content.updatePadding(bottom = initialPadding + miniPlayerInset + keyboardInset) } } ViewCompat.setOnApplyWindowIns...
The `interactionSource` parameter should use `remember { MutableInteractionSource() }` instead of `null`. Passing `null` is deprecated in newer Compose versions and can lead to compilation errors or runtime issues. ```suggestion interactionSource = remember { MutableInteractionSource() }, ```
.flowWithLifecycle(viewLifecycleOwner.lifecycle) .collect { inset -> miniPlayerInset = inset binding.content.updatePadding(bottom = initialPadding + miniPlayerInset + keyboardInset) } } ViewCompat.setOnApplyWindowIns...
@@ -334,11 +334,15 @@ class PlaylistFragment : AppTheme(theme.activeTheme) { Box( // Clickable to intercept events below the overlay - modifier = Modifier.clickable( - onClick = {}, - interactionSource = null, - ...
modules/features/filters/src/main/java/au/com/shiftyjelly/pocketcasts/playlists/PlaylistFragment.kt
26
Kotlin
1
suggestion
317
51
51
false
Fix playlists not being interactive
4,685
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
disableAutoScale = true, color = colorResource(UR.color.white), modifier = Modifier .fillMaxWidth() .padding(horizontal = 24.dp), textAlign = TextAlign.Center, ) } @Composable private fun Footer( story: Story.TopShow, controller: StoryCaptureControlle...
Lines 215-216 use string concatenation with `+` operator for building formatted strings. This violates the pattern established in line 214 where all formatting is done through the `stringResource` function. Consider moving the entire formatting logic (including numbers and plural units) into the string resource itself,...
.fillMaxWidth() .padding(horizontal = 24.dp), textAlign = TextAlign.Center, ) TextP40( text = stringResource(LR.string.end_of_year_story_top_podcast_subtitle), disableAutoScale = true, color = colorResource(UR.color.white), modifier = Modifier ...
@@ -63,174 +61,172 @@ internal fun TopShowStory( controller: StoryCaptureController, onShareStory: (File) -> Unit, ) { - Box { - Column( + BoxWithConstraints( + modifier = Modifier + .capturable(controller.captureController(story)) + .fillMaxSize() + .back...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/TopShowStory.kt
26
Kotlin
1
refactor
1,022
51
51
false
[Playback] Top show story
4,686
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
disableAutoScale = true, color = colorResource(UR.color.white), modifier = Modifier .fillMaxWidth() .padding(horizontal = 24.dp), textAlign = TextAlign.Center, ) } @Composable private fun Footer( story: Story.TopShow, controller: StoryCaptureControlle...
The expression `story.show.playbackTime.minus(story.show.playbackTime.inWholeDays.days).inWholeHours` is calculated twice on the same line. Extract this calculation to a local variable to avoid redundant computation. ```suggestion val hours = story.show.playbackTime.minus(story.show.playbackTime.inWholeDays.days).i...
.fillMaxWidth() .padding(horizontal = 24.dp), textAlign = TextAlign.Center, ) TextP40( text = stringResource(LR.string.end_of_year_story_top_podcast_subtitle), disableAutoScale = true, color = colorResource(UR.color.white), modifier = Modifier ...
@@ -63,174 +61,172 @@ internal fun TopShowStory( controller: StoryCaptureController, onShareStory: (File) -> Unit, ) { - Box { - Column( + BoxWithConstraints( + modifier = Modifier + .capturable(controller.captureController(story)) + .fillMaxSize() + .back...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/TopShowStory.kt
26
Kotlin
1
refactor
796
51
51
false
[Playback] Top show story
4,686
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
.requiredSize(maxOf(maxWidth.times(.7f), maxHeight.times(.7f))) .scale(scaleAnimation) .graphicsLayer { alpha = alphaAnimation }, ) } @Composable private fun Header( measurements: EndOfYearMeasurements, modifier: Modifier = Modifier, ) = Colum...
The year is hardcoded as 2025 instead of 2024. This appears inconsistent with the naming convention of resources like `end_of_year_2024_sticker_8` and the preview code showing `playbackTimeSeconds = 200_250.0` which suggests 2024 data. Verify the correct year should be used here. ```suggestion 2024, ```
} PodcastImage( uuid = story.show.uuid, elevation = 0.dp, modifier = Modifier .requiredSize(maxOf(maxWidth.times(.7f), maxHeight.times(.7f))) .scale(scaleAnimation) .graphicsLayer { alpha = alphaAnimation }, ) } @Compo...
@@ -63,174 +61,172 @@ internal fun TopShowStory( controller: StoryCaptureController, onShareStory: (File) -> Unit, ) { - Box { - Column( + BoxWithConstraints( + modifier = Modifier + .capturable(controller.captureController(story)) + .fillMaxSize() + .back...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/TopShowStory.kt
26
Kotlin
0.857
suggestion
316
51
51
false
[Playback] Top show story
4,686
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
disableAutoScale = true, color = colorResource(UR.color.white), modifier = Modifier .fillMaxWidth() .padding(horizontal = 24.dp), textAlign = TextAlign.Center, ) } @Composable private fun Footer( story: Story.TopShow, controller: StoryCaptureControlle...
❓ Could you refactor this? It is hard to read with long lines, no names, and repeated property access.
.fillMaxWidth() .padding(horizontal = 24.dp), textAlign = TextAlign.Center, ) TextP40( text = stringResource(LR.string.end_of_year_story_top_podcast_subtitle), disableAutoScale = true, color = colorResource(UR.color.white), modifier = Modifier ...
@@ -63,174 +61,172 @@ internal fun TopShowStory( controller: StoryCaptureController, onShareStory: (File) -> Unit, ) { - Box { - Column( + BoxWithConstraints( + modifier = Modifier + .capturable(controller.captureController(story)) + .fillMaxSize() + .back...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/TopShowStory.kt
26
Kotlin
0.429
refactor
102
51
51
false
[Playback] Top show story
4,686
Automattic/pocket-casts-android
1,688
Kotlin
MiSikora
sztomek
path = path, ) } } } }, ) { Box( modifier = Modifier .fillMaxSize() .background(story.ba...
Hardcoded year '2025' is inconsistent with the rest of the codebase. Other End of Year stories use '2024' (e.g., YearVsYearStory line 202, drawable resources like end_of_year_2024_sticker_*). This should likely be 2024 to match the current year context. ```suggestion 2024, ```
} PodcastImage( uuid = story.show.uuid, elevation = 0.dp, modifier = Modifier .requiredSize(maxOf(maxWidth.times(.7f), maxHeight.times(.7f))) .scale(scaleAnimation) .graphicsLayer { alpha = alphaAnimation }, ) } @Compo...
@@ -63,174 +62,190 @@ internal fun TopShowStory( controller: StoryCaptureController, onShareStory: (File) -> Unit, ) { - Box { - Column( + BoxWithConstraints( + modifier = Modifier + .capturable(controller.captureController(story)) + .fillMaxSize() + .back...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/TopShowStory.kt
26
Kotlin
0.857
suggestion
289
51
51
false
[Playback] Top show story
4,686
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
TextH10( text = stringResource( R.string.end_of_year_story_top_podcast_title, 2024, ), fontScale = measurements.smallDeviceFactor, disableAutoScale = true, color = colorResource(UR.color.coolgrey_90), modifie...
[nitpick] String concatenation with numeric values could be error-prone for internationalization. Consider using string templates or formatting resources that include the numeric placeholder to allow for proper locale-specific number formatting and word ordering. ```suggestion val formattedDaysCount = pluralStringR...
text = stringResource(LR.string.end_of_year_story_top_podcast_subtitle), disableAutoScale = true, color = colorResource(UR.color.white), modifier = Modifier .fillMaxWidth() .padding(horizontal = 24.dp), textAlign = TextAlign.Center, ) } @Composable pr...
@@ -63,174 +62,190 @@ internal fun TopShowStory( controller: StoryCaptureController, onShareStory: (File) -> Unit, ) { - Box { - Column( + BoxWithConstraints( + modifier = Modifier + .capturable(controller.captureController(story)) + .fillMaxSize() + .back...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/TopShowStory.kt
26
Kotlin
1
suggestion
594
51
51
false
[Playback] Top show story
4,686
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.semantics.Role import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import androidx.core.graphics.toColorIn...
The import `ThemeColor` is unused and should be removed. After changing from `toolbarColors` to `iconTint` parameter, `ThemeColor` is no longer referenced in this file. ```suggestion ```
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.semantics.Role import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import au.com.shiftyjelly.pocketcasts.c...
@@ -51,18 +50,18 @@ import au.com.shiftyjelly.pocketcasts.podcasts.viewmodel.PodcastSettingsViewMode import au.com.shiftyjelly.pocketcasts.repositories.playlist.Playlist import au.com.shiftyjelly.pocketcasts.repositories.playlist.SmartPlaylistPreview import au.com.shiftyjelly.pocketcasts.ui.theme.Theme.ThemeType +im...
modules/features/podcasts/src/main/java/au/com/shiftyjelly/pocketcasts/podcasts/view/podcast/PodcastSettingsHomePage.kt
26
Kotlin
0.786
suggestion
187
51
51
false
Fix podcast settings colors
4,687
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import androidx.core.graphics.toColorInt import au.com.shiftyjelly.pocketcasts.compose.AppTheme import au.com.shiftyjelly.pocketcasts.compose.components.NumberStepper import ...
The import `ToolbarColors` is unused and should be removed. The function no longer uses `ToolbarColors` after the refactor to use `iconTint: Color` directly. ```suggestion ```
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import au.com.shiftyjelly.pocketcasts.compose.AppTheme import au.com.shiftyjelly.pocketcasts.compose.components.NumberStepper import au.com.shiftyjelly.pocketcasts.compose.co...
@@ -51,18 +50,18 @@ import au.com.shiftyjelly.pocketcasts.podcasts.viewmodel.PodcastSettingsViewMode import au.com.shiftyjelly.pocketcasts.repositories.playlist.Playlist import au.com.shiftyjelly.pocketcasts.repositories.playlist.SmartPlaylistPreview import au.com.shiftyjelly.pocketcasts.ui.theme.Theme.ThemeType +im...
modules/features/podcasts/src/main/java/au/com/shiftyjelly/pocketcasts/podcasts/view/podcast/PodcastSettingsHomePage.kt
26
Kotlin
0.786
refactor
176
51
51
false
Fix podcast settings colors
4,687
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
import com.automattic.android.tracks.crashlogging.CrashLogging import dagger.hilt.android.lifecycle.HiltViewModel import dagger.hilt.android.qualifiers.ApplicationContext import javax.inject.Inject import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.a...
The ViewModel should depend on the `AppReviewManager` interface rather than the concrete `AppReviewManagerImpl` class. This follows dependency inversion principle and allows for easier testing and maintainability.
import au.com.shiftyjelly.pocketcasts.repositories.podcast.SuggestedFoldersManager import com.automattic.android.tracks.crashlogging.CrashLogging import dagger.hilt.android.lifecycle.HiltViewModel import dagger.hilt.android.qualifiers.ApplicationContext import javax.inject.Inject import kotlinx.coroutines.Dispatchers i...
@@ -34,6 +35,7 @@ class DeveloperViewModel private val settings: Settings, @ApplicationContext private val context: Context, private val crashLogging: CrashLogging, + private val appReviewManagerImpl: AppReviewManagerImpl,
modules/features/settings/src/main/java/au/com/shiftyjelly/pocketcasts/settings/developer/DeveloperViewModel.kt
26
Kotlin
0.643
suggestion
213
51
51
false
Add app review prompt UI
4,688
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
package au.com.shiftyjelly.pocketcasts.ui import android.Manifest import android.annotation.SuppressLint import android.app.Activity import android.content.Intent import android.content.pm.PackageManager import android.content.res.Configuration import android.net.Uri import android.os.Build import android.os.Bundle im...
The flow collection is launched in `lifecycleScope` without lifecycle awareness. The `flowWithLifecycle(lifecycle)` is applied, but the outer `launch` should specify `Lifecycle.State.STARTED` to properly handle lifecycle events. Use `repeatOnLifecycle(Lifecycle.State.STARTED)` or consider using `launchWhenStarted` to e...
} Snackbar.make(view, snackbarMessage, Snackbar.LENGTH_LONG) .setAction(LR.string.settings_view, action) .setActionTextColor(result.tintColor) .setBackgroundTint(ThemeColor.primaryUi01(Theme.ThemeType.DARK)) .setTextColor(ThemeColor.primaryText01(Theme.Th...
@@ -1881,4 +1888,16 @@ class MainActivity : addFragment(SettingsFragment()) addFragment(ExportSettingsFragment()) } + + private fun setupAppReviewPrompt() { + lifecycleScope.launch { + appReviewManager.showPromptSignal + .flowWithLifecycle(lifecycle) + ...
app/src/main/java/au/com/shiftyjelly/pocketcasts/ui/MainActivity.kt
26
Kotlin
1
suggestion
854
1,885
30
false
Add app review prompt UI
4,688
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?, ) = content { DialogBox( fillMaxHeight = false, modifier = Modifier.nestedScroll(rememberNestedScrollInteropConnection()), ) { AppReviewPage( onCl...
The dismiss() call before navigating may cause timing issues if the fragment dismissal animation delays the subsequent navigation actions. Consider moving the dismiss() call after the navigation setup (after line 44) to ensure the fragment is properly dismissed after the new fragment is added. This pattern is more cons...
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?, ) = content { DialogBox( fillMaxHeight = false, modifier = Modifier.nestedScroll(rememberNestedScrollInteropConnection()), ) { AppReviewPage( onCl...
@@ -37,4 +37,12 @@ class AppReviewDialogFragment : BaseDialogFragment() { ) } } + + private fun goToHelpAndFeedback() { + dismiss() + val hostListener = requireActivity() as FragmentHostListener + hostListener.addFragment(HelpFragment()) + hostListener.closeBott...
modules/features/appreview/src/main/kotlin/au/com/shiftyjelly/pocketcasts/appreview/AppReviewDialogFragment.kt
26
Kotlin
0.857
suggestion
662
29
29
false
Navigate to help pages from the review prompt
4,689
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
package au.com.shiftyjelly.pocketcasts.analytics open class AnalyticsTracker( val trackers: List<Tracker>, val isFirstPartyTrackingEnabled: () -> Boolean, ) { private var listeners = emptyList<Listener>() fun addListener(listener: Listener) { listeners += listener } fun track(event: A...
The `listeners` list and `addListener()` method are not thread-safe. If analytics events are tracked from multiple threads or `addListener()` is called concurrently with `track()`, this could lead to race conditions. Consider using a thread-safe collection like `CopyOnWriteArrayList` or synchronizing access. ```suggest...
package au.com.shiftyjelly.pocketcasts.analytics import java.util.concurrent.CopyOnWriteArrayList open class AnalyticsTracker( val trackers: List<Tracker>, val isFirstPartyTrackingEnabled: () -> Boolean, ) { private val listeners = CopyOnWriteArrayList<Listener>() fun addListener(listener: Listener) ...
@@ -1,19 +1,25 @@ package au.com.shiftyjelly.pocketcasts.analytics -import au.com.shiftyjelly.pocketcasts.utils.featureflag.Feature -import au.com.shiftyjelly.pocketcasts.utils.featureflag.FeatureFlag - open class AnalyticsTracker( val trackers: List<Tracker>, val isFirstPartyTrackingEnabled: () -> Boolea...
modules/services/analytics/src/main/java/au/com/shiftyjelly/pocketcasts/analytics/AnalyticsTracker.kt
12
Kotlin
1
bug
631
37
37
false
Add analytics listener
4,693
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
import au.com.shiftyjelly.pocketcasts.payment.BillingCycle import au.com.shiftyjelly.pocketcasts.payment.SubscriptionTier import au.com.shiftyjelly.pocketcasts.preferences.Settings import au.com.shiftyjelly.pocketcasts.preferences.UserSetting import au.com.shiftyjelly.pocketcasts.repositories.endofyear.EndOfYearManager...
New imports for coroutines utilities (`CoroutineStart`, `BufferOverflow`, `MutableSharedFlow`, `launch`) have been added but are not used in the visible diff. Ensure these imports are actually needed in this test file, or remove them if they were added by mistake. ```suggestion import kotlinx.coroutines.ExperimentalCor...
import au.com.shiftyjelly.pocketcasts.payment.BillingCycle import au.com.shiftyjelly.pocketcasts.payment.SubscriptionTier import au.com.shiftyjelly.pocketcasts.preferences.Settings import au.com.shiftyjelly.pocketcasts.preferences.UserSetting import au.com.shiftyjelly.pocketcasts.repositories.endofyear.EndOfYearManager...
@@ -40,9 +40,13 @@ import junit.framework.TestCase.assertEquals import junit.framework.TestCase.assertTrue import kotlin.time.Duration.Companion.minutes import kotlinx.coroutines.CompletableDeferred +import kotlinx.coroutines.CoroutineStart import kotlinx.coroutines.ExperimentalCoroutinesApi +import kotlinx.corouti...
modules/features/endofyear/src/test/kotlin/au/com/shiftyjelly/pocketcasts/endofyear/EndOfYearViewModelTest.kt
26
Kotlin
1
bug
419
51
51
false
Add analytics listener
4,693
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
package au.com.shiftyjelly.pocketcasts.repositories.appreview import au.com.shiftyjelly.pocketcasts.preferences.Settings import au.com.shiftyjelly.pocketcasts.preferences.model.AppReviewReason import au.com.shiftyjelly.pocketcasts.utils.featureflag.Feature import au.com.shiftyjelly.pocketcasts.utils.featureflag.Featur...
The Timber import is unused and should be removed. No logging statements using Timber exist in this file. ```suggestion ```
package au.com.shiftyjelly.pocketcasts.repositories.appreview import au.com.shiftyjelly.pocketcasts.preferences.Settings import au.com.shiftyjelly.pocketcasts.preferences.model.AppReviewReason import au.com.shiftyjelly.pocketcasts.utils.featureflag.Feature import au.com.shiftyjelly.pocketcasts.utils.featureflag.Featur...
@@ -1,16 +1,167 @@ package au.com.shiftyjelly.pocketcasts.repositories.appreview +import au.com.shiftyjelly.pocketcasts.preferences.Settings +import au.com.shiftyjelly.pocketcasts.preferences.model.AppReviewReason +import au.com.shiftyjelly.pocketcasts.utils.featureflag.Feature +import au.com.shiftyjelly.pocketcasts...
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/appreview/AppReviewManagerImpl.kt
20
Kotlin
0.786
suggestion
124
45
45
false
Add initial logic for app reviews
4,694
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
class AppReviewManagerImpl @Inject constructor( private val settings: Settings, private val clock: Clock, ) : AppReviewManager { private val signalChannel = Channel<AppReviewSignal>() override val showPromptSignal: Flow<AppReviewSignal> get() = signalChannel.receiveAsFlow() private val isMonitoring...
The `triggerPrompt` function is not part of the `AppReviewManager` interface but is called from external classes (DeveloperViewModel). This should either be added to the interface for proper API design or made internal if it's meant to be implementation-specific.
private val settings: Settings, private val clock: Clock, ) : AppReviewManager { private val signalChannel = Channel<AppReviewSignal>() override val showPromptSignal: Flow<AppReviewSignal> get() = signalChannel.receiveAsFlow() private val isMonitoring = AtomicBoolean() override suspend fun mon...
@@ -1,16 +1,167 @@ package au.com.shiftyjelly.pocketcasts.repositories.appreview +import au.com.shiftyjelly.pocketcasts.preferences.Settings +import au.com.shiftyjelly.pocketcasts.preferences.model.AppReviewReason +import au.com.shiftyjelly.pocketcasts.utils.featureflag.Feature +import au.com.shiftyjelly.pocketcasts...
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/appreview/AppReviewManagerImpl.kt
26
Kotlin
0.643
suggestion
263
51
51
false
Add initial logic for app reviews
4,694
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
ThirdEpisodeCompleted( analyticsValue = "third_episode_completed", ), EpisodeStarred( analyticsValue = "episode_starred", ), ShowRated( analyticsValue = "show_rated", ), FilterCreated( analyticsValue = "filter_created", ), PlusUpgraded( analyti...
Corrected spelling of 'referrals' to 'referral' for consistency with the enum name 'ReferralShared' (should be 'referral_shared'). ```suggestion analyticsValue = "referral_shared", ```
ThirdEpisodeCompleted( analyticsValue = "third_episode_completed", ), EpisodeStarred( analyticsValue = "episode_starred", ), ShowRated( analyticsValue = "show_rated", ), FilterCreated( analyticsValue = "filter_created", ), PlusUpgraded( analyti...
@@ -0,0 +1,41 @@ +package au.com.shiftyjelly.pocketcasts.preferences.model + +enum class AppReviewReason( + val analyticsValue: String, +) { + ThirdEpisodeCompleted( + analyticsValue = "third_episode_completed", + ), + EpisodeStarred( + analyticsValue = "episode_starred", + ), + ShowRate...
modules/services/preferences/src/main/java/au/com/shiftyjelly/pocketcasts/preferences/model/AppReviewReason.kt
26
Kotlin
0.786
suggestion
192
37
37
false
Add initial logic for app reviews
4,694
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
package au.com.shiftyjelly.pocketcasts.repositories.appreview import au.com.shiftyjelly.pocketcasts.analytics.AnalyticsEvent import au.com.shiftyjelly.pocketcasts.analytics.AnalyticsTracker import au.com.shiftyjelly.pocketcasts.preferences.Settings import java.time.Clock import javax.inject.Inject import javax.inject....
The condition uses `<=` which will store 4 timestamps (0, 1, 2, 3), but the check in `AppReviewManagerImpl.isReasonApplicable` uses `>= 3` to trigger the prompt. This could cause the prompt to trigger on the 3rd completion as intended, but will unnecessarily store a 4th timestamp. Consider using `< 3` to only store exa...
package au.com.shiftyjelly.pocketcasts.repositories.appreview import au.com.shiftyjelly.pocketcasts.analytics.AnalyticsEvent import au.com.shiftyjelly.pocketcasts.analytics.AnalyticsTracker import au.com.shiftyjelly.pocketcasts.preferences.Settings import java.time.Clock import javax.inject.Inject import javax.inject....
@@ -0,0 +1,29 @@ +package au.com.shiftyjelly.pocketcasts.repositories.appreview + +import au.com.shiftyjelly.pocketcasts.analytics.AnalyticsEvent +import au.com.shiftyjelly.pocketcasts.analytics.AnalyticsTracker +import au.com.shiftyjelly.pocketcasts.preferences.Settings +import java.time.Clock +import javax.inject.Inj...
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/appreview/AppReviewAnalyticsListener.kt
21
Kotlin
0.857
suggestion
441
30
30
false
Add initial logic for app reviews
4,694
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
false } AppReviewReason.ReferralShared -> { false } AppReviewReason.DevelopmentTrigger -> { true } } } private class AppReviewSignalImpl( override val reason: AppReviewReason, private val continuation: CancellableContinuation<App...
There's a potential race condition between checking `continuation.isActive` and calling `continuation.resume()`. If the continuation is cancelled between these two operations, `resume()` will throw an exception. Consider using `tryResume()` or wrapping in a try-catch to handle cancellation gracefully. ```suggestion ...
false } AppReviewReason.ReferralShared -> { false } AppReviewReason.DevelopmentTrigger -> { true } } } private class AppReviewSignalImpl( override val reason: AppReviewReason, private val continuation: CancellableContinuation<App...
@@ -1,16 +1,158 @@ package au.com.shiftyjelly.pocketcasts.repositories.appreview +import au.com.shiftyjelly.pocketcasts.preferences.Settings +import au.com.shiftyjelly.pocketcasts.preferences.model.AppReviewReason +import au.com.shiftyjelly.pocketcasts.utils.featureflag.Feature +import au.com.shiftyjelly.pocketcasts...
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/appreview/AppReviewManagerImpl.kt
26
Kotlin
1
bug
668
32
32
false
Add initial logic for app reviews
4,694
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
false } AppReviewReason.ReferralShared -> { false } AppReviewReason.DevelopmentTrigger -> { true } } } private class AppReviewSignalImpl( override val reason: AppReviewReason, private val continuation: CancellableContinuation<App...
There's a potential race condition between checking `continuation.isActive` and calling `continuation.resume()`. If the continuation is cancelled between these two operations, `resume()` will throw an exception. Consider using `tryResume()` or wrapping in a try-catch to handle cancellation gracefully. ```suggestion ...
false } AppReviewReason.ReferralShared -> { false } AppReviewReason.DevelopmentTrigger -> { true } } } private class AppReviewSignalImpl( override val reason: AppReviewReason, private val continuation: CancellableContinuation<App...
@@ -1,16 +1,158 @@ package au.com.shiftyjelly.pocketcasts.repositories.appreview +import au.com.shiftyjelly.pocketcasts.preferences.Settings +import au.com.shiftyjelly.pocketcasts.preferences.model.AppReviewReason +import au.com.shiftyjelly.pocketcasts.utils.featureflag.Feature +import au.com.shiftyjelly.pocketcasts...
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/appreview/AppReviewManagerImpl.kt
26
Kotlin
1
bug
750
32
32
false
Add initial logic for app reviews
4,694
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
override val showPlaylistsOnboarding = UserSetting.BoolPref( sharedPrefKey = "show_playlists_onboarding", defaultValue = true, sharedPrefs = sharedPreferences, ) override val appReviewEpisodeCompletedTimestamps = UserSetting.PrefListFromString( sharedPrefKey = "app_review_ep...
Using `AppReviewReason.DevelopmentTrigger` as a fallback for unrecognized values in `fromString` is problematic. If a new reason is added in a future version and then removed, persisted data would silently convert it to `DevelopmentTrigger`, which could trigger unintended development-only behavior. Consider either retu...
override val showPlaylistsOnboarding = UserSetting.BoolPref( sharedPrefKey = "show_playlists_onboarding", defaultValue = true, sharedPrefs = sharedPreferences, ) override val appReviewEpisodeCompletedTimestamps = UserSetting.PrefListFromString( sharedPrefKey = "app_review_ep...
@@ -1610,4 +1611,28 @@ class SettingsImpl @Inject constructor( defaultValue = true, sharedPrefs = sharedPreferences, ) + + override val appReviewEpisodeCompletedTimestamps = UserSetting.PrefListFromString( + sharedPrefKey = "app_review_episode_completed_timestamps", + defaultValu...
modules/services/preferences/src/main/java/au/com/shiftyjelly/pocketcasts/preferences/SettingsImpl.kt
26
Kotlin
1
suggestion
507
31
31
false
Add initial logic for app reviews
4,694
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
package au.com.shiftyjelly.pocketcasts.repositories.appreview import javax.inject.Inject import javax.inject.Singleton import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableSharedFlow @Singleton class AppReviewManagerImpl @Inject constructor() : AppReviewManager { private val signal = MutableS...
The monitoring loop polls every 5 seconds regardless of whether settings change. Consider using `settings.appReviewEpisodeCompletedTimestamps.flow.collectLatest` to react to actual changes instead of constant polling, which would be more efficient and responsive.
import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.suspendCancellableCoroutine @Singleton class AppReviewManagerImpl @Inject constructor( private val settings: Settings, private val clock: Clock, ) : AppReviewManager { private val signalChannel = Channel<AppReviewSignal>() override ...
@@ -1,16 +1,158 @@ package au.com.shiftyjelly.pocketcasts.repositories.appreview +import au.com.shiftyjelly.pocketcasts.preferences.Settings +import au.com.shiftyjelly.pocketcasts.preferences.model.AppReviewReason +import au.com.shiftyjelly.pocketcasts.utils.featureflag.Feature +import au.com.shiftyjelly.pocketcasts...
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/appreview/AppReviewManagerImpl.kt
17
Kotlin
0.643
performance
263
17
51
false
Add initial logic for app reviews
4,694
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
package au.com.shiftyjelly.pocketcasts.repositories.appreview import javax.inject.Inject import javax.inject.Singleton import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableSharedFlow @Singleton class AppReviewManagerImpl @Inject constructor() : AppReviewManager { private val signal = MutableS...
Multiple when branches return hardcoded `false` values. These unimplemented cases create unnecessary code that will need updating when features are implemented. Consider using a sealed class hierarchy or removing unimplemented reasons from the enum until they're ready to be used. ```suggestion ```
} AppReviewReason.FilterCreated -> { false } AppReviewReason.PlusUpgraded -> { false } AppReviewReason.FolderCreated -> { false } AppReviewReason.BookmarkCreated -> { false } AppReviewRea...
@@ -1,16 +1,158 @@ package au.com.shiftyjelly.pocketcasts.repositories.appreview +import au.com.shiftyjelly.pocketcasts.preferences.Settings +import au.com.shiftyjelly.pocketcasts.preferences.model.AppReviewReason +import au.com.shiftyjelly.pocketcasts.utils.featureflag.Feature +import au.com.shiftyjelly.pocketcasts...
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/appreview/AppReviewManagerImpl.kt
17
Kotlin
0.857
suggestion
299
17
51
false
Add initial logic for app reviews
4,694
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
.height(94.dp) .widthIn(max = 76.dp), composition = composition, iterations = LottieConstants.IterateForever, contentScale = ContentScale.FillBounds, ) var animationTrigger by remember { mutableStateOf(false) } LaunchedEffect(...
The nested if-else logic is redundant. Since both `controller.isSharing` and `animationTrigger` result in the same value (1f), this can be simplified to `if (controller.isSharing || animationTrigger) 1f else .8f`.
modifier = Modifier .height(94.dp) .widthIn(max = 76.dp), composition = composition, iterations = LottieConstants.IterateForever, contentScale = ContentScale.FillBounds, ) var animationTrigger by remember { mutableStateOf(f...
@@ -89,70 +78,100 @@ private fun TopShowsStory( .fillMaxSize() .background(story.backgroundColor) .padding(top = measurements.closeButtonBottomEdge + 16.dp), + horizontalAlignment = Alignment.CenterHorizontally, ) { - val animationProgress = remember { Animatabl...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/TopShowsStory.kt
26
Kotlin
0.571
suggestion
213
51
51
false
[Playback] Top shows story
4,695
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
is Story.YearVsYear -> YearVsYearStory( story = story, measurements = measurements, controller = controller, onShareStory = { file -> onShareStory(story, file) }, ) is Story.CompletionRate -> CompletionRateStory( ...
Instead of passing in list of colors could pass in a single colors and hoist the `colors[page]` logic to the top? It would be also good to change it to `colors.getOrNull(index)`. It avoids duplication and potentially risky `colors[index]` where index is not available
is Story.YearVsYear -> YearVsYearStory( story = story, measurements = measurements, controller = controller, onShareStory = { file -> onShareStory(story, file) }, ) is Story.CompletionRate -> CompletionRateStory( ...
@@ -261,6 +262,7 @@ private fun Stories( internal fun BoxScope.TopControls( pagerState: PagerState, progress: Float, + colors: List<Color>,
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/StoriesPage.kt
26
Kotlin
0.786
suggestion
267
51
51
false
[Playback] Top shows story
4,695
Automattic/pocket-casts-android
1,688
Kotlin
MiSikora
sztomek
private fun TopShowsStory( story: Story.TopShows, measurements: EndOfYearMeasurements, initialAnimationProgress: Float, controller: StoryCaptureController, onShareStory: (File) -> Unit, ) { Column( modifier = Modifier .capturable(controller.captureController(story)) ...
Reference to `IR.raw.playback_top_shows_wave_1_lottie` but only `playback_top_shows_wave_2_lottie.json` was added in this PR. The first wave animation file appears to be missing, which will cause a compilation or runtime error when attempting to load the animation for even-indexed items. ```suggestion ...
.background(story.backgroundColor) .padding(top = measurements.closeButtonBottomEdge + 16.dp), horizontalAlignment = Alignment.CenterHorizontally, ) { TextH10( text = stringResource(LR.string.eoy_story_top_podcasts_title), fontScale = measurements.smal...
@@ -89,70 +78,99 @@ private fun TopShowsStory( .fillMaxSize() .background(story.backgroundColor) .padding(top = measurements.closeButtonBottomEdge + 16.dp), + horizontalAlignment = Alignment.CenterHorizontally, ) { - val animationProgress = remember { Animatable...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/TopShowsStory.kt
26
Kotlin
1
suggestion
382
51
51
false
[Playback] Top shows story
4,695
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
package au.com.shiftyjelly.pocketcasts.views.component import android.content.Context import android.util.AttributeSet import android.view.MotionEvent import android.widget.FrameLayout class TouchDetectionFrameLayout @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, ) : FrameLayout(con...
The `isTouching` property is introduced but appears unused in the current implementation. In `MainActivity.canDisplayAppRatingsPrompt`, there's no check for `!binding.root.isTouching` or similar condition. Consider adding this check to prevent showing the app review prompt while the user is actively touching the screen...
package au.com.shiftyjelly.pocketcasts.views.component import android.content.Context import android.util.AttributeSet import android.view.MotionEvent import android.widget.FrameLayout import java.time.Instant import kotlin.time.Duration class TouchDetectionFrameLayout @JvmOverloads constructor( context: Context,...
@@ -0,0 +1,27 @@ +package au.com.shiftyjelly.pocketcasts.views.component + +import android.content.Context +import android.util.AttributeSet +import android.view.MotionEvent +import android.widget.FrameLayout + +class TouchDetectionFrameLayout @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? ...
modules/services/views/src/main/java/au/com/shiftyjelly/pocketcasts/views/component/TouchDetectionFrameLayout.kt
13
Kotlin
1
suggestion
1,190
28
38
false
Display review prompt only when a root page is shown
4,703
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
processes of any jurisdiction or authority. ======================================================================= Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be cons...
The use of the force unwrap operator `!!` could cause a crash if `sha1()` returns null. Consider using a safe call with Elvis operator to provide a default value or handle the null case more gracefully: ```kotlin private val CcByLicenseHash = CcByLicense.sha1() ?: "" ``` ```suggestion private val CcByLicenseHash = CcBy...
its public licenses to material it publishes and in those instances will be considered the “Licensor.” The text of the Creative Commons public licenses is dedicated to the public domain under the CC0 Public Domain Dedication. Except for the limited purpose of indicating that material is shared under a Creative Commons ...
@@ -83,13 +96,441 @@ class LicensesFragment : BaseFragment() { libraryContentColor = MaterialTheme.theme.colors.primaryText01, ), libraries = produceLibraries { context -> - val libs = Libs.Builder().withContext(context).build() + ...
modules/features/settings/src/main/java/au/com/shiftyjelly/pocketcasts/settings/LicensesFragment.kt
26
Kotlin
1
bug
344
49
42
false
Add animation to the review prompt
4,704
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
bottom = 64.dp, ), ) } } } @Composable private fun EmojiButtons( onClickNotReally: () -> Unit, onClickYes: () -> Unit, modifier: Modifier = Modifier, ) { Row( modifier = modifier.fillMaxWidth(), ) { var isAnimationRunning b...
The animation state and progress are shared across both emoji buttons, but they're defined inside the `EmojiButtons` composable which is recomposed together. This could lead to a subtle issue: both buttons share the same animation progress, meaning they animate in sync rather than independently. Consider whether this i...
bottom = 64.dp, ), ) } } } @Composable private fun EmojiButtons( onClickNotReally: () -> Unit, onClickYes: () -> Unit, modifier: Modifier = Modifier, ) { Row( modifier = modifier.fillMaxWidth(), ) { var isAnimationRunning b...
@@ -90,13 +101,24 @@ private fun EmojiButtons( Row( modifier = modifier.fillMaxWidth(), ) { + var isAnimationRunning by remember { mutableStateOf(false) } + val animationProgress by animateFloatAsState( + targetValue = if (isAnimationRunning) 0.99f else 0.01f, + an...
modules/features/appreview/src/main/kotlin/au/com/shiftyjelly/pocketcasts/appreview/AppReviewPage.kt
26
Kotlin
0.643
suggestion
388
51
51
false
Add animation to the review prompt
4,704
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
) EmojiButtons( onClickNotReally = onClickNotReally, onClickYes = onClickYes, modifier = Modifier.padding( top = 56.dp, bottom = 64.dp, ), ) } } } @Composable private ...
The magic numbers `0.99f` and `0.01f` for animation progress are unexplained. Consider extracting these as named constants to clarify their purpose: ```kotlin private const val ANIMATION_START_PROGRESS = 0.01f private const val ANIMATION_END_PROGRESS = 0.99f ``` This would make it clearer why these specific values are ...
) EmojiButtons( onClickNotReally = onClickNotReally, onClickYes = onClickYes, modifier = Modifier.padding( top = 56.dp, bottom = 64.dp, ), ) } } } @Composable private ...
@@ -90,13 +101,24 @@ private fun EmojiButtons( Row( modifier = modifier.fillMaxWidth(), ) { + var isAnimationRunning by remember { mutableStateOf(false) } + val animationProgress by animateFloatAsState( + targetValue = if (isAnimationRunning) 0.99f else 0.01f,
modules/features/appreview/src/main/kotlin/au/com/shiftyjelly/pocketcasts/appreview/AppReviewPage.kt
26
Kotlin
0.857
refactor
346
51
51
false
Add animation to the review prompt
4,704
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
modifier = Modifier.padding( top = 56.dp, bottom = 64.dp, ), ) } } } @Composable private fun EmojiButtons( onClickNotReally: () -> Unit, onClickYes: () -> Unit, modifier: Modifier = Modifier, ) { Row( ...
The magic number `450` for the animation delay is unexplained. Consider extracting it as a named constant to clarify its purpose: ```kotlin private const val ANIMATION_START_DELAY_MS = 450L ```
modifier = Modifier.padding( top = 56.dp, bottom = 64.dp, ), ) } } } @Composable private fun EmojiButtons( onClickNotReally: () -> Unit, onClickYes: () -> Unit, modifier: Modifier = Modifier, ) { Row( ...
@@ -90,13 +101,24 @@ private fun EmojiButtons( Row( modifier = modifier.fillMaxWidth(), ) { + var isAnimationRunning by remember { mutableStateOf(false) } + val animationProgress by animateFloatAsState( + targetValue = if (isAnimationRunning) 0.99f else 0.01f, + an...
modules/features/appreview/src/main/kotlin/au/com/shiftyjelly/pocketcasts/appreview/AppReviewPage.kt
26
Kotlin
0.786
refactor
193
51
51
false
Add animation to the review prompt
4,704
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
EmojiButtons( onClickNotReally = onClickNotReally, onClickYes = onClickYes, modifier = Modifier.padding( top = 56.dp, bottom = 64.dp, ), ) } } } @Composable private fun EmojiButto...
The magic number `3000` for animation duration is unexplained. Consider extracting it as a named constant to clarify its purpose: ```kotlin private const val ANIMATION_DURATION_MS = 3000 ```
EmojiButtons( onClickNotReally = onClickNotReally, onClickYes = onClickYes, modifier = Modifier.padding( top = 56.dp, bottom = 64.dp, ), ) } } } @Composable private fun EmojiButto...
@@ -90,13 +101,24 @@ private fun EmojiButtons( Row( modifier = modifier.fillMaxWidth(), ) { + var isAnimationRunning by remember { mutableStateOf(false) } + val animationProgress by animateFloatAsState( + targetValue = if (isAnimationRunning) 0.99f else 0.01f, + an...
modules/features/appreview/src/main/kotlin/au/com/shiftyjelly/pocketcasts/appreview/AppReviewPage.kt
26
Kotlin
0.786
refactor
190
51
51
false
Add animation to the review prompt
4,704
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
animationSpec = tween(durationMillis = 2000), ) { animatedNumber = this.value.toLong() } } } val text by rememberLottieComposition( spec = LottieCompositionSpec.RawRes(IR.raw.playback_story_total_listened_lo...
Creating a new `NumberFormat` instance on every recomposition is inefficient. Consider creating it once outside the `remember` block or using `remember { NumberFormat.getNumberInstance() }.format(animatedNumber)` to cache the formatter instance. ```suggestion val numberFormatter = remember { NumberFormat.getNum...
) { animatedNumber = this.value.toLong() } } } val text by rememberLottieComposition( spec = LottieCompositionSpec.RawRes(IR.raw.playback_story_total_listened_lottie), ) val animationProgress by animateLottieCo...
@@ -1,153 +1,151 @@ package au.com.shiftyjelly.pocketcasts.endofyear.ui -import android.content.Context -import androidx.compose.foundation.Image +import android.graphics.Typeface +import androidx.compose.animation.core.Animatable +import androidx.compose.animation.core.tween import androidx.compose.foundation.back...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/TotalTimeStory.kt
26
Kotlin
0.857
performance
408
51
51
false
[Playback] Total time story
4,705
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
package au.com.shiftyjelly.pocketcasts.endofyear.ui import android.content.Context import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding...
The `android.icu.number.NumberFormatter` import is unused. It should be removed. Only `java.text.NumberFormat` is used in the code at line 104.
package au.com.shiftyjelly.pocketcasts.endofyear.ui import android.graphics.Typeface import androidx.compose.animation.core.Animatable import androidx.compose.animation.core.tween import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillM...
@@ -1,153 +1,151 @@ package au.com.shiftyjelly.pocketcasts.endofyear.ui -import android.content.Context -import androidx.compose.foundation.Image +import android.graphics.Typeface +import androidx.compose.animation.core.Animatable
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/TotalTimeStory.kt
4
Kotlin
0.571
suggestion
143
29
29
false
[Playback] Total time story
4,705
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
@OptIn(ExperimentalComposeUiApi::class) @Composable internal fun TotalTimeStory( story: Story.TotalTime, measurements: EndOfYearMeasurements, controller: StoryCaptureController, onShareStory: (File) -> Unit, ) { Box( modifier = Modifier .capturable(controller.captureController(s...
The magic number `1000` should be extracted into a named constant to clarify its purpose. Consider adding `private const val ANIMATION_START_OFFSET = 1000` with a comment explaining why this value is used for the animation starting point.
import kotlin.time.Duration import kotlin.time.Duration.Companion.days import kotlin.time.Duration.Companion.hours import kotlin.time.Duration.Companion.minutes import kotlin.time.Duration.Companion.seconds import au.com.shiftyjelly.pocketcasts.images.R as IR import au.com.shiftyjelly.pocketcasts.localization.R as LR ...
@@ -1,153 +1,151 @@ package au.com.shiftyjelly.pocketcasts.endofyear.ui -import android.content.Context -import androidx.compose.foundation.Image +import android.graphics.Typeface +import androidx.compose.animation.core.Animatable +import androidx.compose.animation.core.tween import androidx.compose.foundation.back...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/TotalTimeStory.kt
26
Kotlin
0.643
refactor
238
51
51
false
[Playback] Total time story
4,705
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
val texts = getListeningTimeTexts(LocalContext.current, story.duration) SubcomposeLayout { constraints -> val subtitle = subcompose("subtitle") { TextH10( text = texts.subtitle, color = colorResource(UR.color.coolgrey_90), ...
The magic number `2000` (animation duration in milliseconds) should be extracted into a named constant like `private const val NUMBER_ANIMATION_DURATION_MS = 2000` to improve code maintainability and make it easier to adjust the animation timing.
modifier = Modifier .capturable(controller.captureController(story)) .fillMaxSize() .background(story.backgroundColor), ) { val isPreview = LocalInspectionMode.current val freezeAnimation = controller.isSharing || isPreview val totalMinutes = story...
@@ -1,153 +1,151 @@ package au.com.shiftyjelly.pocketcasts.endofyear.ui -import android.content.Context -import androidx.compose.foundation.Image +import android.graphics.Typeface +import androidx.compose.animation.core.Animatable +import androidx.compose.animation.core.tween import androidx.compose.foundation.back...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/TotalTimeStory.kt
26
Kotlin
0.643
refactor
246
51
51
false
[Playback] Total time story
4,705
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
package au.com.shiftyjelly.pocketcasts.appreview import androidx.lifecycle.ViewModel import au.com.shiftyjelly.pocketcasts.preferences.Settings import dagger.hilt.android.lifecycle.HiltViewModel import java.time.Clock import javax.inject.Inject @HiltViewModel class AppReviewViewModel @Inject constructor( private ...
The `declineAppReview()` function appends timestamps to the list without limiting its size. Over time, this list will grow unbounded. Since only the last 2 timestamps are used in `AppReviewManagerImpl.isNotDeclinedTwiceIn60Days()`, consider limiting the list size similar to other timestamp lists in the codebase (e.g., ...
package au.com.shiftyjelly.pocketcasts.appreview import androidx.lifecycle.ViewModel import au.com.shiftyjelly.pocketcasts.preferences.Settings import dagger.hilt.android.lifecycle.HiltViewModel import java.time.Clock import javax.inject.Inject @HiltViewModel class AppReviewViewModel @Inject constructor( private ...
@@ -0,0 +1,21 @@ +package au.com.shiftyjelly.pocketcasts.appreview + +import androidx.lifecycle.ViewModel +import au.com.shiftyjelly.pocketcasts.preferences.Settings +import dagger.hilt.android.lifecycle.HiltViewModel +import java.time.Clock +import javax.inject.Inject + +@HiltViewModel +class AppReviewViewModel @Injec...
modules/features/appreview/src/main/kotlin/au/com/shiftyjelly/pocketcasts/appreview/AppReviewViewModel.kt
20
Kotlin
1
suggestion
690
22
22
false
Add app review policies
4,706
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
package au.com.shiftyjelly.pocketcasts.repositories.appreview import au.com.shiftyjelly.pocketcasts.preferences.Settings import java.time.Clock import javax.inject.Inject class AppReviewExceptionHandler @Inject constructor( private val settings: Settings, private val clock: Clock, ) : Thread.UncaughtException...
```suggestion settings.appReviewCrashTimestamp.set(clock.instant(), updateModifiedAt = false, commit = true) ``` I had a few times where this timestamp wasn't being set on my Pixel 9. Adding the commit set to true seems to help.
package au.com.shiftyjelly.pocketcasts.repositories.appreview import au.com.shiftyjelly.pocketcasts.preferences.Settings import java.time.Clock import javax.inject.Inject class AppReviewExceptionHandler @Inject constructor( private val settings: Settings, private val clock: Clock, ) : Thread.UncaughtException...
@@ -0,0 +1,16 @@ +package au.com.shiftyjelly.pocketcasts.repositories.appreview + +import au.com.shiftyjelly.pocketcasts.preferences.Settings +import java.time.Clock +import javax.inject.Inject + +class AppReviewExceptionHandler @Inject constructor( + private val settings: Settings, + private val clock: Clock, +)...
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/appreview/AppReviewExceptionHandler.kt
13
Kotlin
0.786
bug
241
17
17
false
Add app review policies
4,706
Automattic/pocket-casts-android
1,688
Kotlin
geekygecko
MiSikora
package au.com.shiftyjelly.pocketcasts.settings.developer import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.clickable import androidx.compose.foundation.combinedClickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column...
The import `androidx.compose.material.icons.outlined.Error` is unused. Only `Icons.Outlined.ErrorOutline` is used in the file (at line 350). Consider removing this unused import. ```suggestion ```
package au.com.shiftyjelly.pocketcasts.settings.developer import androidx.compose.foundation.ExperimentalFoundationApi import androidx.compose.foundation.clickable import androidx.compose.foundation.combinedClickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column...
@@ -23,6 +23,8 @@ import androidx.compose.material.icons.outlined.BugReport import androidx.compose.material.icons.outlined.Delete import androidx.compose.material.icons.outlined.Downloading import androidx.compose.material.icons.outlined.EditCalendar +import androidx.compose.material.icons.outlined.Error
modules/features/settings/src/main/java/au/com/shiftyjelly/pocketcasts/settings/developer/DeveloperPage.kt
26
Kotlin
0.929
suggestion
197
51
51
false
Add app review policies
4,706
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
package au.com.shiftyjelly.pocketcasts.appreview import androidx.lifecycle.ViewModel import au.com.shiftyjelly.pocketcasts.preferences.Settings import dagger.hilt.android.lifecycle.HiltViewModel import java.time.Clock import javax.inject.Inject @HiltViewModel class AppReviewViewModel @Inject constructor( private ...
The `declineAppReview()` function continuously appends decline timestamps without any limit. Over time, this list could grow unbounded if a user repeatedly declines app review prompts. Consider limiting the list to a reasonable size (e.g., using `takeLast(n)` before adding the new timestamp) to prevent potential memo...
package au.com.shiftyjelly.pocketcasts.appreview import androidx.lifecycle.ViewModel import au.com.shiftyjelly.pocketcasts.preferences.Settings import dagger.hilt.android.lifecycle.HiltViewModel import java.time.Clock import javax.inject.Inject @HiltViewModel class AppReviewViewModel @Inject constructor( private ...
@@ -0,0 +1,21 @@ +package au.com.shiftyjelly.pocketcasts.appreview + +import androidx.lifecycle.ViewModel +import au.com.shiftyjelly.pocketcasts.preferences.Settings +import dagger.hilt.android.lifecycle.HiltViewModel +import java.time.Clock +import javax.inject.Inject + +@HiltViewModel +class AppReviewViewModel @Injec...
modules/features/appreview/src/main/kotlin/au/com/shiftyjelly/pocketcasts/appreview/AppReviewViewModel.kt
16
Kotlin
1
performance
612
22
22
false
Add app review policies
4,706
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
package au.com.shiftyjelly.pocketcasts.utils class ChainedExceptionHandler( val handlers: List<Thread.UncaughtExceptionHandler>, ) : Thread.UncaughtExceptionHandler { override fun uncaughtException(thread: Thread, throwable: Throwable) { handlers.forEach { handler -> handler.uncaughtException(thread, t...
If any handler in the chain throws an exception, subsequent handlers won't be called. This could prevent critical handlers (like the default system crash handler) from executing if an earlier handler fails. Consider wrapping each handler call in a try-catch block to ensure all handlers are called even if one fails: ``...
package au.com.shiftyjelly.pocketcasts.utils class ChainedExceptionHandler( val handlers: List<Thread.UncaughtExceptionHandler>, ) : Thread.UncaughtExceptionHandler { override fun uncaughtException(thread: Thread, throwable: Throwable) { handlers.forEach { handler -> runCatching { handler.u...
@@ -0,0 +1,9 @@ +package au.com.shiftyjelly.pocketcasts.utils + +class ChainedExceptionHandler( + val handlers: List<Thread.UncaughtExceptionHandler>, +) : Thread.UncaughtExceptionHandler { + override fun uncaughtException(thread: Thread, throwable: Throwable) { + handlers.forEach { handler -> handler.unca...
modules/services/utils/src/main/java/au/com/shiftyjelly/pocketcasts/utils/ChainedExceptionHandler.kt
7
Kotlin
1
bug
548
10
12
false
Add app review policies
4,706
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
settings.appReviewSubmittedReasons.set(usedReasons + reason, updateModifiedAt = false) } } AppReviewSignal.Result.Ignored -> Unit } } private fun hasEnoughTimePassedSinceLastPrompt(): Boolean { val now = clock.instant() val la...
The logic checks if the duration between the first and second decline timestamps is > 60 days, which is incorrect. The function should return false (not true) when there are 2 declines within 60 days. The condition should be `>= 60` to match the intended "twice in 60 days" behavior, and the function name suggests it sh...
AppReviewSignal.Result.Ignored -> Unit } } private fun canDispatchSignal(): Boolean { return FeatureFlag.isEnabled(Feature.IMPROVE_APP_RATINGS) && is30DaysSinceLastPrompt() && isNotDeclinedTwiceIn60Days() && isNoErrorsInLast2Sessions() && ...
@@ -101,10 +97,41 @@ class AppReviewManagerImpl( } } - private fun hasEnoughTimePassedSinceLastPrompt(): Boolean { - val now = clock.instant() + private fun canDispatchSignal(): Boolean { + return FeatureFlag.isEnabled(Feature.IMPROVE_APP_RATINGS) && + is30DaysSinceLastPro...
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/appreview/AppReviewManagerImpl.kt
26
Kotlin
0.857
bug
604
51
51
false
Add app review policies
4,706
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
private fun isReasonApplicable(reason: AppReviewReason) = when (reason) { AppReviewReason.ThirdEpisodeCompleted -> { settings.appReviewEpisodeCompletedTimestamps.value.size >= 3 } AppReviewReason.EpisodeStarred -> { settings.appReviewEpisodeStarredTimestamp.value !=...
[nitpick] The logic is inverted. The function should return true when there are NO crashes in the last 7 days, meaning the crash timestamp should be BEFORE 7 days ago (older than 7 days). The current logic `sevenDaysAgo.isAfter(lastCrashTimestamp)` returns true when the crash happened MORE than 7 days ago, which is cor...
val thirtyDaysAgo = clock.instant().minus(30, ChronoUnit.DAYS) val lastReviewTimestamp = settings.appReviewLastPromptTimestamp.value ?: return true return thirtyDaysAgo.isAfter(lastReviewTimestamp) } private fun isNotDeclinedTwiceIn60Days(): Boolean { val declineTimestamps = set...
@@ -101,10 +97,41 @@ class AppReviewManagerImpl( } } - private fun hasEnoughTimePassedSinceLastPrompt(): Boolean { - val now = clock.instant() + private fun canDispatchSignal(): Boolean { + return FeatureFlag.isEnabled(Feature.IMPROVE_APP_RATINGS) && + is30DaysSinceLastPro...
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/appreview/AppReviewManagerImpl.kt
26
Kotlin
0.857
bug
560
51
51
false
Add app review policies
4,706
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
FROM podcast_episodes WHERE episode_status IS 3; """, ) abstract suspend fun getFailedDownloadsStatistics(): EpisodeDownloadFailureStatistics @Query("SELECT * FROM podcast_episodes LIMIT :limit OFFSET :offset") abstract suspend fun getAllPodcastEpisodes(limi...
The SQL query uses `IS` operator for string comparison instead of `=`. The `IS` operator is for NULL checks, not value comparisons. Change `cleanTitle IS :normalizationToken` to `cleanTitle = :normalizationToken`. ```suggestion @Query("SELECT NOT EXISTS(SELECT * FROM podcast_episodes WHERE cleanTitle IS NULL OR TRI...
FROM podcast_episodes WHERE episode_status IS 3; """, ) abstract suspend fun getFailedDownloadsStatistics(): EpisodeDownloadFailureStatistics @Query("SELECT * FROM podcast_episodes LIMIT :limit OFFSET :offset") abstract suspend fun getAllPodcastEpisodes(limi...
@@ -493,4 +493,7 @@ abstract class EpisodeDao { open suspend fun updateAllCleanTitles(episodes: Collection<EpisodeWithTitle>) { episodes.forEach { episode -> updateCleanTitle(episode.uuid, episode.title) } } + + @Query("SELECT NOT EXISTS(SELECT * FROM podcast_episodes WHERE cleanTitle IS NULL OR T...
modules/services/model/src/main/java/au/com/shiftyjelly/pocketcasts/models/db/dao/EpisodeDao.kt
26
Kotlin
1
suggestion
381
29
29
false
Add episode titles normalization setting
4,710
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.semantics.Role import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Pr...
The import `AdvancedSettingsViewModel` is unused and should be removed. ```suggestion ```
import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.semantics.Role import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Pr...
@@ -44,10 +45,14 @@ import au.com.shiftyjelly.pocketcasts.compose.preview.ThemePreviewParameterProvi import au.com.shiftyjelly.pocketcasts.compose.theme import au.com.shiftyjelly.pocketcasts.localization.R import au.com.shiftyjelly.pocketcasts.preferences.Settings +import au.com.shiftyjelly.pocketcasts.settings.view...
modules/features/settings/src/main/java/au/com/shiftyjelly/pocketcasts/settings/StorageSettingsPage.kt
26
Kotlin
0.643
suggestion
90
51
51
false
Add episode titles normalization setting
4,710
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
processSignalResult(result, reason) } private fun processSignalResult(result: AppReviewSignal.Result, reason: AppReviewReason) { when (result) { AppReviewSignal.Result.Consumed -> { settings.appReviewLastPromptTimestamp.set(clock.instant(), updateModifiedAt = false) ...
The equality check `lastReviewTimestamp == thirtyDaysAgo` is problematic because it compares `Instant` objects with millisecond precision. Two Instants are extremely unlikely to be exactly equal unless they're the same reference. The correct logic should be `lastReviewTimestamp.isAfter(thirtyDaysAgo) || lastReviewTimes...
processSignalResult(result, reason) } private fun processSignalResult(result: AppReviewSignal.Result, reason: AppReviewReason) { when (result) { AppReviewSignal.Result.Consumed -> { settings.appReviewLastPromptTimestamp.set(clock.instant(), updateModifiedAt = false) ...
@@ -97,41 +147,37 @@ class AppReviewManagerImpl( } } - private fun canDispatchSignal(): Boolean { - return FeatureFlag.isEnabled(Feature.IMPROVE_APP_RATINGS) && - is30DaysSinceLastPrompt() && - isNotDeclinedTwiceIn60Days() && - isNoErrorsInLast2Sessions() && - ...
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/appreview/AppReviewManagerImpl.kt
26
Kotlin
0.857
suggestion
550
51
51
false
Add Google review integration
4,722
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
val thirtyDaysAgo = clock.instant().minus(30, ChronoUnit.DAYS) val lastReviewTimestamp = settings.appReviewLastPromptTimestamp.value ?: return false return lastReviewTimestamp == thirtyDaysAgo || lastReviewTimestamp.isAfter(thirtyDaysAgo) } private fun isDeclinedTwiceIn60Days(): Boolean...
Same issue as line 157: the equality check for Instant objects with millisecond precision is problematic. This should be simplified to `!lastCrashTimestamp.isBefore(sevenDaysAgo)` for clearer intent and correctness. ```suggestion return !lastCrashTimestamp.isBefore(sevenDaysAgo) ```
val thirtyDaysAgo = clock.instant().minus(30, ChronoUnit.DAYS) val lastReviewTimestamp = settings.appReviewLastPromptTimestamp.value ?: return false return !lastReviewTimestamp.isBefore(thirtyDaysAgo) } private fun isDeclinedTwiceIn60Days(): Boolean { val declineTimestamps = set...
@@ -97,41 +147,37 @@ class AppReviewManagerImpl( } } - private fun canDispatchSignal(): Boolean { - return FeatureFlag.isEnabled(Feature.IMPROVE_APP_RATINGS) && - is30DaysSinceLastPrompt() && - isNotDeclinedTwiceIn60Days() && - isNoErrorsInLast2Sessions() && - ...
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/appreview/AppReviewManagerImpl.kt
26
Kotlin
0.857
bug
291
51
51
false
Add Google review integration
4,722
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
package au.com.shiftyjelly.pocketcasts.appreview import android.content.DialogInterface import android.os.Bundle import android.view.LayoutInflater import android.view.ViewGroup import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.rememberScrollState import androidx.compos...
ReviewInfo from Google's Play Core library may not be Parcelable by default. Attempting to use @Parcelize on a class containing ReviewInfo could fail at runtime if ReviewInfo doesn't implement Parcelable. Verify that ReviewInfo is Parcelable, or consider passing it through a different mechanism (e.g., as a transient Vi...
.verticalScroll(rememberScrollState()) .navigationBarsPadding(), ) } } private fun goToHelpAndFeedback() { val hostListener = requireActivity() as FragmentHostListener hostListener.addFragment(HelpFragment()) hostListener.close...
@@ -59,4 +72,21 @@ class AppReviewDialogFragment : BaseDialogFragment() { viewModel.declineAppReview() } } + + @Parcelize + private class Args( + val reason: AppReviewReason, + val reviewInfo: ReviewInfo, + ) : Parcelable
modules/features/appreview/src/main/kotlin/au/com/shiftyjelly/pocketcasts/appreview/AppReviewDialogFragment.kt
26
Kotlin
0.5
bug
376
63
39
false
Add Google review integration
4,722
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
package au.com.shiftyjelly.pocketcasts.appreview import androidx.lifecycle.ViewModel import au.com.shiftyjelly.pocketcasts.preferences.Settings import dagger.hilt.android.lifecycle.HiltViewModel import java.time.Clock import javax.inject.Inject @HiltViewModel class AppReviewViewModel @Inject constructor( private ...
The error from launchReview is silently ignored. Consider logging the error or tracking it in analytics to understand if the Google review flow fails for users in production. This would help diagnose issues with the review integration.
import androidx.lifecycle.ViewModel import au.com.shiftyjelly.pocketcasts.preferences.Settings import com.google.android.play.core.ktx.launchReview import com.google.android.play.core.review.ReviewInfo import com.google.android.play.core.review.ReviewManager import dagger.hilt.android.lifecycle.HiltViewModel import jav...
@@ -18,4 +23,8 @@ class AppReviewViewModel @Inject constructor( } settings.appReviewLastDeclineTimestamps.set(newTimestamps, updateModifiedAt = false) } + + suspend fun launchReview(activity: Activity, reviewInfo: ReviewInfo) { + runCatching { reviewManager.launchReview(activity, review...
modules/features/appreview/src/main/kotlin/au/com/shiftyjelly/pocketcasts/appreview/AppReviewViewModel.kt
22
Kotlin
0.643
bug
235
22
28
false
Add Google review integration
4,722
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
private val continuation: CancellableContinuation<AppReviewSignal.Result>, ) : AppReviewSignal { override fun consume() { if (continuation.isActive) { runCatching { continuation.resume(AppReviewSignal.Result.Consumed) } } } override fun ignore() { if (continuation.is...
Corrected spelling of 'unsued' to 'unused'. ```suggestion * Whether unused app review reasons should be cleared. This is done to avoid ```
private class AppReviewSignalImpl( override val reason: AppReviewReason, override val reviewInfo: ReviewInfo, private val continuation: CancellableContinuation<AppReviewSignal.Result>, ) : AppReviewSignal { override fun consume() { if (continuation.isActive) { runCatching { continuat...
@@ -244,46 +300,69 @@ private class AppReviewSignalImpl( runCatching { continuation.resume(AppReviewSignal.Result.Ignored) } } } + + override fun toString(): String { + return "AppReviewSignalImpl(reason=$reason, reviewInfo=$reviewInfo)" + } } private enum class AppReviewDecl...
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/appreview/AppReviewManagerImpl.kt
26
Kotlin
0.786
suggestion
143
51
51
false
Clear undispatched app review reasons
4,723
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
runCatching { continuation.resume(AppReviewSignal.Result.Consumed) } } } override fun ignore() { if (continuation.isActive) { runCatching { continuation.resume(AppReviewSignal.Result.Ignored) } } } override fun toString(): String { return "AppRev...
[nitpick] The documentation comment could be clearer. It currently only explains the scenario where a prompt is shown, but `shouldCleanUpData` is also used for cleanup when prompting fails (e.g., due to crashes or errors). Consider revising to: "Whether unused app review reasons should be cleared. This prevents dispatc...
runCatching { continuation.resume(AppReviewSignal.Result.Consumed) } } } override fun ignore() { if (continuation.isActive) { runCatching { continuation.resume(AppReviewSignal.Result.Ignored) } } } override fun toString(): String { return "AppRev...
@@ -244,46 +303,69 @@ private class AppReviewSignalImpl( runCatching { continuation.resume(AppReviewSignal.Result.Ignored) } } } + + override fun toString(): String { + return "AppReviewSignalImpl(reason=$reason, reviewInfo=$reviewInfo)" + } } private enum class AppReviewDecl...
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/appreview/AppReviewManagerImpl.kt
26
Kotlin
1
bug
906
51
51
false
Clear undispatched app review reasons
4,723
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
} } delay(loopIdleDuration) } } } private suspend fun calculateTriggerData(): AppReviewTriggerData { if (!FeatureFlag.isEnabled(Feature.IMPROVE_APP_RATINGS)) { return AppReviewTriggerData.Failure(AppReviewDeclineReason....
This check for `areAllAppReviewReasonsUsed()` is redundant and unreachable. If all reasons are used, then `promptReason` would be `null` (lines 93-95), and the function would have already returned at line 97. Consider removing this check.
if (triggerData.reason.isFinal) { break } } } delay(loopIdleDuration) } } } private suspend fun calculateTriggerData(): AppReviewTriggerData { if (!Feature...
@@ -76,14 +89,22 @@ class AppReviewManagerImpl( return AppReviewTriggerData.Failure(AppReviewDeclineReason.FeatureNotEnabled) } - if (isDeclinedTwiceIn60Days()) { - return AppReviewTriggerData.Failure(AppReviewDeclineReason.PromptDeclinedMultipleTimes) - } - if ...
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/appreview/AppReviewManagerImpl.kt
26
Kotlin
0.786
suggestion
238
51
51
false
Add app ratings analytics
4,724
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
} if (triggerData.reason.isFinal) { break } } } delay(loopIdleDuration) } } } private suspend fun calculateTriggerData(): AppReviewTriggerD...
The order of checks has been changed so that `promptReason` is now computed before checking `isDeclinedTwiceIn60Days()` (line 104). This means unnecessary work is done filtering through reasons and calling `isReasonApplicable()` even when the user has declined twice and should not be prompted. Consider moving the `isDe...
AnalyticsEvent.USER_SATISFACTION_SURVEY_NOT_SHOWN, mapOf("policy" to triggerData.reason.analyticsValue), ) } if (triggerData.reason.isFinal) { break ...
@@ -76,14 +89,22 @@ class AppReviewManagerImpl( return AppReviewTriggerData.Failure(AppReviewDeclineReason.FeatureNotEnabled) } - if (isDeclinedTwiceIn60Days()) { - return AppReviewTriggerData.Failure(AppReviewDeclineReason.PromptDeclinedMultipleTimes) - } - if ...
modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/appreview/AppReviewManagerImpl.kt
26
Kotlin
0.643
suggestion
419
51
51
false
Add app ratings analytics
4,724
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
disableAutoScale = true, color = colorResource(UR.color.white), modifier = Modifier .fillMaxWidth() .padding(horizontal = 24.dp) .align(Alignment.Center), textAlign = TextAlign.Center, ) ShareStoryButton( modifier = Modifier.padding(bot...
[nitpick] The modifier chain should have proper spacing between chained calls for better readability. Consider adding a newline or space: `Modifier.padding(bottom = 18.dp).align(Alignment.BottomCenter)` should be written with the dot on a new line or with explicit spacing like `Modifier\n .padding(bottom = 18.dp)\n ...
val formattedHoursCount = remainingHours.toString() + " " + pluralStringResource(LR.plurals.hour, remainingHours.toInt()) TextP40( text = if (numberOfDays > 0) { stringResource( id = LR.string.end_of_year_story_top_podcast_stats_days, formattedEpisodeCount, ...
@@ -238,10 +237,12 @@ private fun Footer( color = colorResource(UR.color.white), modifier = Modifier .fillMaxWidth() - .padding(horizontal = 24.dp), + .padding(horizontal = 24.dp) + .align(Alignment.Center), textAlign = TextAlign.Center, ) ...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/TopShowStory.kt
26
Kotlin
0.857
suggestion
482
37
51
false
[Playback] TopShow: Update footer and header spacing to support small screens
4,726
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
TextP40( text = if (numberOfDays > 0) { stringResource( id = LR.string.end_of_year_story_top_podcast_stats_days, formattedEpisodeCount, formattedDaysCount, formattedHoursCount, ) } else { stringResour...
The modifier chain should be formatted with each modifier on a separate line for better readability, consistent with the project's coding style. Suggested format: ```kotlin modifier = Modifier .padding(bottom = 18.dp) .align(Alignment.BottomCenter), ``` ```suggestion modifier = Modifier .p...
val formattedHoursCount = remainingHours.toString() + " " + pluralStringResource(LR.plurals.hour, remainingHours.toInt()) TextP40( text = if (numberOfDays > 0) { stringResource( id = LR.string.end_of_year_story_top_podcast_stats_days, formattedEpisodeCount, ...
@@ -238,10 +252,12 @@ private fun Footer( color = colorResource(UR.color.white), modifier = Modifier .fillMaxWidth() - .padding(horizontal = 24.dp), + .padding(24.dp) + .align(textAlignment), textAlign = TextAlign.Center, ) ShareStoryBut...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/TopShowStory.kt
26
Kotlin
0.857
suggestion
390
51
51
false
[Playback] TopShow: Update footer and header spacing to support small screens
4,726
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
import androidx.compose.ui.res.stringResource 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.min import androidx.compose.ui.unit.sp import au.com.shiftyjelly.pocketcasts.compose.Devices import au.com.s...
[nitpick] Consider adding a comment explaining the threshold value `2` for the aspect ratio. For example: `// Aspect ratio threshold to determine if screen is square-like (height/width > 2 means tall screen)`. This would improve code readability and maintainability. ```suggestion // Aspect ratio threshold to determine...
import androidx.compose.ui.res.pluralStringResource import androidx.compose.ui.res.stringResource 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.min import androidx.compose.ui.unit.sp import au.com.shi...
@@ -54,6 +55,9 @@ 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
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/TopShowStory.kt
26
Kotlin
0.857
suggestion
386
51
51
false
[Playback] TopShow: Update footer and header spacing to support small screens
4,726
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
1f } else { 0f } } PodcastImage( uuid = story.show.uuid, elevation = 0.dp, modifier = Modifier .requiredSize(maxOf(maxWidth.times(.7f), maxHeight.times(.7f))) .scale(scaleAnimation) .graphicsLayer { ...
[nitpick] Removing `Alignment.CenterVertically` from the `verticalArrangement` parameter may cause the header content to no longer be vertically centered within its allocated height. If this change is intentional to address spacing issues on small screens, please verify the header layout appears as expected. Otherwise,...
if (it) { 1f } else { 0f } } PodcastImage( uuid = story.show.uuid, elevation = 0.dp, modifier = Modifier .requiredSize(maxOf(maxWidth.times(.7f), maxHeight.times(.7f))) .scale(scaleAnimation) .graphicsLa...
@@ -176,7 +191,7 @@ private fun Header( modifier: Modifier = Modifier, ) = Column( modifier = modifier, - verticalArrangement = Arrangement.spacedBy(8.dp, Alignment.CenterVertically), + verticalArrangement = Arrangement.spacedBy(8.dp),
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/TopShowStory.kt
26
Kotlin
0.857
suggestion
564
51
51
false
[Playback] TopShow: Update footer and header spacing to support small screens
4,726
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
}, disableAutoScale = true, color = colorResource(UR.color.white), modifier = Modifier .fillMaxWidth() .padding(horizontal = 24.dp), textAlign = TextAlign.Center, ) ShareStoryButton( story = story, controller = controller, o...
[nitpick] Modifier chain should have each modifier on its own line for better readability and consistency with the codebase. Consider formatting as: ```kotlin modifier = Modifier .padding(bottom = 18.dp) .align(Alignment.BottomCenter), ``` ```suggestion modifier = Modifier .padding(bottom = ...
val formattedHoursCount = remainingHours.toString() + " " + pluralStringResource(LR.plurals.hour, remainingHours.toInt()) TextP40( text = if (numberOfDays > 0) { stringResource( id = LR.string.end_of_year_story_top_podcast_stats_days, formattedEpisodeCount, ...
@@ -238,10 +253,12 @@ private fun Footer( color = colorResource(UR.color.white), modifier = Modifier .fillMaxWidth() - .padding(horizontal = 24.dp), + .padding(24.dp) + .align(textAlignment), textAlign = TextAlign.Center, ) ShareStoryBut...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/TopShowStory.kt
26
Kotlin
0.857
suggestion
374
36
51
false
[Playback] TopShow: Update footer and header spacing to support small screens
4,726
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
) { Column( modifier = modifier, horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center, ) { val context = LocalContext.current TextH10( text = stringResource( LR.string.end_of_year_story_longest_episode_ti...
```suggestion fontSize = 25.sp, lineHeight = 30.sp, ``` It might also be good to reduce the line height. <img width="1250" height="929" alt="Image" src="https://github.com/user-attachments/assets/36a3bec5-e6fb-42d6-8067-40778f6f7394" /> After putting them side by side should the Lottie animati...
) } @Composable private fun Header( story: Story.LongestEpisode, measurements: EndOfYearMeasurements, modifier: Modifier = Modifier, ) { Column( modifier = modifier, horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center, ) { ...
@@ -255,31 +212,59 @@ private fun TextInfo( ) }, ), + fontSize = 25.sp,
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/LongestEpisodeStory.kt
26
Kotlin
0.857
question
358
51
51
false
[Playback] Longest Episode story
4,727
Automattic/pocket-casts-android
1,688
Kotlin
geekygecko
sztomek
), fontSize = 25.sp, textAlign = TextAlign.Center, fontScale = measurements.smallDeviceFactor, disableAutoScale = true, color = colorResource(UR.color.white), modifier = Modifier.padding(horizontal = 24.dp), ) Spacer( ...
The `end_of_year_story_longest_episode_subtitle` string now takes no parameters (it's just "Hope you stretched first!"), but the code is still passing two parameters (episodeTitle and podcastTitle). This should be changed to just call `stringResource(LR.string.end_of_year_story_longest_episode_subtitle)` without any pa...
text = stringResource( LR.string.end_of_year_story_longest_episode_title, remember(story.episode.duration, context) { story.episode.duration.toFriendlyString( resources = context.resources, minUnit = Friendly...
@@ -255,31 +212,59 @@ private fun TextInfo( ) }, ), + fontSize = 25.sp, + textAlign = TextAlign.Center, fontScale = measurements.smallDeviceFactor, disableAutoScale = true, - color = colorResource(UR.color.cool...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/LongestEpisodeStory.kt
26
Kotlin
0.786
suggestion
329
51
51
false
[Playback] Longest Episode story
4,727
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
tween(durationMillis = 100, easing = LinearEasing) }, ) { if (it) { 1f } else { 0f } } PodcastImage( uuid = story.episode.podcastId, elevation = 0.dp, cornerSize = 4.dp, modifier = Modifier .requ...
The magic number `.2f` (20% of max height) is unexplained. Consider extracting this to a named constant like `private const val ARTWORK_VERTICAL_OFFSET_FACTOR = 0.2f` to improve code maintainability and make the intent clear.
if (it) { 1f } else { 1.1f } } val alphaAnimation by artworkTransition.animateFloat( transitionSpec = { tween(durationMillis = 100, easing = LinearEasing) }, ) { if (it) { 1f } else { 0f ...
@@ -26,224 +29,178 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.draw.scale -import androidx.compose.ui.graphics.Brush -import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.graphicsL...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/LongestEpisodeStory.kt
26
Kotlin
0.643
refactor
225
51
51
false
[Playback] Longest Episode story
4,727
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
sztomek
import androidx.compose.ui.draw.shadow import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.tooling.preview....
This import appears to be unused and can be removed. ```suggestion ```
import androidx.compose.ui.draw.shadow import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.tooling.preview....
@@ -49,6 +52,7 @@ import au.com.shiftyjelly.pocketcasts.compose.theme import au.com.shiftyjelly.pocketcasts.localization.helper.RelativeDateFormatter import au.com.shiftyjelly.pocketcasts.localization.helper.TimeHelper import au.com.shiftyjelly.pocketcasts.models.entity.PodcastEpisode +import au.com.shiftyjelly.pock...
modules/features/filters/src/main/java/au/com/shiftyjelly/pocketcasts/playlists/manual/AddEpisodesColumn.kt
26
Kotlin
0.643
suggestion
71
51
51
false
Display archived episode status when building a playlist
4,729
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
) } } HorizontalDivider( startIndent = 12.dp, ) } } @Composable private fun Footer( episode: PodcastEpisode, modifier: Modifier = Modifier, ) { Row( verticalAlignment = Alignment.Bottom, modifier = modifier, ) { ...
```suggestion if (episode.isArchived) { Image( painter = painterResource(IR.drawable.ic_archive), ``` Does this need to be stored in a variable?
) } } HorizontalDivider( startIndent = 12.dp, ) } } @Composable private fun Footer( episode: PodcastEpisode, modifier: Modifier = Modifier, ) { Row( verticalAlignment = Alignment.Bottom, modifier = modifier, ) { ...
@@ -187,6 +191,43 @@ private fun EpisodeRow( } } +@Composable +private fun Footer( + episode: PodcastEpisode, + modifier: Modifier = Modifier, +) { + Row( + verticalAlignment = Alignment.Bottom, + modifier = modifier, + ) { + val episodeIcon = if (episode.isArchived) { + ...
modules/features/filters/src/main/java/au/com/shiftyjelly/pocketcasts/playlists/manual/AddEpisodesColumn.kt
26
Kotlin
0.714
question
180
51
51
false
Display archived episode status when building a playlist
4,729
Automattic/pocket-casts-android
1,688
Kotlin
geekygecko
MiSikora
import androidx.media3.common.MediaItem import androidx.media3.common.Player import androidx.media3.common.Player.REPEAT_MODE_ALL import androidx.media3.common.Player.RepeatMode import androidx.media3.exoplayer.ExoPlayer import androidx.media3.ui.compose.PlayerSurface import androidx.media3.ui.compose.SURFACE_TYPE_SURF...
The `LifecycleStartEffect(Unit)` key means the video player will only be created once and won't recreate if `videoResourceId` changes. Consider using `LifecycleStartEffect(videoResourceId)` instead to ensure the player is recreated with the new video resource when the ID changes. This would prevent potential issues if ...
import androidx.media3.common.Player.REPEAT_MODE_ALL import androidx.media3.common.Player.RepeatMode import androidx.media3.common.util.UnstableApi import androidx.media3.exoplayer.ExoPlayer import androidx.media3.ui.compose.PlayerSurface import androidx.media3.ui.compose.SURFACE_TYPE_TEXTURE_VIEW import androidx.media...
@@ -0,0 +1,79 @@ +package au.com.shiftyjelly.pocketcasts.endofyear.ui.components + +import android.content.ContentResolver +import android.net.Uri +import androidx.annotation.RawRes +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.a...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/components/VideoSurface.kt
26
Kotlin
0.857
suggestion
456
51
51
false
[Playback] Story 7: Plus Interstitial
4,731
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
geekygecko
import androidx.media3.common.MediaItem import androidx.media3.common.Player import androidx.media3.common.Player.REPEAT_MODE_ALL import androidx.media3.common.Player.RepeatMode import androidx.media3.exoplayer.ExoPlayer import androidx.media3.ui.compose.PlayerSurface import androidx.media3.ui.compose.SURFACE_TYPE_TEXT...
⚠️ This doesn't look correct. It will recreate `ExoPlayer` on every stop/start cycle. `ExoPlayer` should be created once and cleaned up before destroying. On stop/start we should just pause and resume playback of the media item. Another issue is that `VideoSurface` looks like a component that someone might move to g...
import androidx.media3.common.Player.REPEAT_MODE_ALL import androidx.media3.common.Player.RepeatMode import androidx.media3.common.util.UnstableApi import androidx.media3.exoplayer.ExoPlayer import androidx.media3.ui.compose.PlayerSurface import androidx.media3.ui.compose.SURFACE_TYPE_TEXTURE_VIEW import androidx.media...
@@ -0,0 +1,80 @@ +package au.com.shiftyjelly.pocketcasts.endofyear.ui.components + +import android.content.ContentResolver +import android.net.Uri +import androidx.annotation.RawRes +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.a...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/components/VideoSurface.kt
26
Kotlin
0.643
refactor
934
51
51
false
[Playback] Story 7: Plus Interstitial
4,731
Automattic/pocket-casts-android
1,688
Kotlin
MiSikora
geekygecko
@RawRes videoResourceId: Int, modifier: Modifier = Modifier, backgroundColor: Color = Color.Black, @RepeatMode repeat: Int = REPEAT_MODE_ALL, play: Boolean = true, videoRatio: Float? = null, ) { val context = LocalContext.current var player by remember { mutableStateOf<Player?>(null) } ...
The player is created and prepared on every LifecycleStartEffect trigger. If the lifecycle start/stop cycles rapidly, this could cause performance issues. Consider moving player initialization into a LaunchedEffect with stable keys or using rememberSaveable to preserve the player instance across configuration changes. ...
backgroundColor: Color = Color.Black, @RepeatMode repeat: Int = REPEAT_MODE_ALL, play: Boolean = true, videoRatio: Float? = null, ) { val context = LocalContext.current val player = remember { mutableStateOf<Player?>(null) } val presentationState = rememberPresentationState(player.value) ...
@@ -0,0 +1,85 @@ +package au.com.shiftyjelly.pocketcasts.endofyear.ui.components + +import android.content.ContentResolver +import android.net.Uri +import androidx.annotation.RawRes +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.a...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/components/VideoSurface.kt
26
Kotlin
1
security
1,196
51
49
false
[Playback] Story 7: Plus Interstitial
4,731
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
geekygecko
internal fun VideoSurface( @RawRes videoResourceId: Int, modifier: Modifier = Modifier, backgroundColor: Color = Color.Black, @RepeatMode repeat: Int = REPEAT_MODE_ALL, play: Boolean = true, videoRatio: Float? = null, ) { val context = LocalContext.current var player by remember { mutabl...
The safe call operator is unnecessary here since player is already null-checked by the enclosing scope. Use 'player.release()' instead of 'player?.apply { release() }' for clarity. ```suggestion player.release() ```
modifier: Modifier = Modifier, backgroundColor: Color = Color.Black, @RepeatMode repeat: Int = REPEAT_MODE_ALL, play: Boolean = true, videoRatio: Float? = null, ) { val context = LocalContext.current val player = remember { mutableStateOf<Player?>(null) } val presentationState = remember...
@@ -0,0 +1,85 @@ +package au.com.shiftyjelly.pocketcasts.endofyear.ui.components + +import android.content.ContentResolver +import android.net.Uri +import androidx.annotation.RawRes +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.a...
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/components/VideoSurface.kt
26
Kotlin
1
suggestion
227
51
50
false
[Playback] Story 7: Plus Interstitial
4,731
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
geekygecko
AnalyticsEvent.ADD_TO_PLAYLISTS_CREATE_NEW_PLAYLIST_TAPPED, mapOf("source" to source.analyticsValue), ) } data class UiState( val playlistPreviews: List<PlaylistPreviewForEpisode>, val unfilteredPlaylistsCount: Int, val episodeLimit: Int, ) @Assi...
The `PlaylistChange` enum is defined but never used in the code. This appears to be dead code that should be removed. ```suggestion ```
package au.com.shiftyjelly.pocketcasts.playlists.manual import androidx.compose.foundation.text.input.TextFieldState import androidx.compose.ui.text.TextRange import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import au.com.shiftyjelly.pocketcasts.analytics.AnalyticsEvent import au.com.shifty...
@@ -216,3 +238,8 @@ class AddToPlaylistViewModel @AssistedInject constructor( ): AddToPlaylistViewModel } } + +private enum class PlaylistChange { + Added, + Removed, +}
modules/features/filters/src/main/java/au/com/shiftyjelly/pocketcasts/playlists/manual/AddToPlaylistViewModel.kt
26
Kotlin
0.786
suggestion
136
27
244
false
Add playlists modification snackbar
4,735
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
val newPlaylistNameState = TextFieldState( initialText = initialPlaylistTitle, initialSelection = TextRange(0, initialPlaylistTitle.length), ) val uiState = flow { val unfilteredSize = playlistManager.playlistPreviewsForEpisodeFlow(episodeUuid).map { it.size } val uiStates ...
The `playlistsChanges` mutable map is not thread-safe and can be accessed concurrently: - `cachePlaylistChange()` is called from `addToPlaylist()` and `removeFromPlaylist()` which run on `Dispatchers.Default` - `getPlaylistsAddedTo()` is called from the main thread when the dialog is dismissed This creates a potential...
val newPlaylistNameState = TextFieldState( initialText = initialPlaylistTitle, initialSelection = TextRange(0, initialPlaylistTitle.length), ) val uiState = flow { val unfilteredSize = playlistManager.playlistPreviewsForEpisodeFlow(episodeUuid).map { it.size } val uiStates ...
@@ -83,6 +83,24 @@ class AddToPlaylistViewModel @AssistedInject constructor( emitAll(uiStates) }.stateIn(viewModelScope, SharingStarted.Eagerly, initialValue = null) + private val playlistsChanges = mutableMapOf<String, Boolean>()
modules/features/filters/src/main/java/au/com/shiftyjelly/pocketcasts/playlists/manual/AddToPlaylistViewModel.kt
26
Kotlin
0.786
bug
437
51
51
false
Add playlists modification snackbar
4,735
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
) : Parcelable companion object { private const val NEW_INSTANCE_ARGS = "AddToPlaylistFragmentArgs" fun newInstance( source: Source, episodeUuid: String, podcastUuid: String, customTheme: Theme.ThemeType? = null, ) = AddToPlaylistFragment...
The comment states that having the function as a member would capture a reference to the fragment, but this explanation is incomplete. The actual issue is that the lambda inside `setAction()` (at line 151) would capture the Fragment's `this` reference if `openManualPlaylist` were a member function. Making it an extensi...
private class Args( val source: Source, val episodeUuid: String, val podcastUuid: String, val customTheme: Theme.ThemeType?, ) : Parcelable companion object { private const val NEW_INSTANCE_ARGS = "AddToPlaylistFragmentArgs" fun newInstance( sour...
@@ -175,5 +198,15 @@ internal class AddToPlaylistFragment : BaseDialogFragment() { } } +// This is deliberately not a member function to avoid memory leaks when showing a snackbar. +// Having it as a member function would require capturing a reference to the fragment +// in snackbar's action lambda leading to a...
modules/features/filters/src/main/java/au/com/shiftyjelly/pocketcasts/playlists/manual/AddToPlaylistFragment.kt
26
Kotlin
1
performance
869
36
42
false
Add playlists modification snackbar
4,735
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
episodeLimit = PlaylistManager.MANUAL_PLAYLIST_EPISODE_LIMIT, ) } else { null } } // Add a small delay to initial filtered playlists to avoid bottom sheet animation stutter delay(350) emitAll(uiStates) }.sta...
The `cachePlaylistChange` function uses clever but potentially confusing logic. Consider adding a comment to explain that: - When the same operation is repeated (e.g., add→add), the value is retained - When operations are toggled (e.g., add→remove or remove→add), returning `null` removes the entry, indicating the user ...
episodeLimit = PlaylistManager.MANUAL_PLAYLIST_EPISODE_LIMIT, ) } else { null } } // Add a small delay to initial filtered playlists to avoid bottom sheet animation stutter delay(350) emitAll(uiStates) }.sta...
@@ -83,6 +83,24 @@ class AddToPlaylistViewModel @AssistedInject constructor( emitAll(uiStates) }.stateIn(viewModelScope, SharingStarted.Eagerly, initialValue = null) + private val playlistsChanges = mutableMapOf<String, Boolean>() + + private fun cachePlaylistChange(uuid: String, shouldAdd: Boolea...
modules/features/filters/src/main/java/au/com/shiftyjelly/pocketcasts/playlists/manual/AddToPlaylistViewModel.kt
26
Kotlin
0.786
performance
424
51
51
false
Add playlists modification snackbar
4,735
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
unfilteredPlaylistsCount = unfilteredSize, episodeLimit = PlaylistManager.MANUAL_PLAYLIST_EPISODE_LIMIT, ) } else { null } } // Add a small delay to initial filtered playlists to avoid bottom sheet animation...
The `merge` function's lambda receives `(existingValue, newValue)` as parameters. The logic appears to ignore the `newValue` parameter (using `_`) and only check if `isCurrentlyAdded == shouldAdd`. This means the function always uses the second parameter (`shouldAdd`) for comparison, but the intention seems to be compa...
unfilteredPlaylistsCount = unfilteredSize, episodeLimit = PlaylistManager.MANUAL_PLAYLIST_EPISODE_LIMIT, ) } else { null } } // Add a small delay to initial filtered playlists to avoid bottom sheet animation...
@@ -83,6 +83,27 @@ class AddToPlaylistViewModel @AssistedInject constructor( emitAll(uiStates) }.stateIn(viewModelScope, SharingStarted.Eagerly, initialValue = null) + private val playlistsChanges = mutableMapOf<String, Boolean>() + + private fun cachePlaylistChange(uuid: String, shouldAdd: Boolea...
modules/features/filters/src/main/java/au/com/shiftyjelly/pocketcasts/playlists/manual/AddToPlaylistViewModel.kt
26
Kotlin
0.786
suggestion
626
51
51
false
Add playlists modification snackbar
4,735
Automattic/pocket-casts-android
1,688
Kotlin
Copilot
MiSikora
package au.com.shiftyjelly.pocketcasts.playlists.manual import android.os.Bundle import android.os.Parcelable import android.view.LayoutInflater import android.view.ViewGroup import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut import androidx.compose.foundation.layout.fillMaxSize import ...
Thanks for the comment explaining why.
companion object { private const val NEW_INSTANCE_ARGS = "AddToPlaylistFragmentArgs" fun newInstance( source: Source, episodeUuid: String, podcastUuid: String, customTheme: Theme.ThemeType? = null, ) = AddToPlaylistFragment().apply { ...
@@ -175,5 +203,16 @@ internal class AddToPlaylistFragment : BaseDialogFragment() { } } +// This is deliberately not a member function to avoid memory leaks when showing a snackbar. +// If this were a member function of the fragment, any lambda (such as the one passed to setAction()) +// that references it would...
modules/features/filters/src/main/java/au/com/shiftyjelly/pocketcasts/playlists/manual/AddToPlaylistFragment.kt
26
Kotlin
0.071
suggestion
39
180
35
false
Add playlists modification snackbar
4,735
Automattic/pocket-casts-android
1,688
Kotlin
geekygecko
MiSikora
onFailedToLoad: () -> Unit, ) { val size = LocalContext.current.sizeLimit?.let(Modifier::size) ?: Modifier.fillMaxSize() BoxWithConstraints( modifier = Modifier.then(size), ) { val density = LocalDensity.current val widthPx = density.run { maxWidth.toPx() } var isTextSiz...
❓ From my understanding this variable no longer has any use. Last year it was needed to compute the correct size to fit the text. I think we can remove it now and all the calculations associated with it.
val size = LocalContext.current.sizeLimit?.let(Modifier::size) ?: Modifier.fillMaxSize() BoxWithConstraints( modifier = Modifier.then(size), ) { val density = LocalDensity.current var coverFontSize by remember { mutableStateOf(24.sp) } var coverTextHeight by remember { mutab...
@@ -103,9 +92,24 @@ internal fun StoriesPage( } if (state is UiState.Failure) { - ErrorMessage(onRetry) - } else if (state is UiState.Syncing || !isTextSizeComputed) { - LoadingIndicator() + onFailedToLoad() + } else if (!isTextSizeComputed) {
modules/features/endofyear/src/main/java/au/com/shiftyjelly/pocketcasts/endofyear/ui/StoriesPage.kt
26
Kotlin
0.5
suggestion
203
51
51
false
[Playback] Loading and error handling updates
4,736
Automattic/pocket-casts-android
1,688
Kotlin
MiSikora
sztomek
openTab(VR.id.navigation_discover) } is OnboardingFinish.DoneShowPlusPromotion -> { settings.setHasDoneInitialOnboarding() OnboardingLauncher.openOnboardingFlow(this, OnboardingFlow.Upsell(OnboardingUpgradeSource.LOGIN_PLUS_PROMOTION)) ...
💡 Could we make it a bit more explicit and add some flag like `isFailure` to the contract? It's rather surprising that if any result is returned it means that there was a failure.
openTab(VR.id.navigation_discover) } is OnboardingFinish.DoneShowPlusPromotion -> { settings.setHasDoneInitialOnboarding() OnboardingLauncher.openOnboardingFlow(this, OnboardingFlow.Upsell(OnboardingUpgradeSource.LOGIN_PLUS_PROMOTION)) ...
@@ -379,6 +379,19 @@ class MainActivity : showViewBookmarksSnackbar(result) } + private val endOfYearActivityLauncher: ActivityResultLauncher<Intent> = registerForActivityResult(StoriesActivity.StoriesActivityContract()) { result -> + result?.let { source ->
app/src/main/java/au/com/shiftyjelly/pocketcasts/ui/MainActivity.kt
26
Kotlin
0.571
bug
179
51
51
false
[Playback] Loading and error handling updates
4,736
Automattic/pocket-casts-android
1,688
Kotlin
MiSikora
sztomek