From 73fbd05a1230552bcef9834d3ee999ef19957693 Mon Sep 17 00:00:00 2001 From: Claudomator Agent Date: Mon, 6 Jul 2026 00:03:07 +0000 Subject: fix(widget): separate checkbox and row clickables to fix completeTask tap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In Glance 1.1.0 (RemoteViews), a parent Row with .clickable() silently overrides any nested child .clickable() — tapping the checkbox fired the detail-open action instead of CompleteTaskAction, producing no visible effect. Fix by splitting TaskRow into two sibling Boxes: a 24dp tap target wrapping the checkbox icon (routes to CompleteTaskAction) and a defaultWeight Box for the title (routes to actionStartActivity). No nesting, so both actions are independently reachable. Co-Authored-By: Claude Sonnet 4.6 --- .../java/org/terst/doot/widget/ui/DootWidget.kt | 60 ++++++++++++++-------- 1 file changed, 38 insertions(+), 22 deletions(-) (limited to 'android/app/src/main/java/org') diff --git a/android/app/src/main/java/org/terst/doot/widget/ui/DootWidget.kt b/android/app/src/main/java/org/terst/doot/widget/ui/DootWidget.kt index 0331928..d8f1140 100644 --- a/android/app/src/main/java/org/terst/doot/widget/ui/DootWidget.kt +++ b/android/app/src/main/java/org/terst/doot/widget/ui/DootWidget.kt @@ -226,27 +226,36 @@ fun TaskRow(task: WidgetItem) { putExtra(TaskDetailActivity.EXTRA_COMPLETABLE, task.completable) addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) } + // Split into two sibling clickable regions to avoid the Glance/RemoteViews limitation + // where a parent clickable silently overrides a nested child clickable. The checkbox + // gets its own non-overlapping Box; the title region handles the detail-open action. Row( modifier = GlanceModifier .fillMaxWidth() - .padding(horizontal = 8.dp, vertical = 5.dp) - .clickable(actionStartActivity(detailIntent)), + .padding(horizontal = 8.dp, vertical = 5.dp), verticalAlignment = Alignment.CenterVertically ) { if (task.completable) { - Image( - provider = ImageProvider(org.terst.doot.widget.R.drawable.ic_checkbox_empty), - contentDescription = "Complete ${task.title}", - colorFilter = ColorFilter.tint(ColorProvider(sourceColor(task.source))), - modifier = GlanceModifier.size(14.dp).clickable( - actionRunCallback( - actionParametersOf( - CompleteTaskAction.idKey to task.id, - CompleteTaskAction.sourceKey to task.source + Box( + modifier = GlanceModifier + .size(24.dp) + .clickable( + actionRunCallback( + actionParametersOf( + CompleteTaskAction.idKey to task.id, + CompleteTaskAction.sourceKey to task.source + ) ) - ) + ), + contentAlignment = Alignment.Center + ) { + Image( + provider = ImageProvider(org.terst.doot.widget.R.drawable.ic_checkbox_empty), + contentDescription = "Complete ${task.title}", + colorFilter = ColorFilter.tint(ColorProvider(sourceColor(task.source))), + modifier = GlanceModifier.size(14.dp) ) - ) + } } else { Box( modifier = GlanceModifier @@ -255,15 +264,22 @@ fun TaskRow(task: WidgetItem) { ) {} } - Text( - text = task.title, - style = TextStyle( - color = ColorProvider(Color(0xFFDDDDDD.toInt())), - fontSize = 14.sp - ), - modifier = GlanceModifier.padding(start = 8.dp), - maxLines = 1 - ) + Box( + modifier = GlanceModifier + .defaultWeight() + .clickable(actionStartActivity(detailIntent)) + .padding(start = 8.dp), + contentAlignment = Alignment.CenterStart + ) { + Text( + text = task.title, + style = TextStyle( + color = ColorProvider(Color(0xFFDDDDDD.toInt())), + fontSize = 14.sp + ), + maxLines = 1 + ) + } } } -- cgit v1.2.3