From 8e08ab0bac906962d97adfcecd3bd4df57bf44f6 Mon Sep 17 00:00:00 2001 From: mesalogo Date: Sun, 30 Aug 2026 10:09:39 +0800 Subject: [PATCH] feat: show Magic Notes update times MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Magic Notes list previously showed only each title, content preview, and entry count, making similarly named or recently changed notes harder to scan. Each note now shows its localized update time beside the entry count, with a semantic timestamp and bounded single-line layout for the narrow list pane. Release note: 魔法笔记左侧列表现在显示每篇笔记的本地化更新时间,便于快速找到最近修改的内容。 --- UI-DESIGN.md | 1 + src/renderer/src/MagicNotesWorkspace.test.tsx | 5 +++++ src/renderer/src/MagicNotesWorkspace.tsx | 21 +++++++++++++------ .../src/i18n/locales/en-US/magicNotes.ts | 1 + .../src/i18n/locales/zh-CN/magicNotes.ts | 1 + src/renderer/src/styles.css | 16 ++++++++++++++ 6 files changed, 39 insertions(+), 6 deletions(-) diff --git a/UI-DESIGN.md b/UI-DESIGN.md index 996b18e7..dcf5eb6f 100644 --- a/UI-DESIGN.md +++ b/UI-DESIGN.md @@ -626,6 +626,7 @@ GoodBuddy 是可调整窗口大小的桌面应用。响应式设计优先保证 - “笔记 / 待办”属于同一工作台内的同级内容面板,使用 `PageTabs` 的 `segmented` 视觉变体,与模型设置的分段控件保持同一外观。 - 页签切换保留 `tablist`、`tab` 和 `tabpanel` 语义;待办状态仍使用独立的 `SegmentedControl`,不得与内容页签合并。 - 笔记编辑器保留 Quill 原生列表快捷输入:输入 `-`、`*`、`1.`、`[ ]` 或 `[x]` 后按空格,分别转换为项目符号、编号或待办清单。快捷输入只生成现有 Delta 富文本,不引入 Markdown 源码模式、第二套持久化格式或第三方 Markdown 插件;编辑区附近持续提供简短提示。 +- 左侧笔记列表依次显示标题、最多两行内容预览,以及同一行的记录数和本地化更新时间。记录数靠左、更新时间靠右,窄宽度下均保持单行省略,不挤压标题或扩大列表栏。 - 左侧“魔法笔记”入口可显示未完成待办数量。数量为 0 时隐藏徽标,超过 99 时显示 `99+`,可访问名称仍说明精确数量;勾选、取消勾选以及 Agent / MCP 对笔记清单的写入都必须刷新数量。 - 未完成待办徽标的高度不得超过主导航图标;数量从 0 变为可见或再次隐藏时,主导航项行高和相邻菜单位置必须保持不变。 - 在待办面板勾选或取消勾选后,当前缓存中的源笔记正文必须立即同步对应清单状态,不得依赖离开工作区后重新加载。 diff --git a/src/renderer/src/MagicNotesWorkspace.test.tsx b/src/renderer/src/MagicNotesWorkspace.test.tsx index 44f932a6..38898372 100644 --- a/src/renderer/src/MagicNotesWorkspace.test.tsx +++ b/src/renderer/src/MagicNotesWorkspace.test.tsx @@ -399,6 +399,11 @@ describe('MagicNotesWorkspace', () => { expect( screen.getByRole('button', { name: /发布笔记/ }) ).toHaveAttribute('aria-pressed', 'true') + const updatedTime = screen + .getByRole('button', { name: /发布笔记/ }) + .querySelector('time') + expect(updatedTime).toHaveAttribute('datetime', detail.updatedAt) + expect(updatedTime).toHaveTextContent('更新于') fireEvent.click(screen.getByRole('tab', { name: '待办' })) expect(screen.getByText('准备演示')).toBeInTheDocument() const selectedTodoButton = screen diff --git a/src/renderer/src/MagicNotesWorkspace.tsx b/src/renderer/src/MagicNotesWorkspace.tsx index f5e85cd0..eedd6268 100644 --- a/src/renderer/src/MagicNotesWorkspace.tsx +++ b/src/renderer/src/MagicNotesWorkspace.tsx @@ -1657,12 +1657,21 @@ export function MagicNotesWorkspace({ {note.preview || t('notes.noPreview')} - {t( - note.entryCount === 1 - ? 'notes.entryCountOne' - : 'notes.entryCountOther', - { count: note.entryCount } - )} + + {t( + note.entryCount === 1 + ? 'notes.entryCountOne' + : 'notes.entryCountOther', + { count: note.entryCount } + )} + + )) diff --git a/src/renderer/src/i18n/locales/en-US/magicNotes.ts b/src/renderer/src/i18n/locales/en-US/magicNotes.ts index ac3b6b97..509698ff 100644 --- a/src/renderer/src/i18n/locales/en-US/magicNotes.ts +++ b/src/renderer/src/i18n/locales/en-US/magicNotes.ts @@ -82,6 +82,7 @@ export const magicNotes = { noPreview: 'No entries yet', entryCountOne: '{{count}} entry', entryCountOther: '{{count}} entries', + updatedAt: 'Updated {{date}}', emptySelectionTitle: 'No note selected', emptySelectionDescription: 'Select a note on the left, or create a note to start writing.', diff --git a/src/renderer/src/i18n/locales/zh-CN/magicNotes.ts b/src/renderer/src/i18n/locales/zh-CN/magicNotes.ts index 76a836c3..800d593e 100644 --- a/src/renderer/src/i18n/locales/zh-CN/magicNotes.ts +++ b/src/renderer/src/i18n/locales/zh-CN/magicNotes.ts @@ -77,6 +77,7 @@ export const magicNotes = { noPreview: '还没有记录', entryCountOne: '{{count}} 条记录', entryCountOther: '{{count}} 条记录', + updatedAt: '更新于 {{date}}', emptySelectionTitle: '还没有选择笔记', emptySelectionDescription: '从左侧选择笔记,或新建一篇笔记开始记录。', newEntryLabel: '新记录内容', diff --git a/src/renderer/src/styles.css b/src/renderer/src/styles.css index 96c12725..cf8d57d8 100644 --- a/src/renderer/src/styles.css +++ b/src/renderer/src/styles.css @@ -1609,8 +1609,24 @@ } .magic-note-list-item__meta { + display: flex; + min-width: 0; + align-items: center; + justify-content: space-between; color: var(--text-muted); font-size: var(--font-caption); + gap: var(--space-2); +} + +.magic-note-list-item__meta > :where(span, time) { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.magic-note-list-item__meta time { + flex-shrink: 1; + text-align: right; } .magic-notes-stream-pane {