diff --git a/android/app/src/main/java/com/fabledsword/thoughtsync/ui/BoardViewModel.kt b/android/app/src/main/java/com/fabledsword/thoughtsync/ui/BoardViewModel.kt index dece4d3..6d3e2ac 100644 --- a/android/app/src/main/java/com/fabledsword/thoughtsync/ui/BoardViewModel.kt +++ b/android/app/src/main/java/com/fabledsword/thoughtsync/ui/BoardViewModel.kt @@ -413,9 +413,10 @@ class BoardViewModel( /** * The one path every store mutation takes. * - * Each core mutation returns the reloaded note, which goes straight into - * [BoardState.editing] so an open editor shows its own change without a - * re-query. The BOARD list is then reloaded rather than patched in place: + * Each core mutation returns the reloaded note, which refreshes + * [BoardState.editing] so an OPEN editor shows its own change without a + * re-query — and does nothing at all when the editor is closed, because that + * field doubles as "which screen is up". The BOARD list is then reloaded rather than patched in place: * pinning re-sorts it, archiving removes the note from it, and adding a label * can move it in or out of a label view — a splice would have to reimplement * the core's ordering and membership rules in Kotlin to get any of that right. @@ -451,7 +452,12 @@ class BoardViewModel( withContext(Dispatchers.IO) { onRemindersChanged() } state.copy( notes = notes, - editing = if (closeEditor) null else updated ?: state.editing, + // Only REFRESHES an open editor; it must never open one. + // `editing != null` IS "the editor is on screen", so writing + // the reloaded note in unconditionally meant any mutation + // started from the BOARD threw the editor open on top of it — + // which is exactly what ticking a checkbox on a card did. + editing = if (closeEditor) null else state.editing?.let { updated ?: it }, saving = false, error = null, )