Skip to content

A personal assistant that lives on your desktop, remembers what matters, and can use your Mac for you.

TypeScript

fix(computer): mark no glow for an empty type

Alan Buscaglia533f882951b0
diff --git a/apps/desktop/src-tauri/src/computer/mcp.rs b/apps/desktop/src-tauri/src/computer/mcp.rs
index c8700ca..1bfaf20 100644
--- a/apps/desktop/src-tauri/src/computer/mcp.rs
+++ b/apps/desktop/src-tauri/src/computer/mcp.rs
@@ -699,7 +699,10 @@ impl Helper {
self.post(epoch, InputEvent::Text(chunk))?;
}
}
- (self.glow)(Mark::Key);
+ // The glow marks posted input only; an empty text posts none.
+ if !typed.is_empty() {
+ (self.glow)(Mark::Key);
+ }
Ok((format!("{action} in {target}: done."), SETTLE_MS))
}
Tool::Key { combo } => {
@@ -1721,6 +1724,15 @@ mod tests {
);
}
+ #[test]
+ fn typing_nothing_marks_nothing() {
+ let rig = rig();
+ rig.ready();
+ assert!(!is_error(&rig.call("type", json!({"text": ""}))));
+ assert!(rig.desktop.events().is_empty());
+ assert_eq!(marks(&rig), vec![]);
+ }
+
#[test]
fn refused_declined_and_stopped_actions_mark_nothing() {
// Declined: a risky click the user says no to.