Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit 56da141

Browse files
committed
feat(ui): improve write_stdin, terminate_session, list_sessions rendering in ChatRow
- Add proper UI cases for write_stdin showing session ID and input chars - Add terminate_session rendering with termination status - Add list_sessions rendering with sessions table - Add i18n translations for all stdin operations
1 parent cb28f75 commit 56da141

2 files changed

Lines changed: 83 additions & 0 deletions

File tree

webview-ui/src/components/chat/ChatRow.tsx

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ import {
7171
Split,
7272
ArrowRight,
7373
Check,
74+
OctagonX,
7475
} from "lucide-react"
7576
import { cn } from "@/lib/utils"
7677
import { PathTooltip } from "../ui/PathTooltip"
@@ -992,6 +993,80 @@ export const ChatRowContent = ({
992993
)}
993994
</>
994995
)
996+
case "write_stdin": {
997+
const stdinTool = tool as any
998+
const sessionId = stdinTool.session_id
999+
const chars = stdinTool.chars || ""
1000+
const displayChars = chars.length > 30 ? chars.slice(0, 30) + "..." : chars
1001+
const escapedChars = displayChars.replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t")
1002+
return (
1003+
<>
1004+
<div style={headerStyle}>
1005+
<TerminalSquare className="size-4" aria-label="Terminal stdin icon" />
1006+
<span style={{ fontWeight: "bold" }}>
1007+
{chars
1008+
? t("chat:stdinOperations.sentToSession", {
1009+
sessionId,
1010+
chars: escapedChars,
1011+
})
1012+
: t("chat:stdinOperations.polledSession", { sessionId })}
1013+
</span>
1014+
</div>
1015+
{stdinTool.content && (
1016+
<div className="pl-6">
1017+
<CodeAccordian
1018+
code={stdinTool.content}
1019+
language="shell-session"
1020+
isExpanded={isExpanded}
1021+
onToggleExpand={handleToggleExpand}
1022+
/>
1023+
</div>
1024+
)}
1025+
</>
1026+
)
1027+
}
1028+
case "terminate_session": {
1029+
const terminateTool = tool as any
1030+
const sessionId = terminateTool.session_id
1031+
return (
1032+
<>
1033+
<div style={headerStyle}>
1034+
<OctagonX className="size-4" aria-label="Terminate session icon" />
1035+
<span style={{ fontWeight: "bold" }}>
1036+
{message.type === "ask"
1037+
? t("chat:stdinOperations.wantsToTerminate", { sessionId })
1038+
: t("chat:stdinOperations.didTerminate", { sessionId })}
1039+
</span>
1040+
</div>
1041+
{terminateTool.content && (
1042+
<div className="pl-6 text-muted-foreground">{terminateTool.content}</div>
1043+
)}
1044+
</>
1045+
)
1046+
}
1047+
case "list_sessions":
1048+
return (
1049+
<>
1050+
<div style={headerStyle}>
1051+
<TerminalSquare className="size-4" aria-label="List sessions icon" />
1052+
<span style={{ fontWeight: "bold" }}>
1053+
{message.type === "ask"
1054+
? t("chat:stdinOperations.wantsToListSessions")
1055+
: t("chat:stdinOperations.didListSessions")}
1056+
</span>
1057+
</div>
1058+
{tool.content && (
1059+
<div className="pl-6">
1060+
<CodeAccordian
1061+
code={tool.content}
1062+
language="markdown"
1063+
isExpanded={isExpanded}
1064+
onToggleExpand={handleToggleExpand}
1065+
/>
1066+
</div>
1067+
)}
1068+
</>
1069+
)
9951070
default:
9961071
return null
9971072
}

webview-ui/src/i18n/locales/en/chat.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,5 +498,13 @@
498498
},
499499
"readCommandOutput": {
500500
"title": "Roo read command output"
501+
},
502+
"stdinOperations": {
503+
"sentToSession": "Sent \"{{chars}}\" to session {{sessionId}}",
504+
"polledSession": "Polled session {{sessionId}}",
505+
"wantsToTerminate": "Wants to terminate session {{sessionId}}",
506+
"didTerminate": "Terminated session {{sessionId}}",
507+
"wantsToListSessions": "Wants to list active sessions",
508+
"didListSessions": "Listed active sessions"
501509
}
502510
}

0 commit comments

Comments
 (0)