feat: show app version in Settings, fix composer NPE crash, bump to v0.2.0

- Settings: shows "Swoosh v0.2.0" at bottom
- Fix: NPE crash in composer error display (AnimatedVisibility exit)
- Version bumped to 0.2.0 (versionCode 2)
- CLAUDE.md: added versioning process documentation
This commit is contained in:
Paweł Orzech 2026-03-19 15:27:58 +01:00
parent dcb9c50c02
commit ccd729e82f
No known key found for this signature in database
4 changed files with 33 additions and 3 deletions

View file

@ -41,3 +41,20 @@ MVVM with Repository pattern, single-module Gradle project.
- **Credentials:** Stored in `EncryptedSharedPreferences` (AES256-GCM) via `CredentialsManager` - **Credentials:** Stored in `EncryptedSharedPreferences` (AES256-GCM) via `CredentialsManager`
- **API client:** Base URL is configured at runtime during setup; `ApiClient` rebuilds Retrofit instance when URL changes - **API client:** Base URL is configured at runtime during setup; `ApiClient` rebuilds Retrofit instance when URL changes
- **Min SDK 26, Target/Compile SDK 34, Kotlin 1.9.22, Java 17** - **Min SDK 26, Target/Compile SDK 34, Kotlin 1.9.22, Java 17**
## Versioning
Version is defined in `app/build.gradle.kts` (`versionCode` and `versionName`).
- **Format:** Semantic versioning `MAJOR.MINOR.PATCH` (e.g., `0.2.0`)
- **`versionCode`:** Integer, increment by 1 on every release (used by Google Play)
- **`versionName`:** Human-readable, shown in Settings screen
**When to bump:**
- **PATCH** (0.2.0 → 0.2.1): Bug fixes, small tweaks, no new features
- **MINOR** (0.2.0 → 0.3.0): New features, UI changes, significant improvements
- **MAJOR** (0.x → 1.0): First stable public release
**Current:** `versionName = "0.2.0"`, `versionCode = 2`
**Process:** When making a release commit, bump both `versionCode` (+1) and `versionName` in `app/build.gradle.kts`. Always bump version when creating a release build or PR.

View file

@ -12,8 +12,8 @@ android {
applicationId = "com.swoosh.microblog" applicationId = "com.swoosh.microblog"
minSdk = 26 minSdk = 26
targetSdk = 34 targetSdk = 34
versionCode = 1 versionCode = 2
versionName = "1.0" versionName = "0.2.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables { useSupportLibrary = true } vectorDrawables { useSupportLibrary = true }

View file

@ -521,7 +521,7 @@ fun ComposerScreen(
Column { Column {
Spacer(modifier = Modifier.height(12.dp)) Spacer(modifier = Modifier.height(12.dp))
Text( Text(
text = state.error!!, text = state.error ?: "",
color = MaterialTheme.colorScheme.error, color = MaterialTheme.colorScheme.error,
style = MaterialTheme.typography.bodySmall style = MaterialTheme.typography.bodySmall
) )

View file

@ -141,6 +141,19 @@ fun SettingsScreen(
Spacer(modifier = Modifier.height(8.dp)) Spacer(modifier = Modifier.height(8.dp))
// App version
Spacer(modifier = Modifier.height(16.dp))
val packageInfo = context.packageManager.getPackageInfo(context.packageName, 0)
Text(
text = "Swoosh v${packageInfo.versionName}",
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
modifier = Modifier.fillMaxWidth(),
textAlign = androidx.compose.ui.text.style.TextAlign.Center
)
Spacer(modifier = Modifier.height(16.dp))
// Disconnect all // Disconnect all
if (accountManager.getAccounts().size > 1) { if (accountManager.getAccounts().size > 1) {
TextButton( TextButton(