A local-first multi-agent app development platform, built on PenguinHarness
fix(web): the memory-change card opens the memory list with a text action, not a second brain icon (#783)
Yaowei Zheng091200f65262
diff --git a/changelog/unreleased/2026-09-17-memory-card-text-action.md b/changelog/unreleased/2026-09-17-memory-card-text-action.mdnew file mode 100644index 00000000..bbf2744e--- /dev/null+++ b/changelog/unreleased/2026-09-17-memory-card-text-action.md@@ -0,0 +1,13 @@+# The memory-change card opens the memory list with a text action instead of a second brain icon++- **Date:** 2026-09-17+- **Type:** fix+- **Scope:** `web`+- **PR:** [#783](https://github.com/Prism-Shadow/penguin-harness/pull/783)++[中文版](2026-09-17-memory-card-text-action.zh.md)++After a Task updated memory, the card below the reply showed two brain icons: the card's own mark+on the left, and an icon-only button on the right that opened the Memory panel on its list. The+right-hand button is now the text **Open memory list**, styled like the rows' **View content**+hint: small gray text that darkens on hover, with no background. The card keeps one brain icon.diff --git a/changelog/unreleased/2026-09-17-memory-card-text-action.zh.md b/changelog/unreleased/2026-09-17-memory-card-text-action.zh.mdnew file mode 100644index 00000000..3e27e19f--- /dev/null+++ b/changelog/unreleased/2026-09-17-memory-card-text-action.zh.md@@ -0,0 +1,12 @@+# 记忆更新卡片以文字操作打开记忆列表,不再显示第二个记忆图标++- **Date:** 2026-09-17+- **Type:** fix+- **Scope:** `web`+- **PR:** [#783](https://github.com/Prism-Shadow/penguin-harness/pull/783)++[English](2026-09-17-memory-card-text-action.md)++Task 更新记忆后,回复下方的卡片此前显示两个记忆图标:左侧是卡片自身的标识,右侧是一个只有图标、用于打开+记忆面板列表的按钮。右侧按钮现改为文字「打开记忆列表」,样式与各行的「查看内容」提示一致:灰色小字,悬停+时加深,无背景。卡片只保留一个记忆图标。diff --git a/packages/web/src/features/chat/memory-changes-card.tsx b/packages/web/src/features/chat/memory-changes-card.tsxindex d600293f..6748fac5 100644--- a/packages/web/src/features/chat/memory-changes-card.tsx+++ b/packages/web/src/features/chat/memory-changes-card.tsx@@ -5,9 +5,9 @@* see lib/omni/memory-changes.ts for what qualifies and what is filtered).** Clicking a row opens the Memory side panel directly on that memory's content; the- * header's brain button opens the panel on its list. A changed file that was deleted in a- * later turn is filtered out (deletedKeys) — the row disappears here just as it does from- * the panel's list; the whole card hides when nothing survives.+ * header's "Open memory list" text action opens the panel on its list. A changed file that+ * was deleted in a later turn is filtered out (deletedKeys) — the row disappears here just as+ * it does from the panel's list; the whole card hides when nothing survives.*/import { useState } from "react";import { S } from "../../lib/strings";@@ -33,7 +33,7 @@ export function MemoryChangesCard({deletedKeys?: ReadonlySet<string>;/** Row click: open the Memory panel on this row's content; rows render as plain rows if this isn't wired up. */onLocateChange?: (row: MemoryChangeRow) => void;- /** Header button: open the Memory panel on its list; the button doesn't render if this isn't wired up. */+ /** Header text action: open the Memory panel on its list; the action doesn't render if this isn't wired up. */onOpenPanel?: () => void;}) {const [expanded, setExpanded] = useState(false);@@ -69,7 +69,9 @@ export function MemoryChangesCard({return (<div className="anim-msg my-3 overflow-hidden rounded-xl border border-gray-200 bg-white dark:border-gray-800 dark:bg-gray-900">{/* Header bar, mirroring the file-summary card: "icon + N memory updates", plus the one- card-level action (rows navigate to their own content, so this doesn't duplicate them). */}+ card-level action (rows navigate to their own content, so this doesn't duplicate them).+ The action is words, in the rows' own "View content" hint style: a brain glyph here+ would only repeat the card's own mark beside it, and say nothing of where it leads. */}<div className="flex items-center gap-2 border-b border-gray-100 bg-gray-50 px-3 py-2 dark:border-gray-800/60 dark:bg-gray-800/40"><GlyphIcon d={MEMORY_ICON} size={ICON_SIZE.rowLead} className="shrink-0 text-gray-400" /><span className="min-w-0 flex-1 truncate text-sm font-medium">@@ -78,12 +80,10 @@ export function MemoryChangesCard({{onOpenPanel && (<buttontype="button"- title={S.chat.memoryViewTitle}onClick={onOpenPanel}- className="flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center text-gray-400 transition-colors duration-150 hover:text-gray-600 dark:hover:text-gray-300"+ className="shrink-0 cursor-pointer text-xs text-gray-400 transition-colors duration-150 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300">- <GlyphIcon d={MEMORY_ICON} size={ICON_SIZE.inlineGlyph} />- <span className="sr-only">{S.chat.memoryViewTitle}</span>+ {S.chat.memoryOpenList}</button>)}</div>diff --git a/packages/web/src/lib/strings-en.ts b/packages/web/src/lib/strings-en.tsindex 6e07af71..7150e1ce 100644--- a/packages/web/src/lib/strings-en.ts+++ b/packages/web/src/lib/strings-en.ts@@ -2295,6 +2295,8 @@ Scenarios:memoryChangedMark: "Changed in this conversation",memoryContentUnavailable: "Content unavailable (the file may have been moved or deleted)",memoryRowOpen: "View content",+ /** The memory-change card header's text action: opens the Memory panel on its list (a visible label rather than a second brain glyph beside the card's own). */+ memoryOpenList: "Open memory list",memoryBack: "Back to the list",memoryEmptyAll: "No memory yet — say “remember …” in a chat to have the agent save one",/** Visible label on the Memory panel's header link (not a tooltip-only glyph): says what the click does and where it lands. */diff --git a/packages/web/src/lib/strings.ts b/packages/web/src/lib/strings.tsindex 202e8964..a615e1a5 100644--- a/packages/web/src/lib/strings.ts+++ b/packages/web/src/lib/strings.ts@@ -2291,6 +2291,8 @@ Benchmark:memoryChangedMark: "本次对话已更改",memoryContentUnavailable: "无法加载内容(文件可能已被移动或删除)",memoryRowOpen: "查看内容",+ /** The memory-change card header's text action: opens the Memory panel on its list (a visible label rather than a second brain glyph beside the card's own). */+ memoryOpenList: "打开记忆列表",memoryBack: "返回列表",memoryEmptyAll: "还没有任何记忆——在对话里说「记住……」即可让 agent 保存",/** Visible label on the Memory panel's header link (not a tooltip-only glyph): says what the click does and where it lands. */diff --git a/packages/web/test/memory-changes-card.test.ts b/packages/web/test/memory-changes-card.test.tsnew file mode 100644index 00000000..e7483814--- /dev/null+++ b/packages/web/test/memory-changes-card.test.ts@@ -0,0 +1,68 @@+/**+ * The memory-change card's header (src/features/chat/memory-changes-card.tsx): the card's+ * own brain mark leads it, and the action that opens the Memory panel on its list is words.+ * A second brain glyph there reads as a duplicate of the first rather than as a way into the+ * list, so the header carries exactly one memory mark whether or not the action is wired.+ *+ * react-dom/server static markup (node env, no DOM), as message-stream.test.ts renders.+ */+import { afterEach, describe, expect, it } from "vitest";+import { createElement } from "react";+import { renderToStaticMarkup } from "react-dom/server";+import { MemoryChangesCard } from "../src/features/chat/memory-changes-card";+import { MEMORY_ICON } from "../src/components/ui/icons";+import type { MemoryChangeRow } from "../src/lib/omni/memory-changes";+import { S, setActiveStrings, zh } from "../src/lib/strings";+import { en } from "../src/lib/strings-en";++const ROWS: MemoryChangeRow[] = [+ { scope: "user", file: "prefs.md", op: "write" },+ { scope: "workspace", scopeKey: "ws-1a2b", file: "conventions.md", op: "edit" },+];++const render = (onOpenPanel?: () => void) =>+ renderToStaticMarkup(+ createElement(MemoryChangesCard, {+ rows: ROWS,+ onLocateChange: () => {},+ ...(onOpenPanel ? { onOpenPanel } : {}),+ }),+ );++/** How many times the brain mark is drawn in the markup. */+const memoryMarks = (html: string) => html.split(`d="${MEMORY_ICON}"`).length - 1;++afterEach(() => {+ setActiveStrings(zh);+});++describe("MemoryChangesCard header", () => {+ it("opens the list through a text action, leaving the card's own brain mark the only one", () => {+ const html = render(() => {});+ expect(html).toMatch(/<button type="button"[^>]*>打开记忆列表<\/button>/);+ expect(memoryMarks(html)).toBe(1);+ });++ it("names the action in words the button shows, with no tooltip and no glyph beside them", () => {+ const html = render(() => {});+ // The header's action is the card's first button. Matched whole — attributes and content —+ // rather than pinned to the label, so a glyph creeping back inside it cannot make the+ // assertions below pass on a string that matched nothing.+ const action = html.match(/<button[\s\S]*?<\/button>/)?.[0] ?? null;+ expect(action).not.toBeNull();+ expect(action).toContain(S.chat.memoryOpenList);+ expect(action).not.toContain("title=");+ expect(action).not.toContain("<svg");+ });++ it("keeps the one mark and draws no action when nothing opens the panel", () => {+ const html = render();+ expect(html).not.toContain(S.chat.memoryOpenList);+ expect(memoryMarks(html)).toBe(1);+ });++ it("follows the UI language", () => {+ setActiveStrings(en);+ expect(render(() => {})).toMatch(/<button type="button"[^>]*>Open memory list<\/button>/);+ });+});