Skip to content

A personal agent with a browser, terminal, files, and work that keeps going built with CopilotKit and AG-UI.

TypeScript

fix: use the composer send control to stop replies

Jerel John Velarde6e503b61a4f3
diff --git a/apps/mobile/src/chat.tsx b/apps/mobile/src/chat.tsx
index 99f3fc4..1739392 100644
--- a/apps/mobile/src/chat.tsx
+++ b/apps/mobile/src/chat.tsx
@@ -298,6 +298,9 @@ export function ChatScreen({
function send() {
const text = draft.trim();
if (!text || !isReady || !loaded) return;
+ // A new submission can continue after Stop; held follow-ups still need explicit resume.
+ if (!busy && !agent.isRunning && !saveError && !queue.getSnapshot().pending.length)
+ queue.resume();
setShowResults(false);
const files = w.files.filter((f) => attachments.includes(f.id));
enqueue(
@@ -317,6 +320,7 @@ export function ChatScreen({
-1,
);
const visible = messages.filter((m) => m.role === "user" || m.role === "assistant");
+ const replying = busy || agent.isRunning;
return (
<View style={{ flex: 1 }}>
<ScrollView
@@ -593,14 +597,6 @@ export function ChatScreen({
)}
</View>
)}
- {(busy || agent.isRunning) && (
- <View style={[s.between, { paddingHorizontal: 12, paddingBottom: 8 }]}>
- <Text style={s.small}>You can keep sending messages</Text>
- <Button small icon={Square} onPress={() => void stop()}>
- Stop reply
- </Button>
- </View>
- )}
{picking && (
<Card style={{ marginBottom: 12, padding: 15 }}>
<Text style={s.heading}>Add a document</Text>
@@ -750,20 +746,28 @@ export function ChatScreen({
/>
<Pressable
accessibilityRole="button"
- accessibilityLabel="Send message"
- disabled={!draft.trim() || !loaded || !isReady}
- onPress={send}
+ accessibilityLabel={replying ? "Stop reply" : "Send message"}
+ disabled={!replying && (!draft.trim() || !loaded || !isReady)}
+ onPress={replying ? () => void stop() : send}
style={({ pressed }) => ({
width: 44,
height: 44,
borderRadius: 24,
- backgroundColor: draft.trim() ? colors.blue : "#F3F5F6",
+ backgroundColor: replying || draft.trim() ? colors.blue : "#F3F5F6",
alignItems: "center",
justifyContent: "center",
transform: [{ scale: pressed ? 0.94 : 1 }],
})}
>
- <ArrowUp size={25} strokeWidth={1.8} color={draft.trim() ? colors.text : "#9CB5C5"} />
+ {replying ? (
+ <Square size={18} fill={colors.text} strokeWidth={0} />
+ ) : (
+ <ArrowUp
+ size={25}
+ strokeWidth={1.8}
+ color={draft.trim() ? colors.text : "#9CB5C5"}
+ />
+ )}
</Pressable>
</View>
</View>
diff --git a/assets/openmuse-demo.gif b/assets/openmuse-demo.gif
index 9525c99..2d997e0 100644
Binary files a/assets/openmuse-demo.gif and b/assets/openmuse-demo.gif differ
diff --git a/assets/openmuse-mobile-demo.mp4 b/assets/openmuse-mobile-demo.mp4
index 0f9fbec..29f33b7 100644
Binary files a/assets/openmuse-mobile-demo.mp4 and b/assets/openmuse-mobile-demo.mp4 differ
diff --git a/assets/openmuse-web-demo.gif b/assets/openmuse-web-demo.gif
index fd528c5..24b9f6b 100644
Binary files a/assets/openmuse-web-demo.gif and b/assets/openmuse-web-demo.gif differ
diff --git a/assets/openmuse-web-demo.mp4 b/assets/openmuse-web-demo.mp4
index 62e9536..90b291a 100644
Binary files a/assets/openmuse-web-demo.mp4 and b/assets/openmuse-web-demo.mp4 differ
diff --git a/assets/openmuse-web-preview.png b/assets/openmuse-web-preview.png
index ec8d470..a99fb0c 100644
Binary files a/assets/openmuse-web-preview.png and b/assets/openmuse-web-preview.png differ