Skip to content

Open source CapCut alternative.

TypeScript

fix(app): clear stuck "Listening…" notch card after voice dismiss [rebuild]

David Lef48787da6faa
diff --git a/apps/Donkey/Sources/DonkeyContracts/UserQueryContracts.swift b/apps/Donkey/Sources/DonkeyContracts/UserQueryContracts.swift
index 5757c5aa..18f6ef76 100644
--- a/apps/Donkey/Sources/DonkeyContracts/UserQueryContracts.swift
+++ b/apps/Donkey/Sources/DonkeyContracts/UserQueryContracts.swift
@@ -28,8 +28,13 @@ public enum UserQueryCopy {
public static func isConversationDisplayText(_ text: String) -> Bool {
let normalizedText = normalizedDisplayText(text)
+ // A transient composer placeholder ("Listening...", "Transcribing...", etc.) is composer chrome,
+ // never persistent conversation content. Excluding it here is the single chokepoint that keeps a
+ // placeholder stranded in `promptText` — after a dismiss, a dropped mic release, or an empty
+ // transcript — from masquerading as a stuck "Needs attention" card the user cannot clear.
return !normalizedText.isEmpty &&
- normalizedText != defaultPromptPlaceholder
+ normalizedText != defaultPromptPlaceholder &&
+ !transientComposerPlaceholders.contains(normalizedText)
}
}
diff --git a/apps/Donkey/Tests/DonkeyRuntimeTests/UserQueryCopyTests.swift b/apps/Donkey/Tests/DonkeyRuntimeTests/UserQueryCopyTests.swift
index bc65b51b..8d3aa955 100644
--- a/apps/Donkey/Tests/DonkeyRuntimeTests/UserQueryCopyTests.swift
+++ b/apps/Donkey/Tests/DonkeyRuntimeTests/UserQueryCopyTests.swift
@@ -17,6 +17,16 @@ struct UserQueryCopyTests {
#expect(UserQueryCopy.isConversationDisplayText("Open Safari"))
}
+ /// A transient voice placeholder stranded in `promptText` (e.g. dismissing mid-listen) must not read as
+ /// conversation content, or the notch shows a "Listening... / Needs attention" card with no way to clear it.
+ @Test
+ func transientVoicePlaceholdersAreNeverTaskDisplayText() {
+ for placeholder in ["Listening...", "Transcribing...", "No voice captured", "Voice unavailable"] {
+ #expect(!UserQueryCopy.isConversationDisplayText(placeholder))
+ #expect(!UserQueryCopy.isConversationDisplayText(" \(placeholder) "))
+ }
+ }
+
@Test
func composerPlaceholderDoesNotReuseTaskOrResultText() {
#expect(