From 5b4c32aff9be1f4910ebb958f486fde8335d4431 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Sun, 2 Aug 2026 19:11:39 +0200 Subject: [PATCH] Take the undone chip away sooner (#68) It offers nothing to act on and confirms a change the user just asked for and can see behind it, so 4s was the chip outstaying what it said. --- .../calendula/ui/common/EventMoveHost.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/common/EventMoveHost.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/common/EventMoveHost.kt index 98de947..20daab9 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/common/EventMoveHost.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/common/EventMoveHost.kt @@ -32,6 +32,14 @@ import java.util.Locale /** How long the confirmation chip stays up, matching a short snackbar. */ private const val CHIP_MILLIS = 4_000L +/** + * How long an *undone* move stays up. Shorter than everything else the chip + * says: it offers nothing to act on, and it confirms a change the user has just + * asked for and can see on the grid behind it, so the full dwell is only the + * chip outstaying what it had to say. + */ +private const val UNDONE_CHIP_MILLIS = 1_600L + /** What the chip currently reads, kept past the outcome it was built from. */ private data class ChipContent(val message: String, val undo: MoveUndo?) @@ -88,7 +96,7 @@ fun EventMoveHost(viewModel: RescheduleViewModel, modifier: Modifier = Modifier) val content = shown.value LaunchedEffect(outcome) { if (outcome == null) return@LaunchedEffect - delay(CHIP_MILLIS) + delay(if (outcome == MoveOutcome.Undone) UNDONE_CHIP_MILLIS else CHIP_MILLIS) viewModel.consumeOutcome() }