From 8faaac3b89e52bc388fc7f295cf72b0ce3aedb89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Pokorn=C3=BD?= Date: Wed, 18 Nov 2026 06:25:36 +0100 Subject: [PATCH] fix(agent): force clearing focus on a tap in the Agent conversation (#2769) A tap on the conversation while the composer held focus could crash the app: FocusManager.clearFocus() without force walks the focused chain for a custom exit and throws IllegalArgumentException ("ActiveParent with no focused child") when a parent is ActiveParent with no active child. The forced path skips that walk and treats a missing child as cleared. Nothing in the Agent UI sets a custom focus exit, so forcing changes no behaviour. Co-authored-by: Jan Pokorny <4580066+JanPokorny@users.noreply.github.com> --- app/src/main/java/com/droiddeck/launcher/ui/AgentPage.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/droiddeck/launcher/ui/AgentPage.kt b/app/src/main/java/com/droiddeck/launcher/ui/AgentPage.kt index 0a02ebf9ba..cf9080417e 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/AgentPage.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/AgentPage.kt @@ -292,7 +292,8 @@ private fun AgentPageContent( awaitEachGesture { awaitFirstDown(requireUnconsumed = false, pass = PointerEventPass.Initial) if (panel == AgentPanel.MODEL || panel == AgentPanel.USAGE) panel = AgentPanel.NONE - if (composer.focused) focusManager.clearFocus() + // Forced: the unforced path walks the focus chain and throws ("ActiveParent with no focused child") when a tap lands while focus is moving. + if (composer.focused) focusManager.clearFocus(force = true) } }, list, following = !readingBack, onRevise = { composer.open() }, onSent = toLatest,