Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): keep agent widgets updated in the background #14861

Closedjakeleventhal(GitHub profile, opens in a new tab)wants to merge 8 commits intomain fromrefs/pull/14861/headopened View on GitHub

Showing 70 changed files with 164 additions and 4 deletions (loading 67).

x
0 of 70 viewed, 70 left
11 additions and 4 deletionsapps/mobile/modules/t3-agent-notifications/android/src/main/java/expo/modules/t3agentnotifications/AgentActivityPresentation.ktModified
View file
@@ -94,9 +94,11 @@
?: rows.count { ActivityPhase.forStatus(it.status)?.finished != true }
private val attentionCount = data["activity_attention_count"]?.toIntOrNull()?.coerceAtLeast(0)
?: rows.count { ActivityPhase.forStatus(it.status)?.needsUser == true }
+ private val workingCount = data["activity_working_count"]?.toIntOrNull()?.coerceAtLeast(0)
+ ?: (activeCount - attentionCount).coerceAtLeast(0)
private val failedCount = rows.count { it.status == ActivityPhase.FAILED.status }
- val threadCount =
- activeCount + rows.count { ActivityPhase.forStatus(it.status)?.finished == true }
+ val threadCount = data["activity_total_count"]?.toIntOrNull()?.coerceAtLeast(0)
+ ?: (activeCount + rows.count { ActivityPhase.forStatus(it.status)?.finished == true })
private val singleProject = rows.map { it.project }.distinct().size == 1
private val legacyBody = (0..4).mapNotNull { data["activity_line_$it"]?.take(300) }
.takeIf { it.isNotEmpty() }?.joinToString("\n")
@@ -109,7 +111,8 @@
attentionCount == 1 -> "1 needs you"
attentionCount > 1 -> "$attentionCount need you"
activeCount > 0 && failedCount > 0 -> "$failedCount failed"
- activeCount > 0 -> "$activeCount working"
+ workingCount > 0 -> "$workingCount working"
Resolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)
+ activeCount > 0 -> "$activeCount active"
failedCount > 0 -> "Finished, $failedCount failed"
else -> "All finished"
@@ -136,7 +139,11 @@
builder.setSubText(
listOfNotNull(