feat: show Magic Notes update times
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: 魔法笔记左侧列表现在显示每篇笔记的本地化更新时间,便于快速找到最近修改的内容。
This commit is contained in:
@@ -626,6 +626,7 @@ GoodBuddy 是可调整窗口大小的桌面应用。响应式设计优先保证
|
||||
- “笔记 / 待办”属于同一工作台内的同级内容面板,使用 `PageTabs` 的 `segmented` 视觉变体,与模型设置的分段控件保持同一外观。
|
||||
- 页签切换保留 `tablist`、`tab` 和 `tabpanel` 语义;待办状态仍使用独立的 `SegmentedControl`,不得与内容页签合并。
|
||||
- 笔记编辑器保留 Quill 原生列表快捷输入:输入 `-`、`*`、`1.`、`[ ]` 或 `[x]` 后按空格,分别转换为项目符号、编号或待办清单。快捷输入只生成现有 Delta 富文本,不引入 Markdown 源码模式、第二套持久化格式或第三方 Markdown 插件;编辑区附近持续提供简短提示。
|
||||
- 左侧笔记列表依次显示标题、最多两行内容预览,以及同一行的记录数和本地化更新时间。记录数靠左、更新时间靠右,窄宽度下均保持单行省略,不挤压标题或扩大列表栏。
|
||||
- 左侧“魔法笔记”入口可显示未完成待办数量。数量为 0 时隐藏徽标,超过 99 时显示 `99+`,可访问名称仍说明精确数量;勾选、取消勾选以及 Agent / MCP 对笔记清单的写入都必须刷新数量。
|
||||
- 未完成待办徽标的高度不得超过主导航图标;数量从 0 变为可见或再次隐藏时,主导航项行高和相邻菜单位置必须保持不变。
|
||||
- 在待办面板勾选或取消勾选后,当前缓存中的源笔记正文必须立即同步对应清单状态,不得依赖离开工作区后重新加载。
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1657,12 +1657,21 @@ export function MagicNotesWorkspace({
|
||||
{note.preview || t('notes.noPreview')}
|
||||
</span>
|
||||
<span className="magic-note-list-item__meta">
|
||||
{t(
|
||||
note.entryCount === 1
|
||||
? 'notes.entryCountOne'
|
||||
: 'notes.entryCountOther',
|
||||
{ count: note.entryCount }
|
||||
)}
|
||||
<span>
|
||||
{t(
|
||||
note.entryCount === 1
|
||||
? 'notes.entryCountOne'
|
||||
: 'notes.entryCountOther',
|
||||
{ count: note.entryCount }
|
||||
)}
|
||||
</span>
|
||||
<time dateTime={note.updatedAt}>
|
||||
{t('notes.updatedAt', {
|
||||
date: dateFormatter.format(
|
||||
new Date(note.updatedAt)
|
||||
)
|
||||
})}
|
||||
</time>
|
||||
</span>
|
||||
</button>
|
||||
))
|
||||
|
||||
@@ -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.',
|
||||
|
||||
@@ -77,6 +77,7 @@ export const magicNotes = {
|
||||
noPreview: '还没有记录',
|
||||
entryCountOne: '{{count}} 条记录',
|
||||
entryCountOther: '{{count}} 条记录',
|
||||
updatedAt: '更新于 {{date}}',
|
||||
emptySelectionTitle: '还没有选择笔记',
|
||||
emptySelectionDescription: '从左侧选择笔记,或新建一篇笔记开始记录。',
|
||||
newEntryLabel: '新记录内容',
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user