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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
var lastNotifiedProgress: DownloadProgress? = null
downloadProgressCache.progressFlow(episode.uuid).collect { downloadProgress ->
if (downloadProgress == null) {
return@collect
}
if (shouldUpdateNotification(current = lastNotifi... | No issues found. | var lastNotifiedProgress: DownloadProgress? = null
downloadProgressCache.progressFlow(episode.uuid).collect { downloadProgress ->
if (downloadProgress == null) {
return@collect
}
if (shouldUpdateNotification(current = lastNotifi... | @@ -38,13 +38,9 @@ class DownloadNotificationObserver @Inject constructor(
) {
private val manager = requireNotNull(context.getSystemService<NotificationManager>())
- fun observeNotificationUpdates(
- episode: BaseEpisode,
- onCreateNotification: (Int, Notification) -> Unit,
- ): Job {
+ ... | modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/download/DownloadNotificationObserver.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | Download worker improvements | 4,972 | Automattic/pocket-casts-android | 1,688 | Kotlin | MiSikora | |
is PodcastEpisodeEntity -> create(RequestType.PodcastEpisode(episode, useEpisodeArtwork), onSuccess)
is UserEpisodeEntity -> create(RequestType.UserEpisode(episode, useEpisodeArtwork), onSuccess)
}
private fun create(
type: RequestType,
onSuccess: () -> Unit,
) = ImageReques... | No issues found. | is PodcastEpisodeEntity -> create(RequestType.PodcastEpisode(episode, useEpisodeArtwork), onSuccess)
is UserEpisodeEntity -> create(RequestType.UserEpisode(episode, useEpisodeArtwork), onSuccess)
}
private fun create(
type: RequestType,
onSuccess: () -> Unit,
) = ImageReques... | @@ -31,6 +31,7 @@ data class PocketCastsImageRequestFactory(
private val size: Int? = null,
private val placeholderType: PlaceholderType = PlaceholderType.Large,
private val transformations: List<Transformation> = emptyList(),
+ private val showErrorPlaceholder: Boolean = true,
) {
private val a... | modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/images/PocketCastsImageRequestFactory.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | On the podcasts tab show the podcast title when artwork is missing | 4,973 | Automattic/pocket-casts-android | 1,688 | Kotlin | geekygecko | |
val result = episodeDao.findByUuid(episode.uuid)!!
assertEquals(EpisodeDownloadStatus.WaitingForWifi, result.downloadStatus)
assertEquals(null, result.downloadedFilePath)
assertEquals(null, result.downloadErrorDetails)
}
@Test
fun updateDownloadStatusToWaitingForPower() = ... | No issues found. |
val result = episodeDao.findByUuid(episode.uuid)!!
assertEquals(EpisodeDownloadStatus.WaitingForWifi, result.downloadStatus)
assertEquals(null, result.downloadedFilePath)
assertEquals(null, result.downloadErrorDetails)
}
@Test
fun updateDownloadStatusToWaitingForPower() = ... | @@ -83,6 +83,17 @@ class EpisodeDaoDownloadStatusTest {
assertEquals(null, result.downloadErrorDetails)
}
+ @Test
+ fun updateDownloadStatusToWaitingForStorage() = runTest {
+ episodeDao.updateDownloadStatuses(mapOf(episode.uuid to DownloadStatusUpdate.WaitingForStorage))
+
+ val res... | app/src/androidTest/java/au/com/shiftyjelly/pocketcasts/models/db/EpisodeDaoDownloadStatusTest.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | Add waiting for storage download status | 4,978 | Automattic/pocket-casts-android | 1,688 | Kotlin | MiSikora | |
DownloadWorkInfo.Pending(
episodeUuid = "episode-id",
isWifiRequired = false,
isPowerRequired = false,
isStorageRequired = false,
),
downloadInfo,
)
}
@Test
fun `map succeeded work info`() {
... | No issues found. | DownloadWorkInfo.Pending(
episodeUuid = "episode-id",
isWifiRequired = false,
isPowerRequired = false,
isStorageRequired = false,
),
downloadInfo,
)
}
@Test
fun `map succeeded work info`() {
... | @@ -0,0 +1,313 @@
+package au.com.shiftyjelly.pocketcasts.repositories.download
+
+import androidx.work.Constraints
+import androidx.work.Data
+import androidx.work.NetworkType
+import androidx.work.WorkInfo
+import java.io.File
+import java.util.UUID
+import org.junit.Assert.assertEquals
+import org.junit.Assert.asser... | modules/services/repositories/src/test/java/au/com/shiftyjelly/pocketcasts/repositories/download/DownloadWorkInfoTest.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | Add DownloadWorkInfo | 4,979 | Automattic/pocket-casts-android | 1,688 | Kotlin | MiSikora | |
),
downloadInfo,
)
}
@Test
fun `map succeeded work info`() {
val workInfo = WorkInfo(
id = UUID.randomUUID(),
state = WorkInfo.State.SUCCEEDED,
tags = setOf(DownloadEpisodeWorker.episodeWorkerName("episode-id")),
output... | No issues found. | ),
downloadInfo,
)
}
@Test
fun `map succeeded work info`() {
val workInfo = WorkInfo(
id = UUID.randomUUID(),
state = WorkInfo.State.SUCCEEDED,
tags = setOf(DownloadEpisodeWorker.episodeWorkerName("episode-id")),
output... | @@ -50,7 +50,9 @@ class DownloadWorkInfoTest {
assertEquals(
DownloadWorkInfo.Pending(
+ id = workInfo.id,
episodeUuid = "episode-id",
+ runAttemptCount = 0,
isWifiRequired = false,
isPowerRequired = false,
... | modules/services/repositories/src/test/java/au/com/shiftyjelly/pocketcasts/repositories/download/DownloadWorkInfoTest.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | Improve download episode worker | 4,981 | Automattic/pocket-casts-android | 1,688 | Kotlin | MiSikora | |
package au.com.shiftyjelly.pocketcasts.repositories.download
interface DownloadQueue {
fun enqueue(episodeUuid: String, downloadType: DownloadType) = enqueueAll(setOf(episodeUuid), downloadType)
fun enqueueAll(episodeUuids: Collection<String>, downloadType: DownloadType)
}
enum class DownloadType {
UserT... | No issues found. | package au.com.shiftyjelly.pocketcasts.repositories.download
interface DownloadQueue {
fun enqueue(episodeUuid: String, downloadType: DownloadType) = enqueueAll(setOf(episodeUuid), downloadType)
fun enqueueAll(episodeUuids: Collection<String>, downloadType: DownloadType)
}
enum class DownloadType {
UserT... | @@ -0,0 +1,12 @@
+package au.com.shiftyjelly.pocketcasts.repositories.download
+
+interface DownloadQueue {
+ fun enqueue(episodeUuid: String, downloadType: DownloadType) = enqueueAll(setOf(episodeUuid), downloadType)
+
+ fun enqueueAll(episodeUuids: Collection<String>, downloadType: DownloadType)
+}
+
+enum clas... | modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/download/DownloadQueue.kt | 0 | Kotlin | 1 | none | 16 | 13 | 13 | true | Add download queue entry point | 4,982 | Automattic/pocket-casts-android | 1,688 | Kotlin | MiSikora | |
),
downloadInfo,
)
}
@Test
fun `map succeeded work info`() {
val workInfo = WorkInfo(
id = UUID.randomUUID(),
state = WorkInfo.State.SUCCEEDED,
tags = setOf(DownloadEpisodeWorker.episodeTag("episode-id")),
outputData = ... | No issues found. | ),
downloadInfo,
)
}
@Test
fun `map succeeded work info`() {
val workInfo = WorkInfo(
id = UUID.randomUUID(),
state = WorkInfo.State.SUCCEEDED,
tags = setOf(DownloadEpisodeWorker.episodeTag("episode-id")),
outputData = ... | @@ -43,7 +43,7 @@ class DownloadWorkInfoTest {
val workInfo = WorkInfo(
id = UUID.randomUUID(),
state = WorkInfo.State.ENQUEUED,
- tags = setOf(DownloadEpisodeWorker.episodeWorkerName("episode-id")),
+ tags = setOf(DownloadEpisodeWorker.episodeTag("episode-id")),... | modules/services/repositories/src/test/java/au/com/shiftyjelly/pocketcasts/repositories/download/DownloadWorkInfoTest.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | Add download cancellation | 4,983 | Automattic/pocket-casts-android | 1,688 | Kotlin | MiSikora | |
podcastEpisodes += mapOf(podcast() to podcast)
val playlistEpisodes = listOf(podcastEpisode(), podcastEpisode(), podcastEpisode())
val playlist = playlist {
addEpisodes(playlistEpisodes)
}
playlists += playlist
val upNext = listOf(podcastEpisode(), userEpiso... | No issues found. | podcastEpisodes += mapOf(podcast() to podcast)
val playlistEpisodes = listOf(podcastEpisode(), podcastEpisode(), podcastEpisode())
val playlist = playlist {
addEpisodes(playlistEpisodes)
}
playlists += playlist
val upNext = listOf(podcastEpisode(), userEpiso... | @@ -1,14 +1,18 @@
package au.com.shiftyjelly.pocketcasts.repositories.download
import au.com.shiftyjelly.pocketcasts.models.entity.BaseEpisode
+import au.com.shiftyjelly.pocketcasts.models.entity.ManualPlaylistEpisode
import au.com.shiftyjelly.pocketcasts.models.entity.Podcast
import au.com.shiftyjelly.pocketcast... | modules/services/repositories/src/test/java/au/com/shiftyjelly/pocketcasts/repositories/download/AutoDownloadEpisodeProviderTest.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | Move auto download playlist selection logic to provider | 4,992 | Automattic/pocket-casts-android | 1,688 | Kotlin | MiSikora | |
if (inUpNext) {
imgIconUpNext.setImageResource(IR.drawable.ic_upnext_remove)
lblUpNext.setText(LR.string.profile_cloud_remove_from_up_next)
layoutUpNext.setOnClickListener {
viewModel.removeFromUpNext(episode)
... | No issues found. | if (inUpNext) {
imgIconUpNext.setImageResource(IR.drawable.ic_upnext_remove)
lblUpNext.setText(LR.string.profile_cloud_remove_from_up_next)
layoutUpNext.setOnClickListener {
viewModel.removeFromUpNext(episode)
... | @@ -49,6 +49,9 @@ import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import dagger.hilt.android.AndroidEntryPoint
+import io.reactivex.disposables.CompositeDisposa... | modules/features/profile/src/main/java/au/com/shiftyjelly/pocketcasts/profile/cloud/CloudFileBottomSheetFragment.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | Fix user file status not updating | 4,998 | Automattic/pocket-casts-android | 1,688 | Kotlin | geekygecko | |
@Test
fun `getArtworkUrl with null size returns 960 image`() {
val url = PodcastImage.getArtworkUrl(size = null, uuid = testUuid, isWearOS = false)
assertEquals("${Settings.SERVER_STATIC_URL}/discover/images/webp/960/$testUuid.webp", url)
}
@Test
fun `getArtworkUrl with size greater... | No issues found. | @Test
fun `getArtworkUrl with null size returns 960 image`() {
val url = PodcastImage.getArtworkUrl(size = null, uuid = testUuid, isWearOS = false)
assertEquals("${Settings.SERVER_STATIC_URL}/discover/images/webp/960/$testUuid.webp", url)
}
@Test
fun `getArtworkUrl with size greater... | @@ -49,15 +49,15 @@ class PodcastImageTest {
}
@Test
- fun `getArtworkUrl with null size returns 480 image for WearOS`() {
+ fun `getArtworkUrl with null size returns 200 image for WearOS`() {
val url = PodcastImage.getArtworkUrl(size = null, uuid = testUuid, isWearOS = true)
- assertE... | app/src/test/java/au/com/shiftyjelly/pocketcasts/repositories/images/PodcastImageTest.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | [Q1 Quality] WearOS - Optimise podcast artwork resolution on wear | 5,001 | Automattic/pocket-casts-android | 1,688 | Kotlin | sztomek | |
downloader.download(
episode = episode,
downloadFile = downloadFile,
tempFile = tempFile,
)
assertFalse(downloadFile.exists())
assertFalse(tempFile.exists())
assertNull(progressCache.progressFlow(episode.uuid).value)
}
@Test
fun `... | No issues found. | downloader.download(
episode = episode,
downloadFile = downloadFile,
tempFile = tempFile,
)
assertFalse(downloadFile.exists())
assertFalse(tempFile.exists())
assertNull(progressCache.progressFlow(episode.uuid).value)
}
@Test
fun `... | @@ -32,9 +32,12 @@ class EpisodeDownloaderTest {
private lateinit var episode: PodcastEpisode
+ private val minContentLength = 10L
+
private val downloader = EpisodeDownloader(
httpClient = ::OkHttpClient,
progressCache = progressCache,
+ minContentLength = minContentLength,
... | modules/services/repositories/src/test/java/au/com/shiftyjelly/pocketcasts/repositories/download/EpisodeDownloaderTest.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | Surface more issues when downloading episodes | 5,002 | Automattic/pocket-casts-android | 1,688 | Kotlin | MiSikora | |
package au.com.shiftyjelly.pocketcasts.analytics
interface AccountStatusInfo {
fun isLoggedIn(): Boolean
fun getUserIds(): UserIds
fun recreateAnonId(): String
}
data class UserIds(
val accountId: String?,
val anonId: String,
) {
val id get() = accountId ?: anonId
}
| No issues found. | package au.com.shiftyjelly.pocketcasts.analytics
interface AccountStatusInfo {
fun isLoggedIn(): Boolean
fun getUserIds(): UserIds
fun recreateAnonId(): String
}
data class UserIds(
val accountId: String?,
val anonId: String,
) {
val id get() = accountId ?: anonId
}
| @@ -2,5 +2,13 @@ package au.com.shiftyjelly.pocketcasts.analytics
interface AccountStatusInfo {
fun isLoggedIn(): Boolean
- fun getUuid(): String?
+ fun getUserIds(): UserIds
+ fun recreateAnonId(): String
+}
+
+data class UserIds(
+ val accountId: String?,
+ val anonId: String,
+) {
+ val id ... | modules/services/analytics/src/main/java/au/com/shiftyjelly/pocketcasts/analytics/AccountStatusInfo.kt | 0 | Kotlin | 1 | none | 16 | 15 | 15 | true | Extract user ID tracking from Tracks tracker | 5,010 | Automattic/pocket-casts-android | 1,688 | Kotlin | MiSikora | |
package au.com.shiftyjelly.pocketcasts.analytics.di
import au.com.shiftyjelly.pocketcasts.analytics.AnonymousBumpStatsTracker
import au.com.shiftyjelly.pocketcasts.analytics.FirebaseAnalyticsTracker
import au.com.shiftyjelly.pocketcasts.analytics.Tracker
import au.com.shiftyjelly.pocketcasts.analytics.TracksAnalyticsT... | No issues found. | package au.com.shiftyjelly.pocketcasts.analytics.di
import au.com.shiftyjelly.pocketcasts.analytics.AnonymousBumpStatsTracker
import au.com.shiftyjelly.pocketcasts.analytics.FirebaseAnalyticsTracker
import au.com.shiftyjelly.pocketcasts.analytics.Tracker
import au.com.shiftyjelly.pocketcasts.analytics.TracksAnalyticsT... | @@ -0,0 +1,27 @@
+package au.com.shiftyjelly.pocketcasts.analytics.di
+
+import au.com.shiftyjelly.pocketcasts.analytics.AnonymousBumpStatsTracker
+import au.com.shiftyjelly.pocketcasts.analytics.FirebaseAnalyticsTracker
+import au.com.shiftyjelly.pocketcasts.analytics.Tracker
+import au.com.shiftyjelly.pocketcasts.ana... | modules/services/analytics/src/prototype/kotlin/au/com/shiftyjelly/pocketcasts/analytics/di/PrototypeTrackerModule.kt | 0 | Kotlin | 1 | none | 16 | 28 | 28 | true | Move trackers to release build | 5,011 | Automattic/pocket-casts-android | 1,688 | Kotlin | MiSikora | |
)
podcastFlow.update { it?.copy(rawAutoArchiveEpisodeLimit = limit) }
podcastManager.updateArchiveEpisodeLimit(podcastUuid, limit)
}
}
fun changePlaybackEffects(enable: Boolean) {
val podcast = podcastFlow.value ?: return
viewModelScope.launch(Dispatc... | No issues found. | )
podcastFlow.update { it?.copy(rawAutoArchiveEpisodeLimit = limit) }
podcastManager.updateArchiveEpisodeLimit(podcastUuid, limit)
}
}
fun changePlaybackEffects(enable: Boolean) {
val podcast = podcastFlow.value ?: return
viewModelScope.launch(Dispatc... | @@ -31,6 +31,7 @@ import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.first
+import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.flow.update
import kotlinx.corou... | modules/features/podcasts/src/main/java/au/com/shiftyjelly/pocketcasts/podcasts/viewmodel/PodcastSettingsViewModel.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | Fix inconsistent auto-download settings | 5,013 | Automattic/pocket-casts-android | 1,688 | Kotlin | MiSikora | |
}
if (episode?.isVideo == true && state.isPlaying) {
if (resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT) {
binding.playerBottomSheet.openPlayer()
} else {
... | No issues found. | }
if (episode?.isVideo == true && state.isPlaying) {
if (resources.configuration.orientation == Configuration.ORIENTATION_PORTRAIT) {
binding.playerBottomSheet.openPlayer()
} else {
... | @@ -12,6 +12,7 @@ import android.os.Bundle
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
+import androidx.activity.OnBackPressedCallback
import androidx.activity.enableEdgeToEdge
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contr... | app/src/main/java/au/com/shiftyjelly/pocketcasts/ui/MainActivity.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | [Predictive Back] Enable predictive back | 5,014 | Automattic/pocket-casts-android | 1,688 | Kotlin | sztomek | |
} else {
phase
}
}
val invalidRawPlan = rawPlan.copy(pricingPhases = phases)
val plan = ReferralSubscriptionPlan.create(invalidRawPlan).getOrNull()
assertNull(plan)
}
@Test
fun `do not create plan with non recurring final phase`() {
... | No issues found. | } else {
phase
}
}
val invalidRawPlan = rawPlan.copy(pricingPhases = phases)
val plan = ReferralSubscriptionPlan.create(invalidRawPlan).getOrNull()
assertNull(plan)
}
@Test
fun `do not create plan with non recurring final phase`() {
... | @@ -1,15 +1,22 @@
package au.com.shiftyjelly.pocketcasts.referrals
import au.com.shiftyjelly.pocketcasts.payment.BillingCycle
+import au.com.shiftyjelly.pocketcasts.payment.InstallmentPlanDetails
+import au.com.shiftyjelly.pocketcasts.payment.Price
+import au.com.shiftyjelly.pocketcasts.payment.PricingPhase
+import... | modules/features/referrals/src/test/kotlin/au/com/shiftyjelly/pocketcasts/referrals/ReferralSubscriptionPlanTest.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | [Installments] Referral updates | 5,018 | Automattic/pocket-casts-android | 1,688 | Kotlin | sztomek | |
saveChangesBlocking(UpNextAction.ClearAll)
}
saveChangesBlocking(UpNextAction.PlayNow(episode, onAdd))
downloadIfPossible(episode, isUserInitiated)
if (episode.isFinished) {
episodeManager.markAsNotPlayedBlocking(episode)
}
}
override suspend fun ... | No issues found. | saveChangesBlocking(UpNextAction.ClearAll)
}
saveChangesBlocking(UpNextAction.PlayNow(episode, onAdd))
downloadIfPossible(episode, isUserInitiated)
if (episode.isFinished) {
episodeManager.markAsNotPlayedBlocking(episode)
}
}
override suspend fun ... | @@ -191,6 +191,7 @@ class UpNextQueueImpl @Inject constructor(
override suspend fun playNow(
episode: BaseEpisode,
automaticUpNextSource: AutoPlaySource?,
+ isUserInitiated: Boolean,
onAdd: (() -> Unit)?,
) = withContext(coroutineContext) {
// Don't build an Up Next ... | modules/services/repositories/src/main/java/au/com/shiftyjelly/pocketcasts/repositories/playback/UpNextQueueImpl.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | Standardize auto download behavior | 5,027 | Automattic/pocket-casts-android | 1,688 | Kotlin | MiSikora | |
}
}
@Test
fun `given feature flag on and treatment variation, when subscriptions load, then shouldUseInstallmentPlans is true`() = runTest {
FeatureFlag.setEnabled(Feature.NEW_INSTALLMENT_PLAN, true)
whenever(experimentProvider.getVariation(Experiment.YearlyInstallments)).thenReturn... | No issues found. | }
}
@Test
fun `given feature flag on and treatment variation, when subscriptions load, then shouldUseInstallmentPlans is true`() = runTest {
FeatureFlag.setEnabled(Feature.NEW_INSTALLMENT_PLAN, true)
whenever(experimentProvider.getVariation(Experiment.YearlyInstallments)).thenReturn... | @@ -0,0 +1,180 @@
+package au.com.shiftyjelly.pocketcasts.account.viewmodel
+
+import app.cash.turbine.test
+import au.com.shiftyjelly.pocketcasts.analytics.AnalyticsTracker
+import au.com.shiftyjelly.pocketcasts.analytics.experiments.Experiment
+import au.com.shiftyjelly.pocketcasts.analytics.experiments.ExperimentPro... | modules/features/account/src/test/java/au/com/shiftyjelly/pocketcasts/account/viewmodel/OnboardingUpgradeFeaturesViewModelTest.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | [Installmetns] Add and wire up experiment | 5,029 | Automattic/pocket-casts-android | 1,688 | Kotlin | sztomek | |
) { episodeList, searchResults ->
val searchQuery = searchQueryFlow.value
val results = if (searchQuery.isNotEmpty()) searchResults else episodeList
val showSearchBar = mode.showSearch &&
(results.isNotEmpty() || searchQuery.isNotEmpty())
... | No issues found. | ) { episodeList, searchResults ->
val searchQuery = searchQueryFlow.value
val results = if (searchQuery.isNotEmpty()) searchResults else episodeList
val showSearchBar = mode.showSearch &&
(results.isNotEmpty() || searchQuery.isNotEmpty())
... | @@ -13,6 +13,9 @@ import au.com.shiftyjelly.pocketcasts.preferences.Settings
import au.com.shiftyjelly.pocketcasts.repositories.download.DownloadQueue
import au.com.shiftyjelly.pocketcasts.repositories.podcast.EpisodeManager
import au.com.shiftyjelly.pocketcasts.repositories.user.UserManager
+import com.automattic.e... | modules/features/podcasts/src/main/java/au/com/shiftyjelly/pocketcasts/podcasts/view/ProfileEpisodeListViewModel.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | Migrate profile events to Event Horizon | 5,032 | Automattic/pocket-casts-android | 1,688 | Kotlin | MiSikora | |
actionLabel = stringResource(LR.string.encourage_account_banner_action_label),
icon = painterResource(IR.drawable.ic_filters_clock),
onActionClick = {
viewModel.onCreateFreeAccountClick()
Onbo... | No issues found. | actionLabel = stringResource(LR.string.encourage_account_banner_action_label),
icon = painterResource(IR.drawable.ic_filters_clock),
onActionClick = {
viewModel.onCreateFreeAccountClick()
Onbo... | @@ -52,7 +52,6 @@ import au.com.shiftyjelly.pocketcasts.podcasts.view.podcast.EpisodeListAdapter
import au.com.shiftyjelly.pocketcasts.preferences.Settings
import au.com.shiftyjelly.pocketcasts.preferences.model.ArtworkConfiguration.Element
import au.com.shiftyjelly.pocketcasts.preferences.model.AutoPlaySource
-impo... | modules/features/podcasts/src/main/java/au/com/shiftyjelly/pocketcasts/podcasts/view/ProfileEpisodeListFragment.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | Migrate downloads events to Event Horizon | 5,033 | Automattic/pocket-casts-android | 1,688 | Kotlin | MiSikora | |
navController: NavController,
swipeToDismissState: SwipeToDismissBoxState,
modifier: Modifier = Modifier,
allowSwipeToDismiss: Boolean = true,
firstPageContent: @Composable NowPlayingPagerScope.() -> Unit,
) {
val pagerState = rememberPagerState { NowPlayingPager.PAGE_COUNT }
val page0Column... | No issues found. | navController: NavController,
swipeToDismissState: SwipeToDismissBoxState,
modifier: Modifier = Modifier,
allowSwipeToDismiss: Boolean = true,
firstPageContent: @Composable NowPlayingPagerScope.() -> Unit,
) {
val pagerState = rememberPagerState { NowPlayingPager.PAGE_COUNT }
val page0Column... | @@ -39,21 +39,23 @@ fun NowPlayingPager(
navController: NavController,
swipeToDismissState: SwipeToDismissBoxState,
modifier: Modifier = Modifier,
- showTimeText: Boolean = true,
allowSwipeToDismiss: Boolean = true,
firstPageContent: @Composable NowPlayingPagerScope.() -> Unit,
) {
val... | wear/src/main/kotlin/au/com/shiftyjelly/pocketcasts/wear/ui/component/NowPlayingPager.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | [Quality Q1] WearOS - Show offline indicator next to time text | 5,036 | Automattic/pocket-casts-android | 1,688 | Kotlin | sztomek | |
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.pullrefresh.PullRefreshIndicator
import androidx.compose.material.pullrefresh.pullRefresh
import androidx.compose.material.pullref... | No issues found. | import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.pullrefresh.PullRefreshIndicator
import androidx.compose.material.pullrefresh.pullRefresh
import androidx.compose.material.pullref... | @@ -0,0 +1,53 @@
+package au.com.shiftyjelly.pocketcasts.wear.ui.component
+
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.material.ExperimentalMaterialApi
+import androidx.compose.material.pullrefresh.PullRefreshIndicator
+import androidx... | wear/src/main/kotlin/au/com/shiftyjelly/pocketcasts/wear/ui/component/PullToRefresh.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | [Quality Q1] WearOS - Add pull to refresh to main screen | 5,037 | Automattic/pocket-casts-android | 1,688 | Kotlin | sztomek | |
type = NavType.StringType
},
),
) {
NowPlayingPager(
navController = navController,
swipeToDismissState = swipeToDismissState,
) {
... | No issues found. | type = NavType.StringType
},
),
) {
NowPlayingPager(
navController = navController,
swipeToDismissState = swipeToDismissState,
) {
... | @@ -38,7 +38,6 @@ import au.com.shiftyjelly.pocketcasts.wear.ui.authentication.AUTHENTICATION_SUB_
import au.com.shiftyjelly.pocketcasts.wear.ui.authentication.RequirePlusScreen
import au.com.shiftyjelly.pocketcasts.wear.ui.authentication.WatchSyncState
import au.com.shiftyjelly.pocketcasts.wear.ui.authentication.au... | wear/src/main/kotlin/au/com/shiftyjelly/pocketcasts/wear/MainActivity.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | Remove connection overlay and banner | 5,040 | Automattic/pocket-casts-android | 1,688 | Kotlin | geekygecko | |
fun removeFromFolder() {
val podcast = podcast.value ?: return
launch {
folderManager.removePodcast(podcast)
}
}
fun changeSortOrder(order: BookmarksSortType) {
if (order !is BookmarksSortTypeForPodcast) return
settings.podcastBookmarksSortType.set(order,... | No issues found. | fun removeFromFolder() {
val podcast = podcast.value ?: return
launch {
folderManager.removePodcast(podcast)
}
}
fun changeSortOrder(order: BookmarksSortType) {
if (order !is BookmarksSortTypeForPodcast) return
settings.podcastBookmarksSortType.set(order,... | @@ -44,6 +44,11 @@ import au.com.shiftyjelly.pocketcasts.ui.theme.Theme
import au.com.shiftyjelly.pocketcasts.utils.log.LogBuffer
import au.com.shiftyjelly.pocketcasts.views.multiselect.MultiSelectBookmarksHelper
import au.com.shiftyjelly.pocketcasts.views.multiselect.MultiSelectEpisodesHelper
+import com.automattic... | modules/features/podcasts/src/main/java/au/com/shiftyjelly/pocketcasts/podcasts/viewmodel/PodcastViewModel.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | Migrate bookmark events to Event Horizon | 5,041 | Automattic/pocket-casts-android | 1,688 | Kotlin | MiSikora | |
modifier = Modifier.graphicsLayer {
rotationZ = rotation.value
},
)
},
onClick = onRefreshClick,
)
}
item {
val refreshStatusText = when (val refreshSt... | No issues found. | modifier = Modifier.graphicsLayer {
rotationZ = rotation.value
},
)
},
onClick = onRefreshClick,
)
}
item {
val refreshStatusText = when (val refreshSt... | @@ -13,6 +13,7 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.graphicsLayer
+import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.s... | wear/src/main/kotlin/au/com/shiftyjelly/pocketcasts/wear/ui/settings/SettingsScreen.kt | 0 | Kotlin | 1 | none | 16 | 51 | 51 | true | [Q1 Quality] WearOS - Show last sync time on settings below Refresh button | 5,044 | Automattic/pocket-casts-android | 1,688 | Kotlin | sztomek | |
import SwiftUI
import PocketCastsServer
class CategoriesSelectorViewController: UIHostingController<CategoriesSelectorView>, DiscoverSummaryProtocol {
class Observable: ObservableObject {
@Published public var item: DiscoverItem?
}
@ObservedObject fileprivate var observable: Observable
func ... | Can we rename that to `DiscoverItemObservable`?
I think it conveys a better name because `Observable` is super generic and it took me a while to understand why we were using this.
Same on `CategoriesSelectorView`. | import SwiftUI
import PocketCastsServer
class CategoriesSelectorViewController: UIHostingController<CategoriesSelectorView>, DiscoverSummaryProtocol {
class DiscoverItemObservable: ObservableObject {
@Published public var item: DiscoverItem?
}
@ObservedObject fileprivate var observable: DiscoverI... | @@ -0,0 +1,41 @@
+import SwiftUI
+import PocketCastsServer
+
+class CategoriesSelectorViewController: UIHostingController<CategoriesSelectorView>, DiscoverSummaryProtocol {
+
+ class Observable: ObservableObject { | podcasts/Categories/CategoriesSelectorViewController.swift | 6 | Swift | 0.643 | question | 219 | 31 | 31 | false | Categories Redesign: Pills | 1,602 | Automattic/pocket-casts-ios | 1,136 | Swift | leandroalonso | bjtitus |
public var isSponsored: Bool?
public var popular: [Int]?
public enum CodingKeys: String, CodingKey {
case summaryStyle = "summary_style"
case expandedStyle = "expanded_style"
case isSponsored = "sponsored"
case sponsoredPodcasts = "sponsored_podcasts"
case expandedTo... | Can't we just do:
```suggestion
public init(id: String? = nil, title: String? = nil, source: String? = nil, regions: [String]) {
self.id = id
self.title = title
self.source = source
self.regions = regions
```
Since it's what is really used by the code and the rest we can ... | public var isSponsored: Bool?
public var popular: [Int]?
public enum CodingKeys: String, CodingKey {
case summaryStyle = "summary_style"
case expandedStyle = "expanded_style"
case isSponsored = "sponsored"
case sponsoredPodcasts = "sponsored_podcasts"
case expandedTo... | @@ -276,11 +277,27 @@ public struct DiscoverItem: Decodable {
case isSponsored = "sponsored"
case sponsoredPodcasts = "sponsored_podcasts"
case expandedTopItemLabel = "expanded_top_item_label"
- case type, title, source, regions, curated, uuid, popular
+ case type, title, source... | Modules/Server/Sources/PocketCastsServer/Public/Sharing/Structs/ServerStructs.swift | 26 | Swift | 0.857 | question | 325 | 51 | 51 | false | Categories Redesign: Discover loading changes | 1,604 | Automattic/pocket-casts-ios | 1,136 | Swift | leandroalonso | bjtitus |
}
}
}
private func reloadIfRequired() {
if loadingContent { return }
DiscoverServerHandler.shared.discoverPage { [weak self] discoverLayout, cachedResponse in
if cachedResponse { return } // we got back a cached response, no need to reload the page
... | [nit] Maybe we can just expose `delegate` and do the usual `categoryVC.delegate = ...`? | }
}
}
private func reloadIfRequired() {
if loadingContent { return }
DiscoverServerHandler.shared.discoverPage { [weak self] discoverLayout, cachedResponse in
if cachedResponse { return } // we got back a cached response, no need to reload the page
... | @@ -145,13 +145,29 @@ class DiscoverViewController: PCViewController {
}
}
+ /// Reloads discover, keeping the items listed in `exclude`
+ /// - Parameters:
+ /// - items: Items to exclude from the reload process. These items will REMAIN in Discover
+ /// - category: The `DiscoverCategor... | podcasts/DiscoverViewController.swift | 26 | Swift | 0.357 | question | 87 | 51 | 51 | false | Categories Redesign: Discover loading changes | 1,604 | Automattic/pocket-casts-ios | 1,136 | Swift | leandroalonso | bjtitus |
case ("podcast_list", "single_podcast", _):
addSummaryController(SinglePodcastViewController(), discoverItem: discoverItem)
case ("podcast_list", "collection", _):
addSummaryController(CollectionSummaryViewController(), discoverItem: discoverItem)
case... | I don't love the implementation of this but I think it needs to change to a `UICollectionView` or something sooner rather than later. I started looking at that and have made some good progress so will try to submit that some time next week, maybe. | case ("podcast_list", "single_podcast", _):
addSummaryController(SinglePodcastViewController(), discoverItem: discoverItem)
case ("podcast_list", "collection", _):
addSummaryController(CollectionSummaryViewController(), discoverItem: discoverItem)
case... | @@ -242,7 +242,12 @@ class DiscoverViewController: PCViewController {
currentSnapshot = snapshot
}
- private func populateFrom(discoverLayout: DiscoverLayout?) {
+ /// Populate the scroll view using a DiscoverLayout with optional shouldInclude and shouldReset filters.
+ /// - Parameters:
+ /... | podcasts/DiscoverViewController.swift | 26 | Swift | 0.643 | suggestion | 247 | 51 | 51 | false | Categories: Sponsored Posts | 1,614 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | bjtitus |
import PocketCastsServer
private let popularItemsCount = 5
extension DiscoverViewController {
/// Reloads discover, keeping the items listed in `exclude`
/// - Parameters:
/// - items: Items to exclude from the reload process. These items will REMAIN in Discover
/// - category: The `DiscoverCatego... | Instead of this why not declare an enum inside the category like this:
```
extension DiscoverViewController {
private enum Constant {
static let popularItemsCount = 5
}
...
``` | import PocketCastsServer
extension DiscoverViewController {
private enum Constants {
static let popularItemsCount = 5
}
/// Reloads discover, keeping the items listed in `exclude`
/// - Parameters:
/// - items: Items to exclude from the reload process. These items will REMAIN in Discover... | @@ -0,0 +1,70 @@
+import PocketCastsServer
+
+private let popularItemsCount = 5 | podcasts/DiscoverViewController+CategoryRedesign.swift | 3 | Swift | 0.857 | suggestion | 201 | 28 | 28 | false | Add Most Popular section to Discover Categories page | 1,626 | Automattic/pocket-casts-ios | 1,136 | Swift | SergioEstevao | bjtitus |
import UIKit
class HeadingCell: ThemeableCell {
@IBOutlet var heading: UILabel!
@IBOutlet var button: UIButton!
var action: (() -> ())?
override func setSelected(_ selected: Bool, animated: Bool) {}
override func setHighlighted(_ highlighted: Bool, animated: Bool) {}
@IBAction func buttonTap... | Nit:
```suggestion
var action: (() -> Void)?
``` | import UIKit
class HeadingCell: ThemeableCell {
@IBOutlet var heading: UILabel!
@IBOutlet var button: UIButton!
var action: (() -> Void)?
override func setSelected(_ selected: Bool, animated: Bool) {}
override func setHighlighted(_ highlighted: Bool, animated: Bool) {}
@IBAction func buttonT... | @@ -2,7 +2,14 @@ import UIKit
class HeadingCell: ThemeableCell {
@IBOutlet var heading: UILabel!
+ @IBOutlet var button: UIButton!
+
+ var action: (() -> ())? | podcasts/HeadingCell.swift | 7 | Swift | 0.571 | suggestion | 56 | 16 | 16 | false | Serial show support | 2,502 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | SergioEstevao |
title = L10n.settingsNotifications
NotificationCenter.default.addObserver(self, selector: #selector(podcastUpdated(_:)), name: Constants.Notifications.podcastUpdated, object: nil)
Analytics.track(.settingsNotificationsShown)
}
override func viewWillAppear(_ animated: Bool) {
su... | Could these 2 be on the same case? `case .featuresAndOffers, .recommendationsAndReminders:` | title = L10n.settingsNotifications
NotificationCenter.default.addObserver(self, selector: #selector(podcastUpdated(_:)), name: Constants.Notifications.podcastUpdated, object: nil)
Analytics.track(.settingsNotificationsShown)
}
override func viewWillAppear(_ animated: Bool) {
su... | @@ -30,45 +71,73 @@ class NotificationsViewController: PCViewController, UITableViewDataSource, UITa
settingsTable.reloadData()
}
+ func numberOfSections(in tableView: UITableView) -> Int {
+ return FeatureFlag.notificationsRevamp.enabled ? 3 : 1
+ }
+
func tableView(_ tableView: UITab... | podcasts/NotificationsViewController.swift | 26 | Swift | 0.429 | suggestion | 91 | 51 | 51 | false | [Notifications revamp] Feature flag and settings UI | 2,934 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | SergioEstevao |
cell.cellSwitch.addTarget(self, action: #selector(pushToggled(_:)), for: UIControl.Event.valueChanged)
return cell
case .podcastsChosen:
let cell = tableView.dequeueReusableCell(withIdentifier: disclosureCellId, for: indexPath) as! DisclosureCell
let podcastsSele... | What if we extend `AppBadge` outside its module to have an enum computed property `var description: String { ... }`? This will reduced by one line using it | return cell
case .podcastsChosen:
let cell = tableView.dequeueReusableCell(withIdentifier: disclosureCellId, for: indexPath) as! DisclosureCell
let podcastsSelected = DataManager.sharedManager.pushEnabledPodcastsCount()
let chosenPodcasts = podcastsSelected == 1 ?... | @@ -30,45 +71,73 @@ class NotificationsViewController: PCViewController, UITableViewDataSource, UITa
settingsTable.reloadData()
}
+ func numberOfSections(in tableView: UITableView) -> Int {
+ return FeatureFlag.notificationsRevamp.enabled ? 3 : 1
+ }
+
func tableView(_ tableView: UITab... | podcasts/NotificationsViewController.swift | 26 | Swift | 0.5 | question | 155 | 51 | 51 | false | [Notifications revamp] Feature flag and settings UI | 2,934 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | SergioEstevao |
enum referrals {
static let showTip = "referrals.showtip"
static let claimURL = "referrals.claimURL"
}
enum manageDownloads {
static let lastCheckDate = "manageDownloadsLastCheckDate"
}
enum podcastFeedReload {
static let showTip... | Small typo here
```suggestion
static let onboardingTips = "notifications.onboardingTips"
``` | }
enum referrals {
static let showTip = "referrals.showtip"
static let claimURL = "referrals.claimURL"
}
enum manageDownloads {
static let lastCheckDate = "manageDownloadsLastCheckDate"
}
enum podcastFeedReload {
static l... | @@ -223,6 +223,10 @@ struct Constants {
enum podcastViewChanges {
static let showTip = "podcastViewChanges.showtip"
}
+
+ enum notifications {
+ static let onboardingTips = "notifications.onboardindTips" | podcasts/Constants.swift | 26 | Swift | 0.714 | suggestion | 109 | 51 | 51 | false | [Notifications Revamp] - Onboarding notifications - Part I | 2,943 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | SergioEstevao |
return L10n.notificationsOnboardingFiltersTitle
case .onboardingUpsell:
return L10n.notificationsOnboardingUpsellTitle
}
}
var body: String {
switch self {
case .onboardingSignUp:
return L10n.notificationsOnboardingSignupBody
case .onb... | ⛏️ You can leave the return out here, if you'd like. | case .onboardingFilters:
return L10n.notificationsOnboardingFiltersTitle
case .onboardingUpsell:
return L10n.notificationsOnboardingUpsellTitle
}
}
var body: String {
switch self {
case .onboardingSignUp:
return L10n.notificationsOnboa... | @@ -0,0 +1,119 @@
+import Foundation
+
+enum NotificationType: String {
+
+ case onboardingSignUp
+ case onboardingImport
+ case onboardingThemes
+ case onboardingUpNext
+ case onboardingFilters
+ case onboardingUpsell
+
+ var title: String {
+ switch self {
+ case .onboardingSignUp:
... | podcasts/Notifications/NotificationsCoordinator.swift | 26 | Swift | 0.214 | suggestion | 52 | 51 | 51 | false | [Notifications Revamp] - Onboarding notifications - Part I | 2,943 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | SergioEstevao |
}
} else {
Analytics.track(.notificationsOptInDenied)
}
DispatchQueue.main.async {
completion?(granted)
}
})
Analytics.track(.notificationsOptInShown)
}
}
... | ⛏️ Just an extra line here
```suggestion
``` | }
} else {
Analytics.track(.notificationsOptInDenied)
}
DispatchQueue.main.async {
completion?(granted)
}
})
Analytics.track(.notificationsOptInShown)
}
}
... | @@ -90,6 +102,21 @@ class NotificationsHelper: NSObject, UNUserNotificationCenterDelegate {
// called when the user taps a notification action, or just the notification itself
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler c... | podcasts/NotificationsHelper.swift | 26 | Swift | 0.429 | suggestion | 48 | 51 | 51 | false | [Notifications Revamp] - Onboarding notifications - Part I | 2,943 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | SergioEstevao |
return L10n.notificationsDailyReminders
case .newFeaturesAndTips:
return L10n.notificationsNewFeaturesTips
case .pocketCastsOffers:
return L10n.notificationsPocketCastOffers
}
}
var value: Bool {
switch self... | I think collapsing the falses would make skimming a bit easier.
```suggestion
var value: Bool {
case .dailyReminders:
return Settings.notificationsOnboardingTips
case .newEpisodes,
.podcastsChosen,
.appBadges,
.trendingRec... | return L10n.notificationsDailyReminders
case .newFeaturesAndTips:
return L10n.notificationsNewFeaturesTips
case .pocketCastsOffers:
return L10n.notificationsPocketCastOffers
}
}
var value: Bool {
switch self... | @@ -47,6 +47,25 @@ class NotificationsViewController: PCViewController, UITableViewDataSource, UITa
return L10n.notificationsPocketCastOffers
}
}
+
+ var value: Bool {
+ switch self {
+ case .newEpisodes:
+ return false
+ case... | podcasts/NotificationsViewController.swift | 26 | Swift | 0.929 | suggestion | 467 | 51 | 51 | false | [Notifications Revamp] - Onboarding notifications - Part I | 2,943 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | SergioEstevao |
var identifier: String {
return self.rawValue
}
var link: String {
switch self {
case .onboardingSignUp:
return "pktc://signup"
case .onboardingImport:
return "pktc://settings/import"
case .onboardingThemes:
return "pktc://setting... | ⛏️ Can this be a `static let` instead of `static var`? | }
var identifier: String {
return self.rawValue
}
var link: String {
switch self {
case .onboardingSignUp:
return "pktc://signup"
case .onboardingImport:
return "pktc://settings/import"
case .onboardingThemes:
return "pktc://s... | @@ -0,0 +1,119 @@
+import Foundation
+
+enum NotificationType: String {
+
+ case onboardingSignUp
+ case onboardingImport
+ case onboardingThemes
+ case onboardingUpNext
+ case onboardingFilters
+ case onboardingUpsell
+
+ var title: String {
+ switch self {
+ case .onboardingSignUp:
... | podcasts/Notifications/NotificationsCoordinator.swift | 26 | Swift | 0.429 | question | 55 | 51 | 51 | false | [Notifications Revamp] - Onboarding notifications - Part I | 2,943 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | SergioEstevao |
func cancelOnboardingNotifications() {
Settings.notificationsOnboardingTips = false
let notificationCenter = UNUserNotificationCenter.current()
notificationCenter.removePendingNotificationRequests(withIdentifiers: onboardingNotifications.map { $0.identifier })
}
func scheduleNotifi... | Should this include a log just in case? | }
func cancelOnboardingNotifications() {
Settings.notificationsOnboardingTips = false
let notificationCenter = UNUserNotificationCenter.current()
notificationCenter.removePendingNotificationRequests(withIdentifiers: onboardingNotifications.map { $0.identifier })
}
func schedule... | @@ -0,0 +1,119 @@
+import Foundation
+
+enum NotificationType: String {
+
+ case onboardingSignUp
+ case onboardingImport
+ case onboardingThemes
+ case onboardingUpNext
+ case onboardingFilters
+ case onboardingUpsell
+
+ var title: String {
+ switch self {
+ case .onboardingSignUp:
... | podcasts/Notifications/NotificationsCoordinator.swift | 26 | Swift | 0.143 | question | 39 | 30 | 32 | false | [Notifications Revamp] - Onboarding notifications - Part I | 2,943 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | SergioEstevao |
import Foundation
extension NotificationsCoordinator: AnalyticsAdapter {
func track(name: String, properties: [AnyHashable: Any]?) {
for notification in onboardingNotifications {
if notification.checkCancelConditionsForEvent(name: name) {
self.cancelNotification(notification)
... | Could this be a set?
I'm also wondering if this can be a map `[NotificationType: Set< AnalyticsEvent >]` to avoid the switch? Wdyt? | import Foundation
extension NotificationsCoordinator: AnalyticsAdapter {
func track(name: String, properties: [AnyHashable: Any]?) {
for notification in onboardingNotifications {
if notification.checkCancelConditionsForEvent(name: name) {
self.cancelNotification(notification)
... | @@ -0,0 +1,37 @@
+import Foundation
+
+extension NotificationsCoordinator: AnalyticsAdapter {
+
+ func track(name: String, properties: [AnyHashable: Any]?) {
+ for notification in onboardingNotifications {
+ if notification.checkCancelConditionsForEvent(name: name) {
+ self.cancelNot... | podcasts/Notifications/NotificationsCoordinator+AnalyticsAdapter.swift | 18 | Swift | 0.714 | question | 134 | 38 | 39 | false | [Notifications Revamp] Onboarding notifications check task completion | 2,963 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | SergioEstevao |
#!/usr/bin/env bash
# This script generates the protobuffer Swift files required for the server module, based on the definitions in the API project
# It takes one parameter, the path to the folder inside the API project from which these files are generated
set -e
API_BASE_FOLDER=$1
if [[ -z $API_BASE_FOLDER ]];
then... | I don't use homebrew and this kept biting me, so I checked that homebrew exists before running these commands. | #!/usr/bin/env bash
# This script generates the protobuffer Swift files required for the server module, based on the definitions in the API project
# It takes one parameter, the path to the folder inside the API project from which these files are generated
set -e
API_BASE_FOLDER=$1
if [[ -z $API_BASE_FOLDER ]];
then... | @@ -13,8 +13,12 @@ then
exit 1
fi
-brew upgrade protobuf
-brew upgrade swift-protobuf
+if command -v brew &> /dev/null; then | scripts/update_proto.sh | 16 | Shell | 0.429 | suggestion | 110 | 21 | 25 | false | Up Next Emptying: Add device ID to up_next/sync call | 2,966 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | bjtitus |
let jsonFileLocation = "http://\(sharePath).json"
let listController = IncomingShareListViewController(jsonLocation: jsonFileLocation)
let navController = SJUIUtils.popupNavController(for: listController)
SceneHelper.rootViewController()?.present(navController, animated:... | Just double checking, are we sure this won't break any other deep link? | let jsonFileLocation = "http://\(sharePath).json"
let listController = IncomingShareListViewController(jsonLocation: jsonFileLocation)
let navController = SJUIUtils.popupNavController(for: listController)
SceneHelper.rootViewController()?.present(navController, animated:... | @@ -143,12 +143,16 @@ extension AppDelegate {
}
// Open to discover
- JLRoutes.global().addRoute("/discover") { paramDict -> Bool in
+ JLRoutes.global().addRoute("/discover/*") { paramDict -> Bool in | podcasts/AppDelegate+UrlHandling.swift | 26 | Swift | 0.214 | question | 71 | 51 | 51 | false | [Notifications Revamp] Onboarding staff picks | 2,984 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | SergioEstevao |
}
if let action = model.action {
Button() {
model.onActionTap?()
} label: {
Text(action)
.font(.caption.weight(.semibold))
.foregroundColor(them... | ```suggestion
.padding(.vertical, 20.0)
.padding(.leading, 16.0)
.padding(.trailing, model.onCloseTap != nil ? 56.0 : 16.0)
```
if the close button is present, we should probably add a trailing padding of 56 otherwise the `X` button will be too close to the text. The suggestion contains the... | }
if let message = model.message {
Text(message)
.font(.caption2.weight(.semibold))
.fixedSize(horizontal: false, vertical: true)
.multilineTextAlignment(.leading)
.foregro... | @@ -0,0 +1,113 @@
+import SwiftUI
+import PocketCastsUtils
+import Combine
+
+class BannerModel: ObservableObject {
+
+ let title: String?
+ let message: String?
+ let action: String?
+ let iconName: String?
+ let invertedColor: Bool
+ let onActionTap: (() -> ())?
+ let onCloseTap: (() -> ())?
+
+ ... | podcasts/Common SwiftUI/BannerView.swift | 26 | Swift | 0.857 | suggestion | 358 | 47 | 51 | false | [Notifications Revamp] Notification permissions settings | 2,996 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | SergioEstevao |
} label: {
Text(action)
.font(.caption.weight(.semibold))
.foregroundColor(theme.primaryInteractive01)
}
}
}
Spacer()
}
.overlay(alignment: .top... | ```suggestion
.padding(.bottom, model.edge.bottom)
.padding(.top, model.edge.top)
.padding(.leading, model.edge.leading)
.padding(.trailing, model.edge.trailing)
```
Can we inject and `EdgeInsets` into the model? In the account creation I need to adjust the top/bottom values based ... | .fixedSize(horizontal: false, vertical: true)
.multilineTextAlignment(.leading)
.foregroundColor(theme.primaryText02)
}
if let action = model.action {
Button() {
model.onAc... | @@ -0,0 +1,113 @@
+import SwiftUI
+import PocketCastsUtils
+import Combine
+
+class BannerModel: ObservableObject {
+
+ let title: String?
+ let message: String?
+ let action: String?
+ let iconName: String?
+ let invertedColor: Bool
+ let onActionTap: (() -> ())?
+ let onCloseTap: (() -> ())?
+
+ ... | podcasts/Common SwiftUI/BannerView.swift | 26 | Swift | 0.929 | suggestion | 334 | 43 | 51 | false | [Notifications Revamp] Notification permissions settings | 2,996 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | SergioEstevao |
addChild(searchController)
view.addSubview(searchController.view)
searchController.didMove(toParent: self)
let topAnchor = searchController.view.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: -PCSearchBarController.defaultHeight)
NSLayoutConstraint.a... | Would it make sense to keep `sortOption` immutable and set `homeFolderSortOrder` in the `else` block, just so that there's no confusion about it mutating further down?
```suggestion
let sortOption: LibrarySort
if !FeatureFlag.podcastsSortChanges.enabled && Settings.homeFolderSortOrder() == .recentl... | addChild(searchController)
view.addSubview(searchController.view)
searchController.didMove(toParent: self)
let topAnchor = searchController.view.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: -PCSearchBarController.defaultHeight)
NSLayoutConstraint.a... | @@ -46,7 +46,11 @@ extension PodcastListViewController: UIScrollViewDelegate, PCSearchBarDelegate {
func showSortOrderOptions() {
let options = OptionsPicker(title: L10n.sortBy.localizedUppercase)
- let sortOption = Settings.homeFolderSortOrder()
+ var sortOption = Settings.homeFolderSortO... | podcasts/PodcastListViewController+Search.swift | 26 | Swift | 1 | question | 549 | 51 | 51 | false | [Improve Podcast Sorting] Add new sort option | 2,998 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | danielebogo |
private static let watchLogFileName = "watch-logs.txt"
/// Requests the Apple Watch log contents.
/// If anything is returned, it is also saved in a cache so in case any
/// subsequent call fails, it will return from the cache.
func requestLogFile(completion: @escaping (String?) -> Void) {
... | Keep a local copy in case self has been deallocated. It shouldn't be changing in the interim anyway and its a cached copy so isn't expected to be the most up to date. | private static let watchLogFileName = "watch-logs.txt"
/// Requests the Apple Watch log contents.
/// If anything is returned, it is also saved in a cache so in case any
/// subsequent call fails, it will return from the cache.
func requestLogFile(completion: @escaping (String?) -> Void) {
... | @@ -23,14 +23,17 @@ extension WatchManager {
return
}
+ // Hold a local reference so we don't potentially run into a deallocated `self` when the below blocks are run.
+ let cachedLog = self.cachedLog
+
// since we don't know how long it takes for a send message to timeout,... | podcasts/WatchManager+Send.swift | 26 | Swift | 0.429 | performance | 166 | 51 | 51 | false | Watch Log crash fix | 3,005 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | bjtitus |
@objc private func upNextChanged() {
sendStateToWatchInBackground()
}
@objc private func playbackStateChanged() {
sendStateToWatchInBackground()
}
@objc private func episodeStarredChanged(_ notification: Notification) {
guard let uuid = notification.object as? String, Playb... | This was the main cause of the crash. `sendStateToWatch` was already effectively checking the optional value but the lower value was not and I think this caused a crash while `WatchManager` is being deallocated. | @objc private func upNextChanged() {
sendStateToWatchInBackground()
}
@objc private func playbackStateChanged() {
sendStateToWatchInBackground()
}
@objc private func episodeStarredChanged(_ notification: Notification) {
guard let uuid = notification.object as? String, Playb... | @@ -399,10 +399,11 @@ class WatchManager: NSObject, WCSessionDelegate {
return
}
DispatchQueue.global(qos: .background).async { [weak self] in
- self?.sendStateToWatch()
+ guard let self else { return } | podcasts/WatchManager.swift | 26 | Swift | 0.643 | bug | 211 | 51 | 51 | false | Watch Log crash fix | 3,005 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | bjtitus |
return "pktc://settings/import"
case .onboardingThemes:
return "pktc://settings/themes"
case .onboardingUpNext:
return "pktc://upnext/?location=tab"
case .onboardingFilters:
return "pktc://filters"
case .onboardingUpsell:
return... | ⛏️ Can the Constants be private?
```suggestion
private enum Constants {
``` | return "pktc://settings/import"
case .onboardingThemes:
return "pktc://settings/themes"
case .onboardingUpNext:
return "pktc://upnext/?location=tab"
case .onboardingFilters:
return "pktc://filters"
case .onboardingUpsell:
return... | @@ -77,7 +85,14 @@ class NotificationsCoordinator {
static let shared: NotificationsCoordinator = NotificationsCoordinator()
- var timeIntervalStep: TimeInterval = 24.hours
+ var onboardingTimeIntervalStep: TimeInterval = 24.hours
+ var reEngagementTimeIntervalStep: TimeInterval = 1.week
+ var igno... | podcasts/Notifications/NotificationsCoordinator.swift | 26 | Swift | 0.571 | suggestion | 85 | 51 | 51 | false | [Notifications Revamp] ReEngagement notifications | 3,006 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | SergioEstevao |
import XCTest
@testable import PocketCastsDataModel
import FMDB
@testable import podcasts
class DBTestCase: XCTestCase {
var dataManager: DataManager!
var downloadManager: DownloadManager!
var podcast: Podcast!
var episode: Episode!
override func setUp() async throws {
try await super.setU... | @bjtitus I think you originally worked on these tests, so I just want to provide some more information that wouldn't be possible in this comment.
**What was happening?**
`PodcastManagerTests.testTaskCancellationForUnusednDeletion` was failing.
**Why?**
We are actually creating download tasks when doing thos... | import XCTest
@testable import PocketCastsDataModel
import FMDB
@testable import podcasts
class DBTestCase: XCTestCase {
// We use a single DataManager instance for tests based on DBTestCase,
// since some tests interact with the download logic.
// Creating multiple DataManager instances cause the app dele... | @@ -4,7 +4,15 @@ import FMDB
@testable import podcasts
class DBTestCase: XCTestCase {
- var dataManager: DataManager!
+ // We use a single DataManager instance for tests based on DBTestCase,
+ // since some tests interact with the download logic.
+ // Creating multiple DataManager instances cause the ap... | PocketCastsTests/Helpers/DBTestCase.swift | 12 | Swift | 1 | bug | 2,235 | 37 | 37 | false | GRDB: enable for `DEBUG` environment | 3,009 | Automattic/pocket-casts-ios | 1,136 | Swift | leandroalonso | leandroalonso |
}
public func discoverItem<T>(_ source: String?, authenticated: Bool, type: T.Type) -> AnyPublisher<T, Error> where T: Decodable {
guard let source = source else {
return Fail(error: DiscoverServerError.badRequest).eraseToAnyPublisher()
}
return Future { [unowned self] prom... | Nit: instead of checking against the optional `authenticated` I'm wondering if `DiscoverItem` can have a computed property `isAuthenticated` that unwraps it or fallback to false | }
public func discoverItem<T>(_ source: String?, authenticated: Bool, type: T.Type) -> AnyPublisher<T, Error> where T: Decodable {
guard let source = source else {
return Fail(error: DiscoverServerError.badRequest).eraseToAnyPublisher()
}
return Future { [unowned self] prom... | @@ -101,55 +106,101 @@ public class DiscoverServerHandler {
.eraseToAnyPublisher()
}
- private let tokenHelper = {
- let connection = URLConnection(handler: URLSession.shared)
- return TokenHelper(urlConnection: connection)
- }()
+ /// A method to check whether the response from t... | Modules/Server/Sources/PocketCastsServer/Public/Discover/DiscoverServerHandler.swift | 26 | Swift | 0.571 | security | 177 | 51 | 51 | false | [Recommendations] Authentication failure handling | 3,022 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | bjtitus |
else {
return
}
if let vc = showRecentlyPlayedSortingTip() {
present(vc, animated: true) {
Analytics.track(.episodeRecentlyPlayedSortOptionTooltipShown)
}
recentlyPlayedSortingTip = vc
}
}
private func showRecentlyP... | Would it make sense to construct the `TipView` first so the UIHostingController `rootView` can just be set once?
```suggestion
let idealSize = CGSize(290, 100)
let tipView = TipViewStatic(title: L10n.podcastsLibrarySortEpisodeRecentlyPlayedTipTitle,
message: L10... | else {
return
}
if let vc = showRecentlyPlayedSortingTip() {
present(vc, animated: true) {
Analytics.track(.episodeRecentlyPlayedSortOptionTooltipShown)
}
recentlyPlayedSortingTip = vc
}
}
private func showRecentlyP... | @@ -0,0 +1,78 @@
+import SwiftUI
+import PocketCastsUtils
+
+extension PodcastListViewController: UIPopoverPresentationControllerDelegate {
+ func showRecentlyPlayedSortingTipIfNeeded() {
+ guard
+ Settings.shouldShowRecentlyPlayedSortingTip,
+ FeatureFlag.podcastsSortChanges.enabled,
+ ... | podcasts/PodcastListViewController+Tip.swift | 26 | Swift | 0.929 | question | 733 | 51 | 51 | false | [Improve podcast Sorting] Add tooltip and Analytics | 3,024 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | danielebogo |
import SwiftUI
import PocketCastsUtils
extension PodcastListViewController: UIPopoverPresentationControllerDelegate {
func showRecentlyPlayedSortingTipIfNeeded() {
guard
Settings.shouldShowRecentlyPlayedSortingTip,
FeatureFlag.podcastsSortChanges.enabled,
recentlyPlayedS... | ⛏️ Could use the swiftier `CGSize` here:
```suggestion
let idealSize = CGSize(290, 100)
``` | import SwiftUI
import PocketCastsUtils
extension PodcastListViewController: UIPopoverPresentationControllerDelegate {
func showRecentlyPlayedSortingTipIfNeeded() {
guard
Settings.shouldShowRecentlyPlayedSortingTip,
FeatureFlag.podcastsSortChanges.enabled,
recentlyPlayedS... | @@ -0,0 +1,78 @@
+import SwiftUI
+import PocketCastsUtils
+
+extension PodcastListViewController: UIPopoverPresentationControllerDelegate {
+ func showRecentlyPlayedSortingTipIfNeeded() {
+ guard
+ Settings.shouldShowRecentlyPlayedSortingTip,
+ FeatureFlag.podcastsSortChanges.enabled,
+ ... | podcasts/PodcastListViewController+Tip.swift | 26 | Swift | 0.786 | suggestion | 102 | 51 | 51 | false | [Improve podcast Sorting] Add tooltip and Analytics | 3,024 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | danielebogo |
.frame(idealWidth: idealSize.width, minHeight: idealSize.height)
.setupDefaultEnvironment()
vc.rootView = AnyView(tipView)
vc.view.backgroundColor = .clear
vc.view.clipsToBounds = false
vc.modalPresentationStyle = .popover
if #available(iOS 16.0, *) {
... | Is there any reason why `Settings.shouldShowRecentlyPlayedSortingTip` would be `false` but `TipView` would have been presented? Would it make sense to just skip this check in case the logic for showing the tooltip changes? | .setupDefaultEnvironment()
let vc = UIHostingController(rootView: tipView)
vc.view.backgroundColor = .clear
vc.view.clipsToBounds = false
vc.modalPresentationStyle = .popover
if #available(iOS 16.0, *) {
vc.sizingOptions = [.preferredContentSize]
}... | @@ -0,0 +1,78 @@
+import SwiftUI
+import PocketCastsUtils
+
+extension PodcastListViewController: UIPopoverPresentationControllerDelegate {
+ func showRecentlyPlayedSortingTipIfNeeded() {
+ guard
+ Settings.shouldShowRecentlyPlayedSortingTip,
+ FeatureFlag.podcastsSortChanges.enabled,
+ ... | podcasts/PodcastListViewController+Tip.swift | 26 | Swift | 0.643 | question | 222 | 47 | 41 | false | [Improve podcast Sorting] Add tooltip and Analytics | 3,024 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | danielebogo |
func toggleExtras(hidden: Bool) {
topLabel.isHidden = hidden
imageView.isHidden = hidden
}
override init(frame: CGRect) {
super.init(frame: frame)
setup()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
setup()
}
private func se... | I think this constraint is generating warnings:
```
Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwa... |
func toggleExtras(hidden: Bool) {
topLabel.isHidden = hidden
imageView.isHidden = hidden
}
override init(frame: CGRect) {
super.init(frame: frame)
setup()
}
required init?(coder: NSCoder) {
super.init(coder: coder)
setup()
}
private func se... | @@ -0,0 +1,94 @@
+import PocketCastsDataModel
+
+class LargeListSummaryCellHeaderView: UIView {
+ private let horizontalStack: UIStackView = {
+ let stack = UIStackView()
+ stack.axis = .horizontal
+ stack.spacing = 12
+ stack.alignment = .center
+ return stack
+ }()
+
+ priv... | podcasts/LargeListSummaryCellHeaderView.swift | 26 | Swift | 0.929 | suggestion | 3,222 | 37 | 42 | false | Recommendations: Discover "Large list with podcast" display style | 3,027 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | bjtitus |
import FMDB
import Foundation
import PocketCastsUtils
class DatabaseHelper {
class func setup(queue: PCDBQueue) {
var startingSchemaVersion: Int32 = 0
queue.inDatabase { db in
do {
try db.executeQuery("PRAGMA busy_timeout = 10000", values: nil).close()
... | This call was split in two in one of the GRDB PRs as [explained here](https://github.com/Automattic/pocket-casts-ios/pull/2820/files#r1985476408).
This method is back to being a single block, which is what it should be. I had to add a method so that the crash that was happening before doesn't happen anymore.
With... | import FMDB
import Foundation
import PocketCastsUtils
class DatabaseHelper {
class func setup(queue: PCDBQueue) {
queue.write { db in
do {
try db.executeQuery("PRAGMA busy_timeout = 10000", values: nil).close()
let startingSchemaVersion = db.pragmaUserVersion() ... | @@ -4,22 +4,12 @@ import PocketCastsUtils
class DatabaseHelper {
class func setup(queue: PCDBQueue) {
- var startingSchemaVersion: Int32 = 0
-
- queue.inDatabase { db in
+ queue.write { db in | Modules/DataModel/Sources/PocketCastsDataModel/Private/Managers/Util/DatabaseHelper.swift | 7 | Swift | 0.643 | bug | 395 | 32 | 32 | false | GRDB: add `write` and `read` methods | 3,040 | Automattic/pocket-casts-ios | 1,136 | Swift | leandroalonso | leandroalonso |
extension NotificationType {
func checkCancelConditionsForEvent(name: String, properties: [AnyHashable: Any]?) -> Bool {
var possibleConditions: Set<AnalyticsEvent>
switch self {
case .reengagementWeekly:
possibleConditions = [.applicationOpened]
case .onboardingSignUp:... | ⛏️ Single extra space here.
```suggestion
possibleConditions = [.purchaseSuccessful]
``` | extension NotificationType {
func checkCancelConditionsForEvent(name: String, properties: [AnyHashable: Any]?) -> Bool {
var possibleConditions: Set<AnalyticsEvent>
switch self {
case .reengagementWeekly:
possibleConditions = [.applicationOpened]
case .onboardingSignUp:... | @@ -58,6 +58,8 @@ extension NotificationType {
possibleConditions = [.discoverListShowAllTapped]
case .recommendationsTrending:
possibleConditions = [.discoverListShowAllTapped]
+ case .upsell:
+ possibleConditions = [.purchaseSuccessful] | podcasts/Notifications/NotificationsCoordinator+AnalyticsAdapter.swift | 26 | Swift | 0.714 | suggestion | 105 | 51 | 51 | false | [Notifications revamps] Offers notifications | 3,051 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | SergioEstevao |
import SwiftUI
import SafariServices
struct PodrollInformationModalView: View {
@EnvironmentObject var theme: Theme
var onDismiss: () -> Void
let learnMoreURL: String = "https://support.pocketcasts.com/knowledge-base/podroll/"
var body: some View {
VStack(spacing: 0) {
ModalTopPil... | Do we want to add this to `ServerConstants.Urls` ? | import SwiftUI
import PocketCastsServer
import SafariServices
struct PodrollInformationModalView: View {
@EnvironmentObject var theme: Theme
var onDismiss: () -> Void
let learnMoreURL: String = ServerConstants.Urls.podrollLearnMore
var body: some View {
VStack(spacing: 0) {
ModalT... | @@ -0,0 +1,48 @@
+import SwiftUI
+import SafariServices
+
+struct PodrollInformationModalView: View {
+ @EnvironmentObject var theme: Theme
+ var onDismiss: () -> Void
+
+ let learnMoreURL: String = "https://support.pocketcasts.com/knowledge-base/podroll/" | podcasts/CreatorPickModalView.swift | 8 | Swift | 0.357 | question | 50 | 33 | 33 | false | Recommendations: Add information modal for Podroll | 3,070 | Automattic/pocket-casts-ios | 1,136 | Swift | SergioEstevao | bjtitus |
let podcastUuid = podcastJson["uuid"] as? String,
let episodesJson = podcastJson["episodes"] as? [[String: Any]],
let podcast = DataManager.sharedManager.findPodcast(uuid: podcastUuid, includeUnsubscribed: true),
let firstEpisode = episodesJson.first,
... | Also changed this, the leading `/` isn't needed. | let podcastUuid = podcastJson["uuid"] as? String,
let episodesJson = podcastJson["episodes"] as? [[String: Any]],
let podcast = DataManager.sharedManager.findPodcast(uuid: podcastUuid, includeUnsubscribed: true),
let firstEpisode = episodesJson.first,
... | @@ -240,15 +240,22 @@ public class ServerPodcastManager: NSObject {
return episode
}
- public func loadRecommendations(for podcastUUID: String) async throws -> PodcastCollection? {
+ public func loadRecommendations(for podcastUUID: String, in region: String?) async throws -> PodcastCollection? {
... | Modules/Server/Sources/PocketCastsServer/Public/ServerPodcastManager.swift | 26 | Swift | 0.286 | suggestion | 48 | 51 | 51 | false | Recommendations: Add country code for recommendations endpoint | 3,085 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | bjtitus |
}
// Variable to be used only in debugging/testing to accelarate notifications schedule
static var speedUpNotifications: Bool = false
var timeIntervalStep: TimeInterval {
switch self {
case .newEpisodes:
return 0
case .dailyReminders:
ret... | I believe you can avoid the optional here:
```suggestion
let todayWeekday = Calendar.current.component(.weekday, from: Date.now)
``` | }
// Variable to be used only in debugging/testing to accelarate notifications schedule
static var speedUpNotifications: Bool = false
var timeIntervalStep: TimeInterval {
switch self {
case .newEpisodes:
return 0
case .dailyReminders:
ret... | @@ -234,18 +234,62 @@ enum NotificationsGroup: CaseIterable {
}
}
+ func trigger(order: Int, notification: NotificationType) -> UNNotificationTrigger? {
+ if Self.speedUpNotifications {
+ return UNTimeIntervalNotificationTrigger(timeInterval: Double(order + 1) * timeIntervalStep, re... | podcasts/Notifications/NotificationsCoordinator.swift | 26 | Swift | 0.786 | suggestion | 145 | 51 | 51 | false | Notifications trigger dates updates | 3,090 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | SergioEstevao |
let todayWeekday: Int = todayComponents.weekday ?? 1
let maxWeekDays: Int = Calendar.current.weekdaySymbols.count
var triggerWeekDay = todayWeekday
switch self {
case .newEpisodes:
return nil
case .dailyReminders:
let timeIntervalTo... | Can we use Calendar's calculations for this?
Something like:
```suggestion
case .recommendations:
return makeTrigger(
daysFromNow: (order + 1) * 3,
calendar: calendar,
repeats: notification.isRepeatable
)... | let maxWeekDays: Int = calendar.weekdaySymbols.count
switch self {
case .newEpisodes:
return nil
case .dailyReminders:
let timeIntervalToSchedule: TimeInterval = calculateTimeIntervalToHour(scheduleHour)
return UNTimeIntervalNotific... | @@ -234,18 +234,62 @@ enum NotificationsGroup: CaseIterable {
}
}
+ func trigger(order: Int, notification: NotificationType) -> UNNotificationTrigger? {
+ if Self.speedUpNotifications {
+ return UNTimeIntervalNotificationTrigger(timeInterval: Double(order + 1) * timeIntervalStep, re... | podcasts/Notifications/NotificationsCoordinator.swift | 26 | Swift | 0.857 | question | 1,322 | 51 | 51 | false | Notifications trigger dates updates | 3,090 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | SergioEstevao |
case .newFeaturesAndTips:
Settings.notificationsNewFeaturesAndTips = newValue
case .offers:
Settings.notificationsOffers = newValue
}
}
// Variable to be used only in debugging/testing to accelarate notifications schedule
static var speedUpNot... | I'm not 100% sure on the dates returned here and I wonder if we might add some tests just to verify. | case .newFeaturesAndTips:
Settings.notificationsNewFeaturesAndTips = newValue
case .offers:
Settings.notificationsOffers = newValue
}
}
// Variable to be used only in debugging/testing to accelarate notifications schedule
static var speedUpNot... | @@ -234,18 +234,62 @@ enum NotificationsGroup: CaseIterable {
}
}
+ func trigger(order: Int, notification: NotificationType) -> UNNotificationTrigger? { | podcasts/Notifications/NotificationsCoordinator.swift | 26 | Swift | 0.357 | suggestion | 100 | 51 | 51 | false | Notifications trigger dates updates | 3,090 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | SergioEstevao |
if success, let podcast = DataManager.sharedManager.findPodcast(uuid: podcastUuid, includeUnsubscribed: true) {
DispatchQueue.main.async {
completion(podcast)
}
} else {
DispatchQueue.main.async {
state = .fa... | Change this timeInterval to a something like 10.seconds to see the notification quickly | if success, let podcast = DataManager.sharedManager.findPodcast(uuid: podcastUuid, includeUnsubscribed: true) {
DispatchQueue.main.async {
completion(podcast)
}
} else {
DispatchQueue.main.async {
state = .fa... | @@ -155,6 +157,28 @@ struct NowPlayingView: View {
}
})
}
+
+ private func scheduleNotification() {
+ let notificationCenter = UNUserNotificationCenter.current()
+ Task {
+ do {
+ let granted = try await notificationCenter.requestAuthorization(option... | Pocket Casts App Clip/NowPlayingView.swift | 26 | Swift | 0.286 | suggestion | 87 | 39 | 39 | false | App clip reminder notification | 3,095 | Automattic/pocket-casts-ios | 1,136 | Swift | SergioEstevao | SergioEstevao |
class AppClipAppDelegate: NSObject, UIApplicationDelegate, ObservableObject {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
// This is where we register this device to recieve push notifications from Appl... | Can we move this to the enum above? | static let appAppStoreURL = "itms-apps://itunes.apple.com/app/apple-store/id414834813?mt=8"
}
class AppClipAppDelegate: NSObject, UIApplicationDelegate, ObservableObject {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) ... | @@ -0,0 +1,43 @@
+import Foundation
+import SwiftUI
+import UserNotifications
+
+enum AppClipNotification {
+ static let appStoreNotificationID = "au.com.shiftyjelly.podcasts.prototype.Clip.reminder"
+}
+
+class AppClipAppDelegate: NSObject, UIApplicationDelegate, ObservableObject {
+
+ func application(_ applica... | Pocket Casts App Clip/AppClipAppDelegate.swift | 26 | Swift | 0.143 | refactor | 35 | 37 | 39 | false | App clip reminder notification | 3,095 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | SergioEstevao |
}
var sectionCount = 1 // Always show header section
if (recommendations?.podroll?.count ?? 0) > 0 {
sectionCount += 1 // Add podroll section if it has content
}
if (recommendations?.podcasts?.count ?? 0) > 0 {
sectionCount += ... | can these be grouped?
```
case .header, .loading, .empty: return 1
...
``` | }
var sectionCount = 1 // Always show header section
if (recommendations?.podroll?.count ?? 0) > 0 {
sectionCount += 1 // Add podroll section if it has content
}
if (recommendations?.podcasts?.count ?? 0) > 0 {
sectionCount += ... | @@ -102,6 +121,10 @@ extension PodcastViewController: UITableViewDataSource, UITableViewDelegate {
switch youMightLikeSectionType(for: section) {
case .header:
return 1
+ case .loading: | podcasts/PodcastViewController+TableData.swift | 26 | Swift | 0.571 | suggestion | 78 | 51 | 51 | false | Recommendations: Add failed loading + retry to "You might like" | 3,097 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | bjtitus |
if let category = data[NavigationManager.discoverCategoryKey] as? String {
mainController?.navigateToDiscover(category: category, animated: animated)
return
}
if let listId = data[NavigationManager.discoverListKey] as? String {
mainController?.navigateToDisc... | can we have the "downloads" string as static let like `profileRowKey`? | }
if let category = data[NavigationManager.discoverCategoryKey] as? String {
mainController?.navigateToDiscover(category: category, animated: animated)
return
}
if let listId = data[NavigationManager.discoverListKey] as? String {
mainController?.navi... | @@ -272,6 +273,15 @@ class NavigationManager {
}
}
+ func navigateToProfile(data: NSDictionary?, animated: Bool) {
+ guard let row = data?[NavigationManager.profileRowKey] as? String else {
+ return
+ }
+ if row == "downloads" { | podcasts/NavigationManager.swift | 26 | Swift | 0.357 | question | 70 | 46 | 47 | false | Add reengagement downloads notification | 3,099 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | SergioEstevao |
NavigationManager.sharedManager.navigateTo(NavigationManager.filterPageKey)
return true
}
JLRoutes.global().addRoute("/upsell") {[weak self] parameters -> Bool in
guard self != nil else { return false }
NavigationManager.sharedManager.navigateTo(Navigatio... | There's a missing space between `{[` | NavigationManager.sharedManager.navigateTo(NavigationManager.filterPageKey)
return true
}
JLRoutes.global().addRoute("/upsell") {[weak self] parameters -> Bool in
guard self != nil else { return false }
NavigationManager.sharedManager.navigateTo(Navigatio... | @@ -444,6 +445,19 @@ extension AppDelegate {
}
}
+ func setupProfileRoutes() {
+ JLRoutes.global().addRoute("/profile/*") {[weak self] parameters -> Bool in | podcasts/AppDelegate+UrlHandling.swift | 26 | Swift | 0.214 | suggestion | 36 | 51 | 51 | false | Add reengagement downloads notification | 3,099 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | SergioEstevao |
#!/bin/bash -u
if .buildkite/commands/should-skip-job.sh --job-type build; then
exit 0
fi
"$(dirname "${BASH_SOURCE[0]}")/shared_setup.sh"
echo "--- Build & Test"
bundle exec fastlane test
| Same observations as https://github.com/Automattic/pocket-casts-android/pull/4002 | #!/bin/bash -u
if "$(dirname "${BASH_SOURCE[0]}")/should-skip-job.sh" --job-type build; then
exit 0
fi
"$(dirname "${BASH_SOURCE[0]}")/shared_setup.sh"
echo "--- Build & Test"
bundle exec fastlane test
| @@ -1,5 +1,9 @@
#!/bin/bash -u
+if .buildkite/commands/should-skip-job.sh --job-type build; then
+ exit 0
+fi | .buildkite/commands/build.sh | 5 | Shell | 0.357 | suggestion | 82 | 11 | 11 | false | [Tooling] Skip jobs if there are no relevant code changes | 3,126 | Automattic/pocket-casts-ios | 1,136 | Swift | mokagio | iangmaia |
"*.po"
"*.pot"
"*.txt"
".gitignore"
"config/Version.xcconfig"
"fastlane/**"
"Gemfile"
"Gemfile.lock"
)
LOCALIZATION_PATTERNS=(
"**/*.strings"
"**/*.stringsdict"
)
# Check if arguments are valid
if [ -z "${1:-}" ] || [ "$1" != "--job-type" ] || [ -z "${2:-}" ]; then
echo "Error: Must specify --jo... | After looking at the annotations in https://github.com/Automattic/pocket-casts-android/pull/4002 and here, I wonder if it might be best to use the past tense.
<img alt="image" src="https://github.com/user-attachments/assets/6ed4273e-314a-42e4-a861-d03164ca31d1" width=300/>
My reasoning is that "Skipping..." makes... | "*.po"
"*.pot"
"*.txt"
".gitignore"
"config/Version.xcconfig"
"fastlane/**"
"Gemfile"
"Gemfile.lock"
)
LOCALIZATION_PATTERNS=(
"**/*.strings"
"**/*.stringsdict"
)
# Define constants for job types
BUILD="build"
LOCALIZATION="localization"
# Check if arguments are valid
if [ -z "${1:-}" ] || [ "$1"... | @@ -0,0 +1,74 @@
+#!/bin/bash -eu
+
+# Usage: should-skip-job.sh --job-type [build|localization]
+# --job-type build: For jobs building an app binary, e.g. Build, Prototype Builds…
+# Skip when changes are limited to documentation, tooling, and non-code files
+# --job-type localization: For jobs that only need to r... | .buildkite/commands/should-skip-job.sh | 26 | Shell | 1 | suggestion | 519 | 51 | 51 | false | [Tooling] Skip jobs if there are no relevant code changes | 3,126 | Automattic/pocket-casts-ios | 1,136 | Swift | mokagio | iangmaia |
addCustomObserver(Constants.Notifications.episodeDownloadStatusChanged, selector: #selector(refreshEpisodesFromNotification(notification:)))
addCustomObserver(Constants.Notifications.episodeArchiveStatusChanged, selector: #selector(refreshEpisodesFromNotification(notification:)))
addCustomObserv... | Typo on the name should be: `Unavailable` | addCustomObserver(Constants.Notifications.episodeDownloadStatusChanged, selector: #selector(refreshEpisodesFromNotification(notification:)))
addCustomObserver(Constants.Notifications.episodeArchiveStatusChanged, selector: #selector(refreshEpisodesFromNotification(notification:)))
addCustomObserv... | @@ -183,6 +169,22 @@ class StarredViewController: PCViewController {
navigationItem.leftBarButtonItem = isMultiSelectEnabled ? UIBarButtonItem(title: L10n.selectAll, style: .done, target: self, action: #selector(selectAllTapped)) : nil
navigationItem.backBarButtonItem = isMultiSelectEnabled ? nil : UI... | podcasts/StarredViewController.swift | 26 | Swift | 0.286 | suggestion | 41 | 50 | 50 | false | [Empty State] ContentUnavailableConfiguration + HostingConfiguration backfill | 3,129 | Automattic/pocket-casts-ios | 1,136 | Swift | SergioEstevao | bjtitus |
import SwiftUI
/// Allows customization of the Toast message colors
protocol ToastTheme: ObservableObject {
var background: Color { get }
var title: Color { get }
var button: Color { get }
}
// MARK: - ToastPlayerTheme
/// A default theme for use in the full screen player
class ToastPlayerTheme: ThemeObs... | Great addition to the toast API! | import SwiftUI
/// Allows customization of the Toast message colors
protocol ToastTheme: ObservableObject {
var background: Color { get }
var title: Color { get }
var button: Color { get }
var iconColor: Color? { get }
var iconName: String? { get }
}
// MARK: - ToastPlayerTheme
/// A default them... | podcasts/Common SwiftUI/Toast/ToastTheme.swift | 1 | Swift | 0.071 | suggestion | 32 | 26 | 26 | false | [Winback] Survey API implementation | 3,142 | Automattic/pocket-casts-ios | 1,136 | Swift | SergioEstevao | danielebogo | |
.none
}
func tableView(_ tableView: UITableView, shouldIndentWhileEditingRowAt indexPath: IndexPath) -> Bool {
false
}
// MARK: - Swipe Actions
func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
tableData[indexPath.section] == .upNextSect... | Nitpick : could we move the 300 to a constant like before? | .none
}
func tableView(_ tableView: UITableView, shouldIndentWhileEditingRowAt indexPath: IndexPath) -> Bool {
false
}
// MARK: - Swipe Actions
func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
tableData[indexPath.section] == .upNextSect... | @@ -224,18 +236,17 @@ extension UpNextViewController: UITableViewDelegate, UITableViewDataSource {
// MARK: - Cell Heights
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
- rowHeightAt(indexPath: indexPath)
+ let section = tableData[indexPath.section]... | podcasts/UpNextViewController+Table.swift | 26 | Swift | 0.286 | question | 58 | 51 | 51 | false | [Empty States] Update Up Next empty state | 3,148 | Automattic/pocket-casts-ios | 1,136 | Swift | SergioEstevao | bjtitus |
return Calendar.current.date(byAdding: components, to: Date.now, wrappingComponents: true)
}
}
private extension IAPHelper {
func trackPaymentEvent(_ event: AnalyticsEvent, productId: IAPProductID, discount: String?, error: NSError? = nil) {
let product = getProduct(for: productId)
var... | @SergioEstevao wdyt about using constants for this? |
return Calendar.current.date(byAdding: components, to: Date.now, wrappingComponents: true)
}
}
private extension IAPHelper {
func trackPaymentEvent(_ event: AnalyticsEvent, productId: IAPProductID, discount: String?, error: NSError? = nil) {
let product = getProduct(for: productId)
var... | @@ -544,10 +556,21 @@ private extension IAPHelper {
offerType = "intro_offer"
}
}
+ if productId == .yearlyReferral {
+ offerType = "referral"
+ }
+ if let discount {
+ if discount.contains(".winback.") {
+ offerType = "win... | podcasts/IAPHelper.swift | 26 | Swift | 0.214 | question | 51 | 51 | 51 | false | Add frequency, tier, and promo details for IAP events | 3,152 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | SergioEstevao |
var transcriptsAvailable = metadata.transcripts
hasGeneratedTranscripts = metadata.hasGeneratedTranscripts
while let transcript = TranscriptFormat.bestTranscript(from: transcriptsAvailable) {
do {
let model = try await loadTranscript(transcript)
return... | Better trim the transcriptText and then check for empty to avoid the crash later on? | var transcriptsAvailable = metadata.transcripts
hasGeneratedTranscripts = metadata.hasGeneratedTranscripts
while let transcript = TranscriptFormat.bestTranscript(from: transcriptsAvailable) {
do {
let model = try await loadTranscript(transcript)
return... | @@ -73,7 +73,8 @@ class TranscriptManager {
guard
let transcriptURL = URL(string: transcript.url),
- let transcriptText = try? await dataRetriever.loadTranscript(url: transcriptURL)
+ let transcriptText = try? await dataRetriever.loadTranscript(url: transcriptURL),
+ ... | podcasts/TranscriptManager.swift | 26 | Swift | 0.286 | bug | 84 | 51 | 51 | false | [Hotfix] Prevent transcript crash | 3,191 | Automattic/pocket-casts-ios | 1,136 | Swift | SergioEstevao | danielebogo |
let model = try await loadTranscript(transcript)
return model
} catch TranscriptError.empty, TranscriptError.failedToParse {
transcriptsAvailable.removeAll { other in
other.transcriptFormat == transcript.transcriptFormat
}
... | what about adding this check inside the TranscriptModel.makeModel method a bit bellow?
Just thinking that this is more `failedToParse` error than a `failedToLoad` | let model = try await loadTranscript(transcript)
return model
} catch TranscriptError.empty, TranscriptError.failedToParse {
transcriptsAvailable.removeAll { other in
other.transcriptFormat == transcript.transcriptFormat
}
... | @@ -78,6 +78,11 @@ class TranscriptManager {
throw TranscriptError.failedToLoad
}
+ let trimmedTranscript = transcriptText.trimmingCharacters(in: .whitespacesAndNewlines) | podcasts/TranscriptManager.swift | 26 | Swift | 0.643 | bug | 165 | 51 | 47 | false | [Hotfix] Prevent transcript crash | 3,191 | Automattic/pocket-casts-ios | 1,136 | Swift | SergioEstevao | danielebogo |
import Foundation
import AutomatticRemoteLogging
class CrashLoggingAdapter: AnalyticsAdapter {
let crashLogging: CrashLogging?
init() {
self.crashLogging = try? CrashLogging(dataProvider: CrashLoggingDataProvider()).start()
}
func track(name: String, properties: [AnyHashable: Any]?) { }
}
| Not proud of that.
However, I don't want to refactor this as it would be it's own task and comes with another complexities.
Since this is mean to be temporary I believe it is a good trade-off for the time being. | import Foundation
import AutomatticRemoteLogging
class CrashLoggingAdapter: AnalyticsAdapter {
let crashLogging: CrashLogging?
static var sharedManager: CrashLoggingAdapter?
init() {
self.crashLogging = try? CrashLogging(dataProvider: CrashLoggingDataProvider()).start()
Self.sharedManager... | @@ -4,8 +4,11 @@ import AutomatticRemoteLogging
class CrashLoggingAdapter: AnalyticsAdapter {
let crashLogging: CrashLogging?
+ static var sharedManager: CrashLoggingAdapter? | podcasts/Analytics/Adapters/Crash Logging/CrashLoggingAdapter.swift | 7 | Swift | 0.5 | refactor | 217 | 13 | 16 | false | GRDB: remove `try!` and log errors in Sentry | 3,192 | Automattic/pocket-casts-ios | 1,136 | Swift | leandroalonso | leandroalonso |
import BackgroundTasks
import Firebase
import FirebasePerformance
import Foundation
import PocketCastsDataModel
import PocketCastsServer
import PocketCastsUtils
import Combine
import FacebookCore
class AppDelegate: UIResponder, UIApplicationDelegate {
private static let initialRefreshDelay = 2.seconds
private ... | Should we use `.warning`? Or something else? |
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWit... | @@ -419,3 +422,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
backgroundSignOutListener = BackgroundSignOutListener(presentingViewController: SceneHelper.rootViewController())
}
}
+
+struct SentryLogger: ErrorLogger {
+ func log(error: Error, context: [String: String]?) {
+ #if os(iO... | podcasts/AppDelegate.swift | 26 | Swift | 0.286 | question | 44 | 422 | 30 | false | GRDB: remove `try!` and log errors in Sentry | 3,192 | Automattic/pocket-casts-ios | 1,136 | Swift | leandroalonso | leandroalonso |
self.manager = TranscriptManager(episodeUUID: episodeUUID, podcastUUID: podcastUUID)
}
func loadTranscript() async {
if case .loading = loadingState { return }
Task { @MainActor [weak self] in
guard let self else { return }
loadingState = .loading
do ... | A guard statement looks better here | self.manager = TranscriptManager(episodeUUID: episodeUUID, podcastUUID: podcastUUID)
}
func loadTranscript() async {
if case .loading = loadingState { return }
Task { @MainActor [weak self] in
guard let self else { return }
loadingState = .loading
do ... | @@ -64,7 +64,7 @@ class TranscriptExcerptViewModel: ObservableObject, TranscriptExcerptViewModelin
}
func excerptTapped() {
- if case .loading = loadingState { return }
+ if loadingState != .success { return } | podcasts/TranscriptExcerptView.swift | 26 | Swift | 0.143 | suggestion | 35 | 51 | 51 | false | [Transcript in Episode View] Present Transcript view from Episode | 3,230 | Automattic/pocket-casts-ios | 1,136 | Swift | SergioEstevao | danielebogo |
return controller
}()
#endif
var lastShelfLoadState = ShelfLoadState()
private var bannerAdHostingController: PCHostingController<AnyView>?
private var bannerAdHeightConstraint: NSLayoutConstraint?
private let analyticsPlaybackHelper = AnalyticsPlaybackHelper.shared
override func... | Question: if the whole `adAdBanner` declaration and implementation is behind `if !APPCLIP`, will this make some errors? As the function won't exist for the Appclip (I guess) | return controller
}()
#endif
var lastShelfLoadState = ShelfLoadState()
private var bannerAdHostingController: PCHostingController<AnyView>?
private var bannerAdHeightConstraint: NSLayoutConstraint?
private let analyticsPlaybackHelper = AnalyticsPlaybackHelper.shared
override func... | @@ -198,9 +203,65 @@ class NowPlayingPlayerItemViewController: PlayerItemViewController {
chromecastBtn.isPointerInteractionEnabled = true
routePicker.delegate = self
+
+ if FeatureFlag.bannerAds.enabled { | podcasts/NowPlayingPlayerItemViewController.swift | 26 | Swift | 0.643 | suggestion | 173 | 51 | 51 | false | [Banner Ads] Player view | 3,233 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | bjtitus |
bannerAdHeightConstraint = heightConstraint
}
#endif
private func removeBannerAd() {
guard let hostingController = bannerAdHostingController else { return }
hostingController.willMove(toParent: nil)
hostingController.view.removeFromSuperview()
hostingController.removeFr... | Should this block be behind the `!APPCLIP` macro? | parent as? PlayerContainerViewController
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
// there's some expensive operations in resizeControls,
// so only do them if the bounds has actually changed
if lastBoundsAdjustedFor == view.bounds { retur... | @@ -198,9 +203,65 @@ class NowPlayingPlayerItemViewController: PlayerItemViewController {
chromecastBtn.isPointerInteractionEnabled = true
routePicker.delegate = self
+
+ if FeatureFlag.bannerAds.enabled {
+ addAdBanner()
+ }
#endif
}
+#if !APPCLIP
+ func ... | podcasts/NowPlayingPlayerItemViewController.swift | 26 | Swift | 0.286 | question | 50 | 51 | 51 | false | [Banner Ads] Player view | 3,233 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | bjtitus |
var analyticsSource: AnalyticsSource {
.player
}
var displayTranscript = false {
didSet {
#if !APPCLIP
toggleTranscript()
#endif
}
}
private var playerContainer: PlayerContainerViewController? {
parent as? PlayerContainerViewController
}
overrid... | Same here like my question above | #if !APPCLIP
if FeatureFlag.bannerAds.enabled {
removeBannerAd()
}
#endif
}
override func themeDidChange() {
lastShelfLoadState = ShelfLoadState()
update()
}
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?... | @@ -239,6 +300,7 @@ class NowPlayingPlayerItemViewController: PlayerItemViewController {
lastBoundsAdjustedFor = view.bounds
resizeControls()
+ updateBannerAdHeight() | podcasts/NowPlayingPlayerItemViewController.swift | 26 | Swift | 0.071 | suggestion | 32 | 51 | 51 | false | [Banner Ads] Player view | 3,233 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | bjtitus |
if lastBoundsAdjustedFor == view.bounds { return }
lastBoundsAdjustedFor = view.bounds
resizeControls()
updateBannerAdHeight()
}
private func resizeControls() {
let screenHeight = view.bounds.height
let spacing: CGFloat = screenHeight > 600 ? 30 : 20
if ... | Same here like my question above. Plus should this be behind `FeatureFlag.bannerAds.enabled`? | }
#endif
}
// MARK: - Interface Actions
@IBAction func skipBackTapped(_ sender: Any) {
analyticsPlaybackHelper.currentSource = analyticsSource
HapticsHelper.triggerSkipBackHaptic()
PlaybackManager.shared.skipBack()
}
@IBAction func playPauseTapped(_ sender:... | @@ -259,13 +321,23 @@ class NowPlayingPlayerItemViewController: PlayerItemViewController {
override func willBeRemovedFromPlayer() {
removeAllCustomObservers()
+ removeBannerAd() | podcasts/NowPlayingPlayerItemViewController.swift | 26 | Swift | 0.429 | question | 93 | 51 | 51 | false | [Banner Ads] Player view | 3,233 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | bjtitus |
if playPauseHeightConstraint.constant != height { playPauseHeightConstraint.constant = height }
view.layoutIfNeeded()
}
override func willBeAddedToPlayer() {
update()
addObservers()
}
override func willBeRemovedFromPlayer() {
removeAllCustomObservers()
... | Same here like my question above. Plus should this be behind `FeatureFlag.bannerAds.enabled`? | analyticsPlaybackHelper.currentSource = analyticsSource
HapticsHelper.triggerPlayPauseHaptic()
PlaybackManager.shared.playPause()
}
@IBAction func skipFwdTapped(_ sender: Any) {
analyticsPlaybackHelper.currentSource = analyticsSource
HapticsHelper.triggerSkipForwardHapti... | @@ -259,13 +321,23 @@ class NowPlayingPlayerItemViewController: PlayerItemViewController {
override func willBeRemovedFromPlayer() {
removeAllCustomObservers()
+ removeBannerAd()
}
override func themeDidChange() {
lastShelfLoadState = ShelfLoadState()
update()
}... | podcasts/NowPlayingPlayerItemViewController.swift | 26 | Swift | 0.429 | question | 93 | 51 | 51 | false | [Banner Ads] Player view | 3,233 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | bjtitus |
/// Recommendations including discover v3 support
case recommendations
/// Cancel Subscription Survey
case cancelSubscriptionSurvey
/// Ignore server IAP check
case newOfferEligibilityCheck
/// When replacing an episode list with a new one, use the provided episode instead of Up Next Que... | For test purposes, it's gonna be removed. |
/// Recommendations including discover v3 support
case recommendations
/// Cancel Subscription Survey
case cancelSubscriptionSurvey
/// Ignore server IAP check
case newOfferEligibilityCheck
/// When replacing an episode list with a new one, use the provided episode instead of Up Next Que... | @@ -197,6 +197,8 @@ public enum FeatureFlag: String, CaseIterable {
/// Improves configuration for the streaming requet download session
case streamingCustomSessionConfiguration
+ case testTestflight | Modules/Utils/Sources/PocketCastsUtils/Feature Flags/FeatureFlag.swift | 26 | Swift | 0.143 | suggestion | 41 | 51 | 51 | false | Firebase: inform whether is TestFlight or not | 3,249 | Automattic/pocket-casts-ios | 1,136 | Swift | leandroalonso | leandroalonso |
}
}
func updateRemoteFeatureFlags() {
guard BuildEnvironment.current != .debug else { return }
if FeatureFlag.errorLogoutHandling.enabled != Settings.errorLogoutHandling {
ServerConfig.avoidLogoutOnError = FeatureFlag.errorLogoutHandling.enabled
try? FeatureFlag... | For test purposes, is gonna be removed before merging the PR. | }
}
func updateRemoteFeatureFlags() {
guard BuildEnvironment.current != .debug else { return }
if FeatureFlag.errorLogoutHandling.enabled != Settings.errorLogoutHandling {
ServerConfig.avoidLogoutOnError = FeatureFlag.errorLogoutHandling.enabled
try? FeatureFlag... | @@ -334,6 +334,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
let remoteValue = RemoteConfig.remoteConfig().configValue(forKey: remoteKey)
if remoteValue.source == .remote {
do {
+ print("Overriding \(flag) to \(remoteValue.bool... | podcasts/AppDelegate.swift | 26 | Swift | 0.286 | suggestion | 61 | 51 | 51 | false | Firebase: inform whether is TestFlight or not | 3,249 | Automattic/pocket-casts-ios | 1,136 | Swift | leandroalonso | leandroalonso |
let confirmPicker = OptionsPicker(title: nil)
var warningMessage = downloadLimitExceeded ? L10n.bulkDownloadMax : ""
if NetworkUtils.shared.isConnectedToUnexpensiveConnection() {
if downloadableCount < 5 {
let status = L10n.multiSelectDownloadingEpisodesFormat(selec... | Maybe this could be done using a Markdown link instead of this? |
let confirmPicker = OptionsPicker(title: nil)
var warningMessage = downloadLimitExceeded ? L10n.bulkDownloadMax : ""
if NetworkUtils.shared.isConnectedToUnexpensiveConnection() {
if downloadableCount < 5 {
let status = L10n.multiSelectDownloadingEpisodesFormat(selec... | @@ -243,11 +243,15 @@ class MultiSelectHelper {
actionDelegate.multiSelectActionBegan(status: status)
queueEpisodes(downloadableEpisodes, actionDelegate: actionDelegate)
}
+ queueAction.outline = true
if !Settings.mobileDataAllowed() {
- ... | podcasts/MultiSelectHelper.swift | 26 | Swift | 0.286 | question | 63 | 51 | 51 | false | Enable 'Warn before using data' by default | 3,301 | Automattic/pocket-casts-ios | 1,136 | Swift | SergioEstevao | danielebogo |
if AppTrackingTransparencyController.shared.shouldShowPrompt() {
Task {
await AppTrackingTransparencyController.shared.promptConsentAlert()
}
}
if FeatureFlag.encourageAccountCreation.enabled,
!Settings.hasShownInformationalViewModal,
... | I think you need to add the following:
```
hostingController.view.backgroundColor = AppTheme.colorForStyle(.primaryUi01)
```
So that the hosting view does not have a white background that is very visible using dark themes and trying to scroll/move the bottom sheet |
if AppTrackingTransparencyController.shared.shouldShowPrompt() {
Task {
await AppTrackingTransparencyController.shared.promptConsentAlert()
}
}
if FeatureFlag.encourageAccountCreation.enabled,
!Settings.hasShownInformationalViewModal,
... | @@ -165,6 +166,35 @@ class MainTabBarController: UITabBarController, NavigationProtocol {
Settings.shouldShowInitialOnboardingFlow = false
}
+ func showUserSatisfactionSurvey() {
+ DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
+ let surveyView = UserSatisfactionSurveyView(... | podcasts/MainTabBarController.swift | 26 | Swift | 0.857 | style | 264 | 51 | 51 | false | [Improve App Rating] Add Survey Screen before rating alert | 3,324 | Automattic/pocket-casts-ios | 1,136 | Swift | SergioEstevao | bjtitus |
case .avoidReplaceOnEpisodeSwap:
true
case .podcastsSortChanges:
true
case .recommendations:
true
case .cancelSubscriptionSurvey:
true
case .newOfferEligibilityCheck:
true
case .replaceSpecificEpisode:
... | Is it ok to enable this here or was this just for testing? | case .avoidReplaceOnEpisodeSwap:
true
case .podcastsSortChanges:
true
case .recommendations:
true
case .cancelSubscriptionSurvey:
true
case .newOfferEligibilityCheck:
true
case .replaceSpecificEpisode:
... | @@ -359,7 +359,7 @@ public enum FeatureFlag: String, CaseIterable {
case .useDescriptiveActionAttributedTextView:
true
case .newOnboardingUpgrade:
- false
+ true | Modules/Utils/Sources/PocketCastsUtils/Feature Flags/FeatureFlag.swift | 26 | Swift | 0.214 | question | 58 | 51 | 51 | false | [New onboarding] Integration with onboarding flow | 3,328 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | SergioEstevao |
updateExtraActions()
refreshRemoteCommands()
}
@objc private func refreshRemoteCommands() {
let commandCenter = MPRemoteCommandCenter.shared()
commandCenter.changePlaybackPositionCommand.removeTarget(nil)
if !Settings.isLockScreenScrubbingDisabled { // Only perform the... | Just a small nit: Can we switch `Date()` to `Date.now` just find it a bit more explicit that is current date. | updateExtraActions()
refreshRemoteCommands()
}
@objc private func refreshRemoteCommands() {
let commandCenter = MPRemoteCommandCenter.shared()
commandCenter.changePlaybackPositionCommand.removeTarget(nil)
if !Settings.isLockScreenScrubbingDisabled { // Only perform the... | @@ -1731,7 +1735,17 @@ class PlaybackManager: ServerPlaybackDelegate {
if Settings.legacyBluetoothModeEnabled(), seekEvent.positionTime < 1 {
FileLog.shared.addMessage("Remote control: ignoring changePlaybackPositionCommand, it's to 0 and legacy bluetooth mode is on")
... | podcasts/PlaybackManager.swift | 26 | Swift | 0.5 | nitpick | 109 | 51 | 51 | false | Limit playback position changes when switching episodes | 3,383 | Automattic/pocket-casts-ios | 1,136 | Swift | SergioEstevao | bjtitus |
import PocketCastsDataModel
import SwiftUI
import PocketCastsUtils
extension UTType {
static var pcasts = UTType(filenameExtension: "pcasts", conformingTo: .package)!
}
struct PCBundleDoc: FileDocument {
static var readableContentTypes = [UTType.pcasts]
enum Constants {
static let databaseFilenam... | @bjtitus I think there are two things we need to take into account with GRDB: the `shm` and the `wal` files. Eg.:
<img width="174" height="69" alt="Image" src="https://github.com/user-attachments/assets/e7c8f302-587a-4c2a-8411-75288ea02a07" /> | import PocketCastsDataModel
import SwiftUI
import PocketCastsUtils
extension UTType {
static var pcasts = UTType(filenameExtension: "pcasts", conformingTo: .package)!
}
struct PCBundleDoc: FileDocument {
static var readableContentTypes = [UTType.pcasts]
enum Constants {
static let databaseFilenam... | @@ -10,7 +10,7 @@ struct PCBundleDoc: FileDocument {
static var readableContentTypes = [UTType.pcasts]
enum Constants {
- static let databaseFilename = "database.sqlite"
+ static let databaseFilename = "database.sqlite3" | podcasts/PCBundleDoc.swift | 13 | Swift | 0.643 | suggestion | 244 | 38 | 38 | false | Fix database export when using GRDB | 3,405 | Automattic/pocket-casts-ios | 1,136 | Swift | leandroalonso | bjtitus |
ApplicationDelegate.shared.application(
app,
open: url,
sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String,
annotation: options[UIApplication.OpenURLOptionsKey.annotation]
)
}
gu... | @bjtitus Would it make sense to include `let fileWrapper = try FileWrapper(url: url)` in `do { ... }` to catch also any possible error? | ApplicationDelegate.shared.application(
app,
open: url,
sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String,
annotation: options[UIApplication.OpenURLOptionsKey.annotation]
)
}
gu... | @@ -45,7 +45,11 @@ extension AppDelegate {
alert.addAction(UIAlertAction(title: "Import", style: .default) { _ in
Task {
let fileWrapper = try FileWrapper(url: url)
- try PCBundleDoc.performImport(from: fileWrapper)
+ ... | podcasts/AppDelegate+UrlHandling.swift | 26 | Swift | 0.643 | question | 135 | 51 | 51 | false | Fix database export when using GRDB | 3,405 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | bjtitus |
public enum CodingKeys: String, CodingKey {
case shortDescription = "description"
case iTunesId = "itunes"
case title, uuid, author, website
}
public func iTunesOnly() -> Bool {
uuid == nil && iTunesId != nil
}
}
public struct DiscoverCategory: Decodable, Equatable, S... | If ID is `nil` should we use `UUID().hashValue` or something here? |
public enum CodingKeys: String, CodingKey {
case shortDescription = "description"
case iTunesId = "itunes"
case title, uuid, author, website
}
public func iTunesOnly() -> Bool {
uuid == nil && iTunesId != nil
}
}
public struct DiscoverCategory: Decodable, Equatable, S... | @@ -429,6 +429,10 @@ public struct DiscoverCategory: Decodable, Equatable, Sendable {
self.id = id
self.name = name
}
+
+ public func hash(into hasher: inout Hasher) {
+ hasher.combine(id ?? -1) | Modules/Server/Sources/PocketCastsServer/Public/Sharing/Structs/ServerStructs.swift | 26 | Swift | 0.429 | question | 66 | 51 | 51 | false | [New onboarding] Interests UI | 3,431 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | SergioEstevao |
private func createAudioMix() {
guard audioMix == nil else { return }
let mutableMix = AVMutableAudioMix()
let audioMixInputParameters = AVMutableAudioMixInputParameters(track: assetTrack)
var clientInfo = UnsafeMutableRawPointer(Unmanaged.passUnretained(self).... | It would be great if you can develop and test with our current Xcode version and use the beta for testing purpose only, in order to avoid these errors and make sure everything works since we don't support iOS 26 and we don't compile PC with it. |
private func createAudioMix() {
guard audioMix == nil else { return }
let mutableMix = AVMutableAudioMix()
let audioMixInputParameters = AVMutableAudioMixInputParameters(track: assetTrack)
var clientInfo = UnsafeMutableRawPointer(Unmanaged.passUnretained(self).... | @@ -322,9 +322,9 @@ class DefaultPlayer: PlaybackProtocol, Hashable {
process: tapProcess
)
- var audioProcessingTap: Unmanaged<MTAudioProcessingTap>?
+ var audioProcessingTap: MTAudioProcessingTap?
if noErr == MTAudioProcessingTapCreate(kCFAllocatorDef... | podcasts/DefaultPlayer.swift | 26 | Swift | 0.643 | suggestion | 244 | 51 | 51 | false | [Banner Ads] Split feature flag for podcast & player | 3,448 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | bjtitus |
}
class func listImpression(listId: String, category: String?) {
var properties = ["list_id": listId]
if let category {
properties["category"] = category
}
Analytics.track(.discoverListImpression, properties: properties)
bumpStat("discover_list_impression", p... | @bjtitus I see the banner reported twice. Is it correct?
Example:
```
🔵 Tracked: banner_ad_report ["id": "7d972870-4509-013e-6964-3697f02c49bb", "promotion": "player"]
🔵 Tracked: banner_ad_report ["ad_id": "7d972870-4509-013e-6964-3697f02c49bb", "source": "player", "reason": "malicious"]
``` | }
class func listImpression(listId: String, category: String?) {
var properties = ["list_id": listId]
if let category {
properties["category"] = category
}
Analytics.track(.discoverListImpression, properties: properties)
bumpStat("discover_list_impression", p... | @@ -172,6 +172,16 @@ class AnalyticsHelper {
bumpStat("banner_ad_tapped", parameters: properties)
}
+ class func bannerReport(adID: String, reason: String, source: Any) {
+ let properties = ["id": adID, "promotion": source]
+ Analytics.track(.bannerAdReport, properties: properties) | podcasts/AnalyticsHelper.swift | 26 | Swift | 0.786 | suggestion | 297 | 51 | 51 | false | [Banner Ads] Report banner ad to Tracks AND Firebase | 3,455 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | bjtitus |
header
Spacer().frame(height: 40)
WrappingHStack(alignment: .center, horizontalSpacing: 8, verticalSpacing: 8, fitContentWidth: false) {
ForEach(viewModel.categories, id: \.self) { category in
... | @SergioEstevao when I tap a category to select it, the track event says `"is_selected": "false"`. When I deselect it, the event says `"is_selected": "true"`. Should be the opposite? | header
Spacer().frame(height: 40)
WrappingHStack(alignment: .center, horizontalSpacing: 8, verticalSpacing: 8, fitContentWidth: false) {
ForEach(viewModel.categories, id: \.self) { category in
... | @@ -147,6 +151,7 @@ struct InterestsView: View {
@ViewBuilder func categoryButton(for category: DiscoverCategory, index: Int) -> some View {
let isSelected = viewModel.isSelectedCategory(category)
InterestButton(name: category.name ?? "", icon: category.icon, isSelected: isSelected, style: Intere... | podcasts/Onboarding/InterestsView.swift | 26 | Swift | 0.571 | question | 181 | 51 | 51 | false | [New onboarding] Interests screen analytics | 3,462 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | SergioEstevao |
import PocketCastsDataModel
import PocketCastsUtils
import UIKit
class PlaylistSelectionViewController: PCViewController, UITableViewDelegate, UITableViewDataSource {
private static let filterAutoDownloadCell = "FilterDownloadCell"
var allPlaylists = [EpisodeFilter]()
var selectedPlaylists = [String]()
... | Should this be renamed to `playlistAutoDownloadCell` or just `autoDownloadCell`?
```suggestion
private static let playlistAutoDownloadCell = "PlaylistDownloadCell"
``` | import PocketCastsDataModel
import PocketCastsUtils
import UIKit
import SwiftUI
class PlaylistSelectionViewController: PCViewController, UITableViewDelegate, UITableViewDataSource {
private static let playlistAutoDownloadCell = "PlaylistAutoDownloadCell"
var allPlaylists = [EpisodeFilter]()
var selectedPl... | @@ -0,0 +1,116 @@
+import PocketCastsDataModel
+import PocketCastsUtils
+import UIKit
+
+class PlaylistSelectionViewController: PCViewController, UITableViewDelegate, UITableViewDataSource {
+ private static let filterAutoDownloadCell = "FilterDownloadCell" | podcasts/PlaylistSelectionViewController.swift | 6 | Swift | 0.786 | suggestion | 172 | 31 | 31 | false | [Playlists] Podcast and Autodownload settings | 3,485 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | danielebogo |
import SwiftUI
import PocketCastsDataModel
struct PlaylistCellView: View {
@EnvironmentObject var theme: Theme
@ObservedObject var viewModel: PlaylistCellViewModel
@State private var isOn: Bool
private let onToggleChange: ((Bool) -> Void)?
init(
viewModel: PlaylistCellViewModel,
s... | Would it make sense to combine these into a Binding?
The callsite (`PlaylistSelectionViewController`) would then need to define a binding like so:
```
let isOn = Binding<Bool>(
get: { [weak self] in
guard let self = self else { return false }
return self.selectedPlaylists.contains(playlist.u... | import SwiftUI
import PocketCastsDataModel
struct PlaylistCellView: View {
@EnvironmentObject var theme: Theme
@ObservedObject var viewModel: PlaylistCellViewModel
@Binding private var isSelected: Bool
init(
viewModel: PlaylistCellViewModel,
isSelected: Binding<Bool> = .constant(false... | @@ -5,6 +5,19 @@ struct PlaylistCellView: View {
@EnvironmentObject var theme: Theme
@ObservedObject var viewModel: PlaylistCellViewModel
+ @State private var isOn: Bool
+ private let onToggleChange: ((Bool) -> Void)? | podcasts/PlaylistCellView.swift | 9 | Swift | 0.857 | question | 605 | 34 | 34 | false | [Playlists] Podcast and Autodownload settings | 3,485 | Automattic/pocket-casts-ios | 1,136 | Swift | bjtitus | danielebogo |
Settings.lastAppVersionThatRunVacuum = appVersion
DispatchQueue.global(qos: .background).async { [weak self] in
guard let self else { return }
if DataManager.sharedManager.podcastCount() > 100 {
presentLoader()
}
DataManager.sharedManager.v... | `Settings.hasSeenInitialOnboardingBefore` can we avoid the `== true`?
Also does this logic apply when the new onboarding FF is off? | Settings.lastAppVersionThatRunVacuum = appVersion
DispatchQueue.global(qos: .background).async { [weak self] in
guard let self else { return }
if DataManager.sharedManager.podcastCount() > 100 {
presentLoader()
}
DataManager.sharedManager.v... | @@ -189,6 +189,7 @@ class MainTabBarController: UITabBarController, NavigationProtocol {
if FeatureFlag.encourageAccountCreation.enabled,
!Settings.hasShownInformationalViewModal,
+ Settings.hasSeenInitialOnboardingBefore == true, | podcasts/MainTabBarController.swift | 26 | Swift | 0.571 | question | 134 | 51 | 51 | false | [New Onboarding] Encourage account creation update for new onboarding | 3,508 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | SergioEstevao |
.frame(maxHeight: cardHeight + 24.0)
buttons
.padding(.top, isiPad ? 12.0 : 33.0)
.if(!isiPad) {
$0.padding(.horizontal, 24.0)
}
.if(isiPad) {
$0.frame(maxWidth: 400)
}
... | The tex gets cut with the new font on small devices
| Now | Before |
| :-------: | :-------: |
| <img width="750" height="1334" alt="Simulator Screenshot - iPhone SE (3rd generation) - 2025-09-21 at 21 14 03" src="https://github.com/user-attachments/assets/f3fbda4b-1107-4f01-a361-294357068225" /> | <img width="75... | .frame(maxHeight: cardHeight + 24.0)
buttons
.padding(.top, isiPad ? 12.0 : 33.0)
.if(!isiPad) {
$0.padding(.horizontal, 24.0)
}
.if(isiPad) {
$0.frame(maxWidth: 400)
}
... | @@ -55,13 +56,13 @@ struct InformationalModalView: View {
private var labels: some View {
VStack(spacing: 0) {
Text(L10n.eacInformationalViewModalTitle)
- .font(size: 22.0, style: .body, weight: .bold)
+ .font(size: FeatureFlag.newOnboardingAccountCreation.enable... | podcasts/Onboarding/Encourage Account Creation/Modal/InformationalModalView.swift | 26 | Swift | 0.5 | suggestion | 510 | 51 | 51 | false | [New Onboarding] Encourage account creation update for new onboarding | 3,508 | Automattic/pocket-casts-ios | 1,136 | Swift | danielebogo | SergioEstevao |
),
hPadding: isiPad ? (proxy.size.width - 400) * 0.5 : 24.0,
showPagination: true,
paginationColor: theme.primaryText01
)
}
.frame(maxHeight: cardHeight + 24.0)
buttons
.pa... | The feature flag check is duplicated multiple times in the same expression. Consider extracting this to a computed property or local variable to improve readability and reduce duplication. | ),
hPadding: isiPad ? (proxy.size.width - 400) * 0.5 : 24.0,
showPagination: true,
paginationColor: theme.primaryText01
)
}
.frame(maxHeight: cardHeight + 24.0)
buttons
.pa... | @@ -55,13 +56,13 @@ struct InformationalModalView: View {
private var labels: some View {
VStack(spacing: 0) {
Text(L10n.eacInformationalViewModalTitle)
- .font(size: 22.0, style: .body, weight: .bold)
+ .font(size: FeatureFlag.newOnboardingAccountCreation.enable... | podcasts/Onboarding/Encourage Account Creation/Modal/InformationalModalView.swift | 26 | Swift | 0.429 | refactor | 188 | 51 | 51 | false | [New Onboarding] Encourage account creation update for new onboarding | 3,508 | Automattic/pocket-casts-ios | 1,136 | Swift | Copilot | SergioEstevao |
.frame(maxHeight: cardHeight + 24.0)
buttons
.padding(.top, isiPad ? 12.0 : 33.0)
.if(!isiPad) {
$0.padding(.horizontal, 24.0)
}
.if(isiPad) {
$0.frame(maxWidth: 400)
}
... | Similar to the previous comment, the feature flag check is repeated multiple times. This creates unnecessary duplication and makes the code harder to maintain. | .frame(maxHeight: cardHeight + 24.0)
buttons
.padding(.top, isiPad ? 12.0 : 33.0)
.if(!isiPad) {
$0.padding(.horizontal, 24.0)
}
.if(isiPad) {
$0.frame(maxWidth: 400)
}
... | @@ -55,13 +56,13 @@ struct InformationalModalView: View {
private var labels: some View {
VStack(spacing: 0) {
Text(L10n.eacInformationalViewModalTitle)
- .font(size: 22.0, style: .body, weight: .bold)
+ .font(size: FeatureFlag.newOnboardingAccountCreation.enable... | podcasts/Onboarding/Encourage Account Creation/Modal/InformationalModalView.swift | 26 | Swift | 0.357 | suggestion | 159 | 51 | 51 | false | [New Onboarding] Encourage account creation update for new onboarding | 3,508 | Automattic/pocket-casts-ios | 1,136 | Swift | Copilot | SergioEstevao |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.