Skip to content
Closed
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3dae591
feat: Implement database migration to version 16 with a dedicated UI,…
Feb 3, 2026
9d0f06a
feat: Filter cached book queries to only include books that have at l…
Feb 3, 2026
71cbf62
feat: enhance cached items screen with storage statistics, detailed b…
Feb 4, 2026
01f3521
feat: introduce a new download modal with enhanced options for segmen…
Feb 4, 2026
714d9b2
feat: Allow subtitles to span two lines and refine download modal mon…
Feb 4, 2026
de72283
feat: Introduce `Queued` cache status, replace the shimmering downloa…
Feb 4, 2026
a106485
feat: enhance caching progress reporting with notification throttling…
Feb 4, 2026
41717a8
feat: Remove thumbnail cache clearing functionality and associated UI…
Feb 4, 2026
f936b5c
feat: Integrate Microsoft Clarity for analytics tracking and UI maski…
Feb 5, 2026
3a2ce89
feat: Implement analytics consent, overhaul persistent caching with d…
Feb 6, 2026
ecd3041
feat: Update CachedItemsSettingsScreen to navigate to the library whe…
Feb 6, 2026
331716d
feat: Implement bulk selection for cached items in settings, add meta…
Feb 6, 2026
dba6ec3
feat: Implement progressive image loading with blurred thumbnails, ad…
Feb 6, 2026
b8a4d87
Fix: Adjust `_preparingBookId` clearing to occur upon playback start …
Feb 6, 2026
684ec8c
feat: Optimize playback readiness by decoupling cover art updates, en…
Feb 6, 2026
5b66d4c
fix: forced server availability check, pull down to refresh, continue…
Feb 6, 2026
52c1e27
fix: show spinner for player buttons when the playback is being prepared
Feb 6, 2026
fc0fa44
fix: initial launch playback freeze by moving the exo player initiali…
Feb 6, 2026
74fc260
add changelog generation
Feb 6, 2026
826141a
Add update checker service
Feb 6, 2026
1b5bd36
fix book deletion glitch
Feb 6, 2026
cc16ea0
add code rabbit
Feb 6, 2026
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
4 changes: 4 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ android {
buildConfigField("String", "ACRA_REPORT_LOGIN", "\"$acraReportLogin\"")
buildConfigField("String", "ACRA_REPORT_PASSWORD", "\"$acraReportPassword\"")

buildConfigField("String", "CLARITY_PROJECT_ID", "\"vc8bgk8nk9\"")

Comment on lines +69 to +70
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cd app && head -250 build.gradle.kts | tail -200

Repository: SurjitSahoo/kahani-android

Length of output: 5795


🌐 Web query:

Microsoft Clarity Android SDK project ID configuration best practices

💡 Result:

Best practices for configuring the Microsoft Clarity Android SDK Project ID

  • Treat the Project ID as an environment-specific value (dev/stage/prod). The projectId is the routing key that sends sessions to the correct Clarity project, so use separate Clarity projects (and IDs) per environment to avoid mixing data. [1]
  • Don’t hardcode the Project ID in Activities/fragments. Keep it in build-time configuration (e.g., Gradle buildConfigField, productFlavors, or CI-injected values) and reference that constant when creating ClarityConfig(projectId = ...). This makes it easy to swap IDs per build variant while keeping initialization code identical. [1]
  • Initialize Clarity exactly once, as early as practical. Microsoft recommends calling Clarity.initialize(...) from the startup activity onCreate(); if you have multiple startup activities, initialize in a custom Application class or duplicate the call in each startup activity. [1]
  • Use Verbose logging only for debugging. Set logLevel = Verbose temporarily to validate the integration, then disable (default is None) for production builds. [1]
  • Know where to get the correct Project ID. Copy it from your Clarity project’s Settings/Overview in the Clarity dashboard. [1][2]
  • If you use a custom WorkManager initializer, initialize Clarity after it. Otherwise Clarity may not function properly. [1]

Reference initialization (Kotlin):

val config = ClarityConfig(
  projectId = BuildConfig.CLARITY_PROJECT_ID,
  logLevel = LogLevel.Verbose
)
Clarity.initialize(applicationContext, config)

(Initialization pattern per Microsoft docs. [1])

Sources: Android SDK installation docs [1], Mobile SDK getting started / Project settings overview [2].

[1] (learn.microsoft.com)
[2] (learn.microsoft.com)

Citations:


🏁 Script executed:

# Check if localProperties is defined/used in build.gradle.kts
grep -n "localProperties" app/build.gradle.kts | head -20

Repository: SurjitSahoo/kahani-android

Length of output: 546


🏁 Script executed:

# Examine the specific lines mentioned
sed -n '60,80p' app/build.gradle.kts

Repository: SurjitSahoo/kahani-android

Length of output: 841


🏁 Script executed:

# Check what's at lines 199-200
sed -n '195,205p' app/build.gradle.kts

Repository: SurjitSahoo/kahani-android

Length of output: 324


Make CLARITY_PROJECT_ID configurable to support per-environment project IDs.

Microsoft Clarity best practices recommend storing the project ID in build-time configuration (not hardcoding), with support for environment variables and build flavors. This allows separate Clarity projects for different build variants while keeping initialization code identical.

The codebase already uses this pattern for signing credentials (lines 74, 82–84); apply the same approach here:

♻️ Suggested refactor
-    buildConfigField("String", "CLARITY_PROJECT_ID", "\"vc8bgk8nk9\"")
+    val clarityProjectId =
+      System.getenv("CLARITY_PROJECT_ID")
+        ?: localProperties.getProperty("CLARITY_PROJECT_ID")
+        ?: "vc8bgk8nk9"
+    buildConfigField("String", "CLARITY_PROJECT_ID", "\"$clarityProjectId\"")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
buildConfigField("String", "CLARITY_PROJECT_ID", "\"vc8bgk8nk9\"")
val clarityProjectId =
System.getenv("CLARITY_PROJECT_ID")
?: localProperties.getProperty("CLARITY_PROJECT_ID")
?: "vc8bgk8nk9"
buildConfigField("String", "CLARITY_PROJECT_ID", "\"$clarityProjectId\"")
🤖 Prompt for AI Agents
In `@app/build.gradle.kts` around lines 69 - 70, The CLARITY_PROJECT_ID is
hardcoded via buildConfigField("String", "CLARITY_PROJECT_ID", "\"vc8bgk8nk9\"")
— change it to read from a build-time property or environment variable
(mirroring the signing credentials pattern used around the other
buildConfigField entries) so each flavor/environment can supply its own project
ID; update the buildConfigField invocation for CLARITY_PROJECT_ID to use project
property lookup (falling back to an env var and then a sensible default) and
document the expected property name so CI/build scripts can set per-environment
values.

signingConfigs {
create("release") {
val envKeyStore = System.getenv("RELEASE_STORE_FILE")
Expand Down Expand Up @@ -194,6 +196,8 @@ dependencies {
implementation(libs.moshi)
implementation(libs.moshi.kotlin)

implementation(libs.microsoft.clarity)

debugImplementation(libs.androidx.ui.tooling)
debugImplementation(libs.androidx.ui.test.manifest)
}
6 changes: 5 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@
# Hilt and Dagger rules (usually bundled, but good to ensure)
-keep class dagger.hilt.android.internal.** { *; }
-keep class *__HiltBindingModule { *; }
-keep class org.grakovne.lissen.**_HiltComponents$* { *; }
-keep class org.grakovne.lissen.**_HiltComponents$* { *; }

# Microsoft Clarity
-keep class com.microsoft.clarity.** { *; }
-keep interface com.microsoft.clarity.** { *; }
Loading