Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python

fix(tui): Show ellipsis when the content of /rewind is truncated

openJiuwen-bot979197e34f13
diff --git a/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/rewind.ts b/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/rewind.ts
index 91a99e6ab3..b2a85cc50e 100644
--- a/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/rewind.ts
+++ b/jiuwenswarm/channels/tui/frontend/src/core/commands/builtins/rewind.ts
@@ -123,9 +123,16 @@ export function createRewindCommand(): SlashCommand {
description: "Stay at current session (no change)",
},
];
+ const MAX_PREVIEW_LENGTH = 60;
+
for (const t of turns) {
- const desc = t.content_preview;
+ const rawDesc = t.content_preview.replace(/[\r\n]+/g, " ").trim();
+ const desc =
+ rawDesc.length > MAX_PREVIEW_LENGTH
+ ? rawDesc.slice(0, MAX_PREVIEW_LENGTH) + "…"
+ : rawDesc;
const details: string[] = [];
+
if (t.files && t.files.length > 0) {
for (const f of t.files) {
details.push(formatFileChange(f, workspaceDir));