Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions app/README.md

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions app/dependencies/releaseRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,14 @@ com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
com.google.j2objc:j2objc-annotations:3.0.0
com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0
com.materialkolor:material-color-utilities-jvm:5.0.1
com.posthog:posthog-android:3.45.0
com.posthog:posthog:6.15.0
com.posthog:posthog-android:3.75.0
com.posthog:posthog:6.48.0
com.prof18.rssparser:rssparser-android:6.1.7
com.prof18.rssparser:rssparser:6.1.7
com.squareup.curtains:curtains:1.2.5
com.squareup.okhttp3:logging-interceptor:4.12.0
com.squareup.okhttp3:logging-interceptor:4.12.1
com.squareup.okhttp3:okhttp-android:5.4.0
com.squareup.okhttp3:okhttp-bom:4.12.0
com.squareup.okhttp3:okhttp-bom:4.12.1
com.squareup.okhttp3:okhttp-coroutines:5.4.0
com.squareup.okhttp3:okhttp:5.4.0
com.squareup.okio:okio-jvm:3.17.0
Expand Down Expand Up @@ -280,8 +280,8 @@ org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.9.22
org.jetbrains.kotlin:kotlin-bom:1.8.22
org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.22
org.jetbrains.kotlin:kotlin-stdlib-common:2.4.10
org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.1.10
org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.10
org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.1.21
org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.21
org.jetbrains.kotlin:kotlin-stdlib:2.4.10
org.jetbrains.kotlinx:kotlinx-coroutines-android:1.11.0
org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.11.0
Expand Down
33 changes: 21 additions & 12 deletions app/src/main/java/cx/aswin/boxlore/BoxLoreApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import cx.aswin.boxlore.core.network.FirebaseAuthAuthenticator
import cx.aswin.boxlore.core.network.NetworkModule
import cx.aswin.boxlore.core.prefs.UserPreferencesRepository
import cx.aswin.boxlore.core.ranking.LearningEventLog
import cx.aswin.boxlore.surveys.BoxcastPostHogSurveysDelegate
import cx.aswin.boxlore.sync.CloudSyncWorker
import cx.aswin.boxlore.ui.StartupWorkGate
import cx.aswin.boxlore.widgets.HomeScreenWidgetsInstaller
Expand Down Expand Up @@ -180,7 +179,21 @@ class BoxLoreApplication :
userPreferencesRepository = userPreferencesRepository,
adaptiveScorer = { container.adaptiveCandidateScorer },
)
engagementPromptCoordinator = EngagementPromptCoordinator(userPreferencesRepository)
engagementPromptCoordinator =
EngagementPromptCoordinator(userPreferencesRepository, cx.aswin.boxlore.core.prefs.NpsSurveyStore(this))
applicationScope.launch {
// Updated after installing: this install ran an older version (a fresh or restored install has not).
val updatedInstall =
runCatching { packageManager.getPackageInfo(packageName, 0).let { it.lastUpdateTime > it.firstInstallTime } }.getOrDefault(false)
try {
engagementPromptCoordinator.onAppLaunched(updatedInstall)
} catch (e: kotlinx.coroutines.CancellationException) {
throw e
} catch (e: Exception) {
// A disk error here only skips one launch count; it must never crash startup.
android.util.Log.w("BoxLoreApplication", "Failed to record the launch for the NPS survey", e)
}
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
scheduleOptionalStartup()

// Live learner signal log: on by default in debug; release stays off unless the
Expand Down Expand Up @@ -373,22 +386,18 @@ class BoxLoreApplication :
val environment = PostHogWiring.environment(debug = BuildConfig.DEBUG, isolatedTests = BuildConfig.BOXLORE_ISOLATED_TESTS)
val config =
PostHogAndroidConfig(
apiKey = BuildConfig.POSTHOG_API_KEY,
projectToken = BuildConfig.POSTHOG_API_KEY,
host = BuildConfig.POSTHOG_HOST,
).apply {
captureApplicationLifecycleEvents = true
captureScreenViews = false
captureDeepLinks = false
debug = BuildConfig.DEBUG
// PostHog Surveys with a Material3 1.5-compatible delegate (the published
// posthog-android-surveys-compose:0.1.0 module crashes against our M3 pin).
surveys = true
surveysConfig.surveysDelegate =
BoxcastPostHogSurveysDelegate(
context = this@BoxLoreApplication,
userPrefs = userPreferencesRepository,
engagementCoordinator = engagementPromptCoordinator,
)
// The NPS survey is boxlore's own sheet (Home), reporting to an API survey; PostHog draws none.
surveys = false
// boxlore doesn't use PostHog push: never send it the FCM token or notification opens (on by default since 3.7x).
capturePushNotificationSubscriptions = false
capturePushNotificationOpened = false
onFeatureFlags =
PostHogWiring.onFlagsLoaded(
// LEGACY(own-ids): staged feed-first rollout; remove at S7 with rememberRolloutAnswers.
Expand Down
17 changes: 0 additions & 17 deletions app/src/main/java/cx/aswin/boxlore/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ import androidx.compose.runtime.setValue
import androidx.compose.runtime.withFrameNanos
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.lifecycleScope
import com.posthog.PostHog
import cx.aswin.boxlore.core.analytics.AnalyticsHelper
import cx.aswin.boxlore.core.playback.PlaybackRepository
import cx.aswin.boxlore.surveys.NpsSurveyTriggers
import cx.aswin.boxlore.ui.BoxLoreAppRoot
import cx.aswin.boxlore.updates.PlayAppUpdateHelper

Expand All @@ -38,18 +36,9 @@ class MainActivity : ComponentActivity() {
@Suppress("unused")
private var isFirstResumeAfterLaunch = true

private val surveyPrefs by lazy {
(application as BoxLoreApplication).userPreferencesRepository
}
private val engagementCoordinator by lazy {
(application as BoxLoreApplication).engagementPromptCoordinator
}

@Volatile
private var playbackRepositoryRef: PlaybackRepository? = null

private fun isCurrentlyPlaying(): Boolean = playbackRepositoryRef?.playerState?.value?.isPlaying == true

private val updateLauncher =
registerForActivityResult(
ActivityResultContracts.StartIntentSenderForResult(),
Expand Down Expand Up @@ -165,12 +154,6 @@ class MainActivity : ComponentActivity() {
}

private fun resumeForegroundPrompts() {
NpsSurveyTriggers.check(
surveyPrefs = surveyPrefs,
engagementCoordinator = engagementCoordinator,
isCurrentlyPlaying = ::isCurrentlyPlaying,
scope = lifecycleScope,
)
appUpdates.foreground()
if (appUpdates.usesPlay) playAppUpdateHelper.resumeInProgressUpdate()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ internal fun androidx.navigation.NavGraphBuilder.addDebugDestination(w: NavGraph
subscriptionRepository = subscriptionRepository,
userPreferencesRepository = userPrefs,
adaptiveRankingRepository = container.adaptiveRankingRepository,
engagementPromptCoordinator = w.application.engagementPromptCoordinator,
bottomContentPadding = w.session.miniPlayerPadding,
onBack = { navController.popBackStack() },
)
Expand Down

This file was deleted.

39 changes: 0 additions & 39 deletions app/src/main/java/cx/aswin/boxlore/surveys/NpsSurveyBranching.kt

This file was deleted.

68 changes: 0 additions & 68 deletions app/src/main/java/cx/aswin/boxlore/surveys/NpsSurveyTriggers.kt

This file was deleted.

This file was deleted.

Loading
Loading