From 30b9912dede886d5bfba75a708a41d35ada2e418 Mon Sep 17 00:00:00 2001 From: matevip Date: Tue, 21 Apr 2026 04:58:39 +0800 Subject: [PATCH] =?UTF-8?q?refactor(ui):=20redesign=20Memory=20view=20?= =?UTF-8?q?=E2=80=94=20follow=20mc-page-shell=20design=20system?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mateclaw-ui/src/i18n/locales/en-US.ts | 2 + mateclaw-ui/src/i18n/locales/zh-CN.ts | 4 +- .../views/Memory/components/DreamTimeline.vue | 167 ++++++++++-------- mateclaw-ui/src/views/Memory/index.vue | 146 +++++++++++---- 4 files changed, 211 insertions(+), 108 deletions(-) diff --git a/mateclaw-ui/src/i18n/locales/en-US.ts b/mateclaw-ui/src/i18n/locales/en-US.ts index d803774a..bfef5adf 100644 --- a/mateclaw-ui/src/i18n/locales/en-US.ts +++ b/mateclaw-ui/src/i18n/locales/en-US.ts @@ -1782,7 +1782,9 @@ export default { }, }, memory: { + kicker: 'Memory', title: 'Memory', + desc: 'What your Agent thinks about, remembers, and lets go.', selectAgent: 'Select Agent', selectAgentHint: 'Select an agent to view its memory', tabTimeline: 'Dream Timeline', diff --git a/mateclaw-ui/src/i18n/locales/zh-CN.ts b/mateclaw-ui/src/i18n/locales/zh-CN.ts index bfa32ea1..b543821a 100644 --- a/mateclaw-ui/src/i18n/locales/zh-CN.ts +++ b/mateclaw-ui/src/i18n/locales/zh-CN.ts @@ -1792,7 +1792,9 @@ export default { }, }, memory: { - title: '记忆管理', + kicker: 'Memory', + title: '记忆', + desc: '你的 Agent 在想什么、记住了什么、遗忘了什么。', selectAgent: '选择 Agent', selectAgentHint: '请先选择一个 Agent 查看其记忆', tabTimeline: 'Dream 时间线', diff --git a/mateclaw-ui/src/views/Memory/components/DreamTimeline.vue b/mateclaw-ui/src/views/Memory/components/DreamTimeline.vue index 1c1607c3..e7718499 100644 --- a/mateclaw-ui/src/views/Memory/components/DreamTimeline.vue +++ b/mateclaw-ui/src/views/Memory/components/DreamTimeline.vue @@ -1,47 +1,54 @@ @@ -79,14 +86,17 @@ function selectReport(report: DreamReportItem) { store.fetchReport(props.agentId, report.id) } -function modeTagType(mode: string) { - return mode === 'FOCUSED' ? 'warning' : 'info' -} - -function formatTime(isoStr: string) { +function formatRelativeTime(isoStr: string) { if (!isoStr) return '' const d = new Date(isoStr) - return d.toLocaleString() + const now = new Date() + const diffMs = now.getTime() - d.getTime() + const diffH = Math.floor(diffMs / 3600000) + if (diffH < 1) return 'just now' + if (diffH < 24) return `${diffH}h ago` + const diffD = Math.floor(diffH / 24) + if (diffD < 7) return `${diffD}d ago` + return d.toLocaleDateString() } function truncate(str: string, max: number) { @@ -96,72 +106,91 @@ function truncate(str: string, max: number) { diff --git a/mateclaw-ui/src/views/Memory/index.vue b/mateclaw-ui/src/views/Memory/index.vue index 3bdce9b2..46f26e6b 100644 --- a/mateclaw-ui/src/views/Memory/index.vue +++ b/mateclaw-ui/src/views/Memory/index.vue @@ -1,35 +1,61 @@