feat: show incomplete Magic Notes todo counts

Magic Notes can now show a default-on incomplete todo badge in the primary
navigation. The badge hides at zero, caps its visual label at 99+ while
retaining the exact accessible count, and refreshes after user or Agent/MCP
note changes.

Platform Features > Magic Notes includes a persistent switch that hides only
the count without changing notes or the Magic Notes entry. Existing settings
migrate with the count enabled.

Release note: 左侧“魔法笔记”入口现在可显示未完成待办数量;可在“平台功能 → 魔法笔记”中关闭,超过 99 项显示“99+”。
This commit is contained in:
mesalogo
2026-08-22 08:32:57 +08:00
parent fee4686750
commit fb51793595
25 changed files with 538 additions and 25 deletions
@@ -30,6 +30,7 @@ const applicationPreferencesSchema = z
updateSource: updateSourceSchema,
modelDownloadSource: modelDownloadSourceSchema,
magicNotesEnabled: z.boolean(),
magicNotesShowIncompleteTodoCount: z.boolean(),
magicNoteCommentMode: magicNoteCommentModeSchema,
magicNoteCommentFormat: magicNoteCommentFormatSchema
})
+3
View File
@@ -63,6 +63,7 @@ import type {
MagicNotesSnapshot,
MagicNoteUpdateInput,
MagicTodoItem,
MagicTodoStatus,
MagicTodoUpdateInput,
MagicTodoUpdateResult,
MagicTodosSnapshot
@@ -1703,6 +1704,7 @@ export type DesktopApi = {
options: MagicNoteAnalysisOptions
) => Promise<MagicNoteDraftAnalysis>
listTodos: () => Promise<MagicTodosSnapshot>
getTodoStatus: () => Promise<MagicTodoStatus>
updateTodo: (
input: MagicTodoUpdateInput
) => Promise<MagicTodoUpdateResult>
@@ -1713,6 +1715,7 @@ export type DesktopApi = {
onAnalysisEvent: (
listener: (event: MagicNoteAnalysisStreamEvent) => void
) => () => void
onTodoStatusChanged: (listener: () => void) => () => void
}
knowledge: {
getSnapshot: (libraryId?: string) => Promise<KnowledgeSnapshot>
@@ -136,6 +136,7 @@ describe('GoodBuddy configuration contracts', () => {
updateSource: 'github',
modelDownloadSource: 'modelscope',
magicNotesEnabled: true,
magicNotesShowIncompleteTodoCount: true,
magicNoteCommentMode: 'immediate',
magicNoteCommentFormat: 'combined'
},
+2
View File
@@ -178,6 +178,8 @@ export const ipcChannels = {
magicNotesAnalyzeDraft: 'magic-notes:analyze-draft',
magicNotesAnalysisEvent: 'magic-notes:analysis-event',
magicTodosList: 'magic-todos:list',
magicTodosStatus: 'magic-todos:status',
magicTodosStatusChanged: 'magic-todos:status-changed',
magicTodosUpdate: 'magic-todos:update',
magicTodosAnalyze: 'magic-todos:analyze',
knowledgeSnapshot: 'knowledge:snapshot',
+4
View File
@@ -438,6 +438,10 @@ export type MagicTodoUpdateResult = {
note: MagicNoteDetail
}
export type MagicTodoStatus = {
incompleteCount: number
}
export type MagicTodosSnapshot = {
todos: MagicTodoItem[]
}