From c4bdd8fc4bc95b956088d5d7e114e0ac379fb87b Mon Sep 17 00:00:00 2001
From: RinZ27 <222222878+RinZ27@users.noreply.github.com>
Date: Tue, 10 Mar 2026 16:20:20 +0700
Subject: [PATCH 1/2] fix(ui): escape array content in cards and fix
double-escaping
---
packages/ui/src/panel/cards.ts | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/packages/ui/src/panel/cards.ts b/packages/ui/src/panel/cards.ts
index 00f254b..45ae0ca 100644
--- a/packages/ui/src/panel/cards.ts
+++ b/packages/ui/src/panel/cards.ts
@@ -18,7 +18,7 @@ interface CardOptions {
export function createCard({ icon, content, meta, type }: CardOptions): string {
const typeClass = type ? styles[type] : ''
const contentHtml = Array.isArray(content)
- ? `
${content.join('')}
`
+ ? `${content.map((line) => `${escapeHtml(line)}`).join('')}
`
: `${escapeHtml(content)}`
return `
@@ -40,13 +40,13 @@ export function createReflectionLines(reflection: {
}): string[] {
const lines: string[] = []
if (reflection.evaluation_previous_goal) {
- lines.push(`🔍 ${escapeHtml(reflection.evaluation_previous_goal)}
`)
+ lines.push(`🔍 ${reflection.evaluation_previous_goal}
`)
}
if (reflection.memory) {
- lines.push(`💾 ${escapeHtml(reflection.memory)}
`)
+ lines.push(`💾 ${reflection.memory}
`)
}
if (reflection.next_goal) {
- lines.push(`🎯 ${escapeHtml(reflection.next_goal)}
`)
+ lines.push(`🎯 ${reflection.next_goal}
`)
}
return lines
}
From c33b3d827887d6b03c21ef975c2585a7b0d53045 Mon Sep 17 00:00:00 2001
From: Simon <10131203+gaomeng1900@users.noreply.github.com>
Date: Wed, 11 Mar 2026 23:38:57 +0800
Subject: [PATCH 2/2] fix(ui): remove unnecessary tags
---
packages/ui/src/panel/cards.ts | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/packages/ui/src/panel/cards.ts b/packages/ui/src/panel/cards.ts
index 45ae0ca..0df52c2 100644
--- a/packages/ui/src/panel/cards.ts
+++ b/packages/ui/src/panel/cards.ts
@@ -40,13 +40,13 @@ export function createReflectionLines(reflection: {
}): string[] {
const lines: string[] = []
if (reflection.evaluation_previous_goal) {
- lines.push(`🔍 ${reflection.evaluation_previous_goal}
`)
+ lines.push(`🔍 ${reflection.evaluation_previous_goal}`)
}
if (reflection.memory) {
- lines.push(`💾 ${reflection.memory}
`)
+ lines.push(`💾 ${reflection.memory}`)
}
if (reflection.next_goal) {
- lines.push(`🎯 ${reflection.next_goal}
`)
+ lines.push(`🎯 ${reflection.next_goal}`)
}
return lines
}