From 330c0c61b6edb9bdcb6e195910cc04eaac802426 Mon Sep 17 00:00:00 2001 From: Antigravity Date: Sun, 10 May 2026 18:43:13 +0000 Subject: [PATCH] feat: standardize UI theme, fix dark mode consistency, and implement editorial tags --- memento-note/app/(main)/layout.tsx | 4 +- memento-note/app/actions/notes.ts | 5 + memento-note/app/api/chat/route.ts | 12 +- memento-note/app/globals.css | 14 +- memento-note/components/ai-chat.tsx | 14 +- .../auto-label-suggestion-dialog.tsx | 107 +++++++----- .../components/contextual-ai-chat.tsx | 59 ++++++- memento-note/components/ghost-tags.tsx | 116 ++++++------- .../hierarchical-notebook-selector.tsx | 10 +- memento-note/components/home-client.tsx | 163 ++++++++++++++++-- memento-note/components/label-badge.tsx | 69 ++++---- .../components/label-management-dialog.tsx | 22 +-- memento-note/components/label-manager.tsx | 62 +++---- .../note-editor/note-content-area.tsx | 103 +++-------- .../note-editor/note-editor-context.tsx | 138 ++++++--------- .../note-editor/note-editor-dialog.tsx | 2 + .../note-editor/note-editor-full-page.tsx | 39 ++++- .../note-editor/note-editor-toolbar.tsx | 68 ++------ .../note-editor/note-metadata-section.tsx | 10 +- memento-note/components/note-editor/types.ts | 48 +----- .../components/notes-editorial-view.tsx | 23 ++- .../components/settings/SettingsNav.tsx | 4 +- memento-note/components/sidebar.tsx | 46 +++-- memento-note/lib/ai/tools/note-search.tool.ts | 4 +- memento-note/lib/types.ts | 1 + 25 files changed, 640 insertions(+), 503 deletions(-) diff --git a/memento-note/app/(main)/layout.tsx b/memento-note/app/(main)/layout.tsx index c06ba40..b422057 100644 --- a/memento-note/app/(main)/layout.tsx +++ b/memento-note/app/(main)/layout.tsx @@ -31,12 +31,12 @@ export default async function MainLayout({ return ( {/* No top-bar header — sidebar-only navigation (architectural-grid design) */} -
+
}> -
+
{children}
diff --git a/memento-note/app/actions/notes.ts b/memento-note/app/actions/notes.ts index 7f2d8a4..7fdcd49 100644 --- a/memento-note/app/actions/notes.ts +++ b/memento-note/app/actions/notes.ts @@ -932,6 +932,11 @@ export async function updateNote(id: string, data: { } } + if (data.labels !== undefined) { + const refreshed = await prisma.note.findUnique({ where: { id } }) + if (refreshed) return parseNote(refreshed) + } + return parseNote(note) } catch (error) { console.error('Error updating note:', error) diff --git a/memento-note/app/api/chat/route.ts b/memento-note/app/api/chat/route.ts index 365c1f7..253d955 100644 --- a/memento-note/app/api/chat/route.ts +++ b/memento-note/app/api/chat/route.ts @@ -263,13 +263,21 @@ Content: ${noteContext.content || '(empty)'} Focus ONLY on this note unless asked otherwise.` } - const systemPrompt = `${prompts.system}\n${copilotContext}\n\n${contextBlock}\n\n## LANGUAGE RULE (MANDATORY)\nYou MUST respond in ${lang === 'en' ? 'English' : lang === 'fr' ? 'French' : lang === 'fa' ? 'Persian (Farsi)' : lang === 'es' ? 'Spanish' : 'English'}.` + // Notebook scope directive — tells the AI to stay within the selected notebook + let notebookScopeDirective = '' + if (notebookId) { + const scopedNotebook = await prisma.notebook.findUnique({ where: { id: notebookId }, select: { name: true } }).catch(() => null) + const notebookName = scopedNotebook?.name || notebookId + notebookScopeDirective = `\n\n## NOTEBOOK SCOPE\nThe user has scoped this conversation to the notebook "${notebookName}". When using the note_search tool, ALWAYS pass notebookId="${notebookId}" to restrict results to this notebook. Only reference notes from this notebook unless the user explicitly asks otherwise.` + } + + const systemPrompt = `${prompts.system}\n${copilotContext}${notebookScopeDirective}\n\n${contextBlock}\n\n## LANGUAGE RULE (MANDATORY)\nYou MUST respond in ${lang === 'en' ? 'English' : lang === 'fr' ? 'French' : lang === 'fa' ? 'Persian (Farsi)' : lang === 'es' ? 'Spanish' : 'English'}.` // 6. Execute stream const sysConfig = await getSystemConfig() const chatTools = noteContext ? toolRegistry.buildToolsForChat({ userId, config: sysConfig, webSearch, webOnly: true }) - : toolRegistry.buildToolsForChat({ userId, config: sysConfig, webSearch }) + : toolRegistry.buildToolsForChat({ userId, config: sysConfig, webSearch, notebookId: notebookId || undefined }) const provider = getChatProvider(sysConfig) const result = await streamText({ diff --git a/memento-note/app/globals.css b/memento-note/app/globals.css index 75a0617..e821ee4 100644 --- a/memento-note/app/globals.css +++ b/memento-note/app/globals.css @@ -25,10 +25,10 @@ --color-background-dark: #202020; /* Design tokens from architectural-grid 10 */ - --color-ink: #1C1C1C; - --color-paper: #F2F0E9; - --color-muted-ink: rgba(28, 28, 28, 0.6); - --color-concrete: #8D8D8D; + --color-ink: var(--ink); + --color-paper: var(--paper); + --color-muted-ink: var(--muted-ink); + --color-concrete: var(--concrete); --color-blueprint: #75B2D6; --color-ochre: #D4A373; --color-sage: #A3B18A; @@ -183,6 +183,7 @@ html:not(.dark) .memento-active-nav { --ink: var(--foreground); --paper: var(--background); --muted-ink: var(--muted-foreground); + --concrete: #8D8D8D; --ai-accent: #ACB995; } @@ -424,6 +425,8 @@ html.dark { --sidebar-accent-foreground: #1C1C1C; --sidebar-border: rgba(28, 28, 28, 0.1); --sidebar-ring: rgba(28, 28, 28, 0.35); + --thumb-lightness-1: 94%; + --thumb-lightness-2: 87%; } [data-theme='light'].dark { @@ -487,6 +490,9 @@ html.dark { --sidebar-accent-foreground: #ffffff; --sidebar-border: #3d3d3d; --sidebar-ring: #a8a29e; + --thumb-lightness-1: 15%; + --thumb-lightness-2: 10%; + --concrete: #A0A0A0; } [data-theme='midnight'] { diff --git a/memento-note/components/ai-chat.tsx b/memento-note/components/ai-chat.tsx index 8180f9c..f056847 100644 --- a/memento-note/components/ai-chat.tsx +++ b/memento-note/components/ai-chat.tsx @@ -163,7 +163,7 @@ export function AIChat({ showFloatingTrigger = true }: { showFloatingTrigger?: b return (