Squash merge no-in-app-changelog-on-apple into develop

This commit is contained in:
Wavesonics 2026-09-01 20:27:32 -07:00
parent aa51c311dc
commit 4ad20162f4
No known key found for this signature in database
7 changed files with 44 additions and 4 deletions

View file

@ -0,0 +1,3 @@
package com.darkrockstudios.apps.hammer.common.data.changelog
actual val supportsInAppChangelog: Boolean = true

View file

@ -16,6 +16,8 @@ class ChangelogRepository(
private var cached: Changelog? = null
suspend fun getChangelog(): Changelog? {
if (!supportsInAppChangelog) return null
lock.withLock { cached }?.let { return it }
val changelog = datasource.loadChangelog() ?: return null

View file

@ -0,0 +1,10 @@
package com.darkrockstudios.apps.hammer.common.data.changelog
/**
* Whether the in-app "What's New" dialog may be shown at all.
*
* False wherever Apple reviews the build. The baked changelog is the full release
* entry, so it names Android and other platforms, which draws guideline 2.3.10
* rejections.
*/
expect val supportsInAppChangelog: Boolean

View file

@ -0,0 +1,6 @@
package com.darkrockstudios.apps.hammer.common.data.changelog
import com.darkrockstudios.apps.hammer.common.IS_APP_STORE
// Only the Mac App Store flavor faces review; direct downloads keep the dialog.
actual val supportsInAppChangelog: Boolean = !IS_APP_STORE

View file

@ -0,0 +1,3 @@
package com.darkrockstudios.apps.hammer.common.data.changelog
actual val supportsInAppChangelog: Boolean = false

View file

@ -0,0 +1,13 @@
package com.darkrockstudios.apps.hammer.common.data.changelog
import kotlin.test.Test
import kotlin.test.assertFalse
class InAppChangelogSupportTest {
// Apple rejects the baked changelog under guideline 2.3.10 for naming other platforms.
@Test
fun `in-app changelog is never shown on iOS`() {
assertFalse(supportsInAppChangelog)
}
}

View file

@ -66,6 +66,7 @@ import com.darkrockstudios.apps.hammer.common.compose.icons.Github
import com.darkrockstudios.apps.hammer.common.compose.icons.Reddit
import com.darkrockstudios.apps.hammer.common.compose.resources.get
import com.darkrockstudios.apps.hammer.common.compose.scrollBarOverlay
import com.darkrockstudios.apps.hammer.common.data.changelog.supportsInAppChangelog
import com.darkrockstudios.apps.hammer.hammer_icon
import org.jetbrains.compose.resources.painterResource
@ -320,10 +321,12 @@ private fun VersionCard(
horizontalArrangement = Arrangement.spacedBy(14.dp),
verticalArrangement = Arrangement.spacedBy(14.dp),
) {
HdHairlineButton(
label = Res.string.about_version_changes_button.get(),
onClick = onViewChangelog,
)
if (supportsInAppChangelog) {
HdHairlineButton(
label = Res.string.about_version_changes_button.get(),
onClick = onViewChangelog,
)
}
HdHairlineButton(
label = Res.string.about_version_github_button.get(),
onClick = onOpenLatestRelease,