From 37dc2b2f1e49571747903ddf44fe16f9d7bcd562 Mon Sep 17 00:00:00 2001 From: Yejun Su Date: Thu, 19 Mar 2026 13:55:08 +0800 Subject: [PATCH] feat(ui): add stop/abort button to web remote control When the agent is streaming, the send button becomes a red stop button that sends a { type: "stop" } WebSocket message. The server handles this by calling ctx.abort() to cancel the current agent operation. --- extensions/pi-remote-control/html.ts | 48 ++++++++++++++++++++++---- extensions/pi-remote-control/server.ts | 6 ++++ 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/extensions/pi-remote-control/html.ts b/extensions/pi-remote-control/html.ts index 8a54a89..29d2960 100644 --- a/extensions/pi-remote-control/html.ts +++ b/extensions/pi-remote-control/html.ts @@ -341,6 +341,11 @@ return /* html */ ` color: #fff; } #send-btn.ready:active { transform: scale(0.9); } + #send-btn.stop { + background: var(--tool-err); + color: #fff; + } + #send-btn.stop:active { transform: scale(0.9); } #send-btn:disabled { background: var(--border); color: var(--muted); @@ -352,6 +357,15 @@ return /* html */ ` height: 20px; fill: currentColor; } + #send-btn .icon-stop { + display: none; + width: 14px; + height: 14px; + background: #fff; + border-radius: 2px; + } + #send-btn.stop svg { display: none; } + #send-btn.stop .icon-stop { display: block; } #messages::-webkit-scrollbar { width: 6px; } #messages::-webkit-scrollbar-track { background: transparent; } @@ -369,7 +383,7 @@ return /* html */ `
- +