settings: What's new opens this version's release notes on GitHub

This commit is contained in:
Seb3thehacker committed 2026-10-24 00:21:24 -07:00
1 parent ef006dc695
commit fed652f9d3
3 files changed
+6 -4

No files matched your search

@@ -45,6 +45,9 @@ internal object GearslipLinks {
const val SOURCE = "https://github.com/twinksoftware/gearslip"
const val CARS = "$SOURCE/blob/main/CARS.md"
/** This version's release notes on GitHub; every release is tagged v plus its version name. */
val RELEASE_NOTES = "$SOURCE/releases/tag/v${app.seb3thehacker.gearslip.BuildConfig.VERSION_NAME}"
fun open(context: Context, url: String) {
runCatching {
context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK))
@@ -119,7 +119,6 @@ fun GearslipApp(onDisconnect: () -> Unit, onRequestCallScreening: () -> Unit) {
Screen.SETTINGS -> SettingsScreen(
onBack = { screen = Screen.HOME },
onOpenRecommendedApps = { settingsAtUsageNotes = false; screen = Screen.RECOMMENDED_APPS },
onOpenWhatsNew = { settingsAtUsageNotes = false; backTo = Screen.SETTINGS; screen = Screen.WHATS_NEW },
onReplayTutorial = { screen = Screen.SETUP_GUIDE },
atUsageNotes = settingsAtUsageNotes,
)
@@ -79,7 +79,6 @@ import kotlinx.coroutines.withContext
fun SettingsScreen(
onBack: () -> Unit,
onOpenRecommendedApps: () -> Unit,
onOpenWhatsNew: () -> Unit,
onReplayTutorial: () -> Unit,
atUsageNotes: Boolean = false,
) {
@@ -116,10 +115,11 @@ fun SettingsScreen(
) {
Spacer(Modifier.height(0.dp))
SettingsSection {
val context = LocalContext.current
SettingsRow(
"What's new",
Modifier.clickable(onClick = onOpenWhatsNew),
subtitle = "Version ${BuildConfig.VERSION_NAME}",
Modifier.clickable { GearslipLinks.open(context, GearslipLinks.RELEASE_NOTES) },
subtitle = "Read the ${BuildConfig.VERSION_NAME} release notes on GitHub",
icon = Icons.Filled.Star,
trailing = { Arrow() },
)