From 89fa58ddffce5fef8857b4955b2afddb157c20f0 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Fri, 27 Nov 2026 14:02:23 +0100 Subject: [PATCH] Review fixes: indeterminate still pull indicator, Dp corner springs, add-subtask row on the nested token (#118, #157) --- .../agendula/ui/common/SyncPullBox.kt | 7 ++++++- .../jeanlucmakiola/agendula/ui/lists/ListsScreen.kt | 6 ++++-- .../agendula/ui/tasklist/TaskListScreen.kt | 13 +++++++------ floret-kit | 2 +- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/de/jeanlucmakiola/agendula/ui/common/SyncPullBox.kt b/app/src/main/java/de/jeanlucmakiola/agendula/ui/common/SyncPullBox.kt index 1724605..e5ab3f9 100644 --- a/app/src/main/java/de/jeanlucmakiola/agendula/ui/common/SyncPullBox.kt +++ b/app/src/main/java/de/jeanlucmakiola/agendula/ui/common/SyncPullBox.kt @@ -16,6 +16,9 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import de.jeanlucmakiola.floret.identity.rememberLoopingMotion +import androidx.compose.ui.semantics.ProgressBarRangeInfo +import androidx.compose.ui.semantics.clearAndSetSemantics +import androidx.compose.ui.semantics.progressBarRangeInfo /** * Pull down to sync every account (#73). Without an account there is nothing @@ -58,7 +61,9 @@ fun SyncPullBox( ) { CircularProgressIndicator( progress = { if (syncing) 1f else state.distanceFraction.coerceIn(0f, 1f) }, - modifier = Modifier.size(24.dp), + modifier = Modifier + .size(24.dp) + .clearAndSetSemantics { progressBarRangeInfo = ProgressBarRangeInfo.Indeterminate }, strokeWidth = 2.5.dp, ) } diff --git a/app/src/main/java/de/jeanlucmakiola/agendula/ui/lists/ListsScreen.kt b/app/src/main/java/de/jeanlucmakiola/agendula/ui/lists/ListsScreen.kt index f881caf..4cf7b11 100644 --- a/app/src/main/java/de/jeanlucmakiola/agendula/ui/lists/ListsScreen.kt +++ b/app/src/main/java/de/jeanlucmakiola/agendula/ui/lists/ListsScreen.kt @@ -9,6 +9,7 @@ import androidx.compose.material.icons.rounded.SwapVert import androidx.activity.compose.BackHandler import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.core.animateDpAsState +import androidx.compose.animation.core.VisibilityThreshold import androidx.compose.animation.core.spring import androidx.compose.animation.core.tween import androidx.compose.animation.expandHorizontally @@ -79,6 +80,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.KeyboardCapitalization import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle @@ -654,7 +656,7 @@ private fun SearchResults( private fun TodayHero(done: Int, total: Int, onClick: () -> Unit) { val interaction = remember { MutableInteractionSource() } val pressed by interaction.collectIsPressedAsState() - val corner by animateDpAsState(if (pressed) 34.dp else 22.dp, reducibleSpec(spring()), label = "todayCorner") + val corner by animateDpAsState(if (pressed) 34.dp else 22.dp, reducibleSpec(spring(visibilityThreshold = Dp.VisibilityThreshold)), label = "todayCorner") val left = total - done Surface( onClick = onClick, @@ -852,7 +854,7 @@ private fun SmartCard(count: SmartCount, modifier: Modifier = Modifier, onClick: val style = smartStyle(count.smart) val interaction = remember { MutableInteractionSource() } val pressed by interaction.collectIsPressedAsState() - val corner by animateDpAsState(if (pressed) 34.dp else 22.dp, reducibleSpec(spring()), label = "smartCorner") + val corner by animateDpAsState(if (pressed) 34.dp else 22.dp, reducibleSpec(spring(visibilityThreshold = Dp.VisibilityThreshold)), label = "smartCorner") Surface( onClick = onClick, shape = RoundedCornerShape(corner), diff --git a/app/src/main/java/de/jeanlucmakiola/agendula/ui/tasklist/TaskListScreen.kt b/app/src/main/java/de/jeanlucmakiola/agendula/ui/tasklist/TaskListScreen.kt index 7a977be..741a8be 100644 --- a/app/src/main/java/de/jeanlucmakiola/agendula/ui/tasklist/TaskListScreen.kt +++ b/app/src/main/java/de/jeanlucmakiola/agendula/ui/tasklist/TaskListScreen.kt @@ -4,6 +4,7 @@ import androidx.activity.compose.BackHandler import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.core.animateDpAsState import androidx.compose.animation.core.animateFloatAsState +import androidx.compose.animation.core.VisibilityThreshold import androidx.compose.animation.core.spring import androidx.compose.animation.fadeIn import androidx.compose.animation.fadeOut @@ -107,6 +108,7 @@ import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextDecoration import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import androidx.hilt.lifecycle.viewmodel.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle @@ -137,7 +139,6 @@ import de.jeanlucmakiola.floret.time.formatDateTimeCompact import de.jeanlucmakiola.floret.components.pastelize import de.jeanlucmakiola.floret.components.positionOf import de.jeanlucmakiola.floret.identity.FloretDensity -import de.jeanlucmakiola.floret.identity.byDensity import de.jeanlucmakiola.floret.identity.reducibleSpec import de.jeanlucmakiola.floret.identity.rememberReduceMotion import de.jeanlucmakiola.floret.components.ActionButton @@ -817,8 +818,8 @@ internal fun TaskRowContent( ) { val interaction = remember { MutableInteractionSource() } val pressed by interaction.collectIsPressedAsState() - val full by animateDpAsState(if (pressed) 36.dp else 22.dp, reducibleSpec(spring()), label = "fullCorner") - val small by animateDpAsState(if (pressed) 36.dp else 6.dp, reducibleSpec(spring()), label = "smallCorner") + val full by animateDpAsState(if (pressed) 36.dp else 22.dp, reducibleSpec(spring(visibilityThreshold = Dp.VisibilityThreshold)), label = "fullCorner") + val small by animateDpAsState(if (pressed) 36.dp else 6.dp, reducibleSpec(spring(visibilityThreshold = Dp.VisibilityThreshold)), label = "smallCorner") val dark = isSystemInDarkTheme() val due = task.shownValue(TaskEnd.DUE)?.formatDateTimeCompact(!task.hasTime(TaskEnd.DUE), LocalUse24HourFormat.current) val listName = task.listName?.takeIf { showListName && it.isNotBlank() } @@ -1046,7 +1047,7 @@ private fun AddSubtaskRow( modifier = modifier.fillMaxWidth().padding(horizontal = 16.dp).then(gap).revealOnFocus(), ) { Row( - modifier = Modifier.fillMaxWidth().heightIn(min = byDensity(52.dp, 48.dp)).padding(start = 12.dp, end = 8.dp), + modifier = Modifier.fillMaxWidth().heightIn(min = FloretDensity.nestedRowHeight).padding(start = 12.dp, end = 8.dp), verticalAlignment = Alignment.CenterVertically, ) { Spacer(Modifier.width(5.dp)) // the parents' colour-bar slot, kept for alignment @@ -1170,8 +1171,8 @@ private fun SubtaskRow( ) val interaction = remember { MutableInteractionSource() } val pressed by interaction.collectIsPressedAsState() - val full by animateDpAsState(if (pressed) 36.dp else 22.dp, reducibleSpec(spring()), label = "subFullCorner") - val small by animateDpAsState(if (pressed) 36.dp else 6.dp, reducibleSpec(spring()), label = "subSmallCorner") + val full by animateDpAsState(if (pressed) 36.dp else 22.dp, reducibleSpec(spring(visibilityThreshold = Dp.VisibilityThreshold)), label = "subFullCorner") + val small by animateDpAsState(if (pressed) 36.dp else 6.dp, reducibleSpec(spring(visibilityThreshold = Dp.VisibilityThreshold)), label = "subSmallCorner") val gap = if (lastInRun) Modifier else Modifier.padding(bottom = 2.dp) SwipeToDismissBox( state = dismissState, diff --git a/floret-kit b/floret-kit index 7d3b7b7..a7f8166 160000 --- a/floret-kit +++ b/floret-kit @@ -1 +1 @@ -Subproject commit 7d3b7b7e45e7f5c78a08afd5a2a1bd1eb72e4869 +Subproject commit a7f8166c4be0d791df965cbed4a556e2ad7a2882