Skip to content

Commit 5ca1eaa

Browse files
committed
feat: Refactor note handling and migrate build configuration
- **Note Handling & Adaptive UI**: - Update `NoteDetail` and `NoteAction` to use `TextFieldState` and `CharSequence` for text input. - Implement a save-change confirmation flow via `AdaptiveInteractor` when creating or switching notes in adaptive layouts. - Remove explicit `title` parameters from `NoteAction.Save` and `CheckSaveChange`, centralizing title generation logic in `NoteViewModel`. - Lift `SnackbarHostState` to the `App` level and update `GlobalSnackbarHost` to ensure visibility over system bars and the keyboard. - Adjust `ExtendedFloatingActionButton` in `MainScreen` to move upward dynamically when a snackbar is displayed. - **Build & CI/CD**: - Migrate from `android-library` to `android-kotlin-multiplatform-library` across core and UI modules. - Update AGP to 9.0.0, Compose to 1.10.0, and Gradle to 9.3.0. - Rename `androidUnitTest` source sets to `androidHostTest` and `androidInstrumentedTest` to `androidDeviceTest` to align with new KMP project structures. - Increase `kotlin.native.jvmArgs` to `-Xmx8g` for improved build performance. - **Testing**: - Add `CreateNoteWhileSelectedTestCase` and `SaveDialog` page object to support testing save-change flows. - Disable unstable iOS and process checker tests on CI. - Improve database cleanup in JVM UI tests to handle WAL and journal files. - **Refactoring & Cleanup**: - Standardize Compose preview imports using `androidx.compose.ui.tooling.preview.Preview` globally. - Ensure dialog text and password fields use `fillMaxWidth` for consistent UI layout. - Add explicit type to `QueryResult` in `WebSafeRepo` for Wasm compatibility.
1 parent 4130094 commit 5ca1eaa

File tree

102 files changed

+642
-436
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+642
-436
lines changed

.github/workflows/kmp.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@ jobs:
4444
with:
4545
name: output-build-artifacts
4646
path: |
47-
shared/build/reports
47+
ui/shared/build/reports
48+
ui/test/build/reports
4849
app/android/build/reports
4950
app/desktop/build/reports
51+
app/ios-kit/build/reports
5052
5153
android_ui_test_job:
5254
name: Android UI-tests on emulator

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,27 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [8.5.1] - 2026-01-27
9+
10+
### Features
11+
- Add save-change confirmation when creating a new note while another note is selected in adaptive layouts
12+
- Improve snackbar visibility by lifting the global host and FAB around IME/system bars
13+
- Improve dialog input layouts by making text and password fields fill the available width
14+
15+
### Refactoring
16+
- Simplify note title handling by removing title from NoteAction/NoteDetail state and streamlining title generation
17+
- Clean up MainScreen/note edit flow (IME padding for the FAB and save-change dialog actions)
18+
- Standardize Compose preview imports/dependencies, tidy UI imports, and add explicit typing in WebSafeRepo
19+
20+
### Tests
21+
- Add SaveDialog test tags and a Page Object; introduce and refine CreateNoteWhileSelectedTestCase
22+
- Improve JVM UI test database cleanup; tune SettingPasswordTestCase logging/timeouts
23+
- Disable unstable tests (ExampleTest, ProcessCheckerTest) and iOS UI tests on CI
24+
25+
### Chores
26+
- Migrate to AGP 9.0/KMP Android test source sets; update Gradle and dependencies (Compose, Firebase BOM, AndroidX, LeakCanary)
27+
- Update CI artifact paths and increase Kotlin/Native JVM args for builds
28+
829
## [8.5.0] - 2026-01-08
930

1031
### Features
@@ -692,4 +713,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
692713
- Using TextInputEditText instead of EditText
693714
- Annotated application context
694715
- Added Realm browser for debugging
695-

app/android/build.gradle.kts

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
77

88
plugins {
99
alias(libs.plugins.android.application)
10-
alias(libs.plugins.kotlin.android)
1110
alias(libs.plugins.compose)
1211
alias(libs.plugins.compose.compiler)
1312
alias(libs.plugins.gms)
@@ -24,8 +23,8 @@ android {
2423
applicationId = "com.softartdev.noteroom"
2524
minSdk = libs.versions.minSdk.get().toInt()
2625
targetSdk = libs.versions.targetSdk.get().toInt()
27-
versionCode = 850
28-
versionName = "8.5.0"
26+
versionCode = 851
27+
versionName = "8.5.1"
2928
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
3029
testInstrumentationRunnerArguments["clearPackageData"] = "true"
3130
vectorDrawables.useSupportLibrary = true
@@ -60,7 +59,7 @@ android {
6059
buildConfig = true
6160
compose = true
6261
}
63-
packagingOptions.resources.excludes.add("/META-INF/{AL2.0,LGPL2.1}")
62+
packaging.resources.excludes.add("/META-INF/{AL2.0,LGPL2.1}")
6463
testOptions {
6564
execution = "ANDROIDX_TEST_ORCHESTRATOR"
6665
emulatorControl.enable = true
@@ -73,7 +72,7 @@ dependencies {
7372
implementation(project(project.property("CORE_DATA_DB_MODULE").toString()))
7473
implementation(projects.core.presentation)
7574
implementation(projects.ui.shared)
76-
implementation(kotlin("reflect"))
75+
implementation(kotlin("reflect", libs.versions.kotlin.get()))
7776
implementation(libs.androidx.core.splashscreen)
7877
implementation(libs.androidx.appcompat)
7978
implementation(libs.androidx.activity.compose)
@@ -94,7 +93,6 @@ dependencies {
9493
implementation(libs.firebase.crashlytics)
9594
implementation(libs.androidx.tracing)
9695
debugImplementation(libs.leakCanary.android)
97-
debugImplementation(libs.leakCanary.android.process)
9896
implementation(libs.leakCanary.plumber.android)
9997
coreLibraryDesugaring(libs.desugar)
10098
testImplementation(libs.junit)
@@ -118,3 +116,19 @@ dependencies {
118116
tasks.withType<UploadMappingFileTask> {
119117
dependsOn("processDebugGoogleServices")
120118
}
119+
120+
configurations.all {
121+
resolutionStrategy {
122+
sequenceOf(
123+
"common", "common-java8", "runtime", "runtime-ktx", "runtime-compose", "viewmodel", "viewmodel-ktx", "viewmodel-compose", "viewmodel-savedstate", "livedata", "livedata-core", "livedata-core-ktx", "process"
124+
).forEach { depName: String ->
125+
force("androidx.lifecycle:lifecycle-$depName:${libs.versions.androidxLifecycle.get()}")
126+
}
127+
force("androidx.savedstate:savedstate:1.4.0")
128+
force("androidx.savedstate:savedstate-ktx:1.4.0")
129+
force("androidx.savedstate:savedstate-compose:1.4.0")
130+
131+
force("androidx.concurrent:concurrent-futures:1.2.0")
132+
force("com.google.errorprone:error_prone_annotations:2.30.0")
133+
}
134+
}

app/android/src/androidTest/java/com/softartdev/notedelight/ui/AndroidUiTests.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ class AndroidUiTests : AbstractJvmUiTests() {
3636
@Test
3737
override fun crudNoteTest() = super.crudNoteTest()
3838

39+
@Test
40+
override fun createNoteWhileSelectedTest() = super.createNoteWhileSelectedTest()
41+
3942
@Test
4043
override fun editTitleAfterCreateTest() = super.editTitleAfterCreateTest()
4144

app/android/src/main/java/com/softartdev/notedelight/MainApplication.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import co.touchlab.kermit.platformLogWriter
1111
import com.softartdev.notedelight.di.sharedModules
1212
import com.softartdev.notedelight.di.uiModules
1313
import com.softartdev.notedelight.util.DEFAULT_APP_LOG_TAG
14-
import com.softartdev.notedelight.util.isInLeakCanaryAnalyzerProcess
1514
import com.softartdev.notedelight.util.kermitLogger
1615
import org.koin.android.ext.koin.androidContext
1716
import org.koin.core.context.startKoin
@@ -20,7 +19,6 @@ class MainApplication : Application() {
2019

2120
override fun onCreate() {
2221
super.onCreate()
23-
if (isInLeakCanaryAnalyzerProcess) return
2422
Logger.setTag(DEFAULT_APP_LOG_TAG)
2523
Logger.setLogWriters(if (BuildConfig.DEBUG) platformLogWriter() else CrashlyticsLogWriter(minSeverity = Severity.Debug))
2624
startKoin {

app/android/src/test/java/com/softartdev/notedelight/util/ProcessCheckerTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ package com.softartdev.notedelight.util
22

33
import android.content.Context
44
import org.junit.Assert.assertEquals
5+
import org.junit.Ignore
56
import org.junit.Test
67
import org.mockito.Mockito
78

9+
@Ignore("Separate process for LeakCanary currently disabled")
810
class ProcessCheckerTest {
911

1012
@Test

app/desktop/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ compose.desktop {
5353
nativeDistributions {
5454
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
5555
packageName = "Note Delight"
56-
packageVersion = "8.5.0"
56+
packageVersion = "8.5.1"
5757
description = "Note app with encryption"
5858
copyright = "© 2023 SoftArtDev"
5959
macOS.iconFile.set(project.file("src/jvmMain/resources/app_icon.icns"))

app/desktop/src/jvmTest/kotlin/com/softartdev/notedelight/ui/DesktopUiTests.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ class DesktopUiTests : AbstractJvmUiTests() {
5454
}
5555
val safeRepo: SafeRepo = get(SafeRepo::class.java)
5656
safeRepo.closeDatabase()
57-
File(safeRepo.dbPath).takeIf(File::exists)?.delete()
57+
for (suffix: String in arrayOf("", "-wal", "-shm", "-journal")) {
58+
File(safeRepo.dbPath + suffix).delete()
59+
}
5860
safeRepo.buildDbIfNeed()
5961
val noteDAO: NoteDAO = get(NoteDAO::class.java)
6062
noteDAO.deleteAll()
@@ -80,6 +82,9 @@ class DesktopUiTests : AbstractJvmUiTests() {
8082
@Test
8183
override fun crudNoteTest() = super.crudNoteTest()
8284

85+
@Test
86+
override fun createNoteWhileSelectedTest() = super.createNoteWhileSelectedTest()
87+
8388
@Test
8489
override fun editTitleAfterCreateTest() = super.editTitleAfterCreateTest()
8590

app/ios-kit/src/commonTest/kotlin/com/softartdev/notedelight/IosUiTests.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ package com.softartdev.notedelight
33
import kotlinx.coroutines.test.TestResult
44
import kotlin.test.AfterTest
55
import kotlin.test.BeforeTest
6+
import kotlin.test.Ignore
67
import kotlin.test.Test
78

9+
@Ignore //FIXME: Could not generate test report on CI
810
class IosUiTests : CommonUiTests() {
911

1012
@BeforeTest
@@ -16,6 +18,9 @@ class IosUiTests : CommonUiTests() {
1618
@Test
1719
override fun crudNoteTest(): TestResult = super.crudNoteTest()
1820

21+
@Test
22+
override fun createNoteWhileSelectedTest(): TestResult = super.createNoteWhileSelectedTest()
23+
1924
@Test
2025
override fun editTitleAfterCreateTest(): TestResult = super.editTitleAfterCreateTest()
2126

@@ -33,4 +38,4 @@ class IosUiTests : CommonUiTests() {
3338

3439
@Test
3540
override fun localeTest(): TestResult = super.localeTest()
36-
}
41+
}

app/iosApp/iosApp.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@
475475
"$(inherited)",
476476
"@executable_path/Frameworks",
477477
);
478-
MARKETING_VERSION = 8.5.0;
478+
MARKETING_VERSION = 8.5.1;
479479
OTHER_LDFLAGS = (
480480
"$(inherited)",
481481
"-ObjC",
@@ -517,7 +517,7 @@
517517
"$(inherited)",
518518
"@executable_path/Frameworks",
519519
);
520-
MARKETING_VERSION = 8.5.0;
520+
MARKETING_VERSION = 8.5.1;
521521
OTHER_LDFLAGS = (
522522
"$(inherited)",
523523
"-ObjC",

0 commit comments

Comments
 (0)