From 667b86303f3eae4d35f55b8f1dd0da0e7ebcd813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E9=98=BF=E6=B1=9F=28Relakkes?= =?UTF-8?q?=29?= Date: Thu, 14 May 2026 23:13:02 +0800 Subject: [PATCH] Prevent memory activity from clashing with desktop themes Memory tool activity inherited the global warm brand treatment, which made the new desktop memory surface feel detached from white and dark themes. The component now uses memory-specific tokens with a quieter teal family, and the sidebar settings dock is made opaque so scrolling sessions cannot show through it. Constraint: Desktop memory activity must remain readable across light, white, and dark themes without reusing the classic warm brand surface Rejected: Keep using color-mix with --color-brand | preserves the original warm tint mismatch in white theme Confidence: high Scope-risk: narrow Directive: Keep memory activity colors on memory-specific tokens instead of generic brand tokens Tested: cd desktop && bun run test src/components/chat/MessageList.test.tsx --run Tested: cd desktop && bun run test src/components/layout/Sidebar.test.tsx --run Tested: cd desktop && bun run lint Tested: cd desktop && bun run build Tested: Browser smoke screenshots for light, white, and dark memory activity previews --- .../src/components/chat/MessageList.test.tsx | 3 +++ desktop/src/components/chat/ToolCallGroup.tsx | 11 ++++++---- .../src/components/layout/Sidebar.test.tsx | 7 +++++++ desktop/src/components/layout/Sidebar.tsx | 5 ++++- desktop/src/theme/globals.css | 21 +++++++++++++++++++ 5 files changed, 42 insertions(+), 5 deletions(-) diff --git a/desktop/src/components/chat/MessageList.test.tsx b/desktop/src/components/chat/MessageList.test.tsx index c7cdb5b8..26b478c3 100644 --- a/desktop/src/components/chat/MessageList.test.tsx +++ b/desktop/src/components/chat/MessageList.test.tsx @@ -264,6 +264,9 @@ describe('MessageList nested tool calls', () => { expect(screen.getByText('Saved 1 memory item(s)')).toBeTruthy() expect(screen.getByText('preferences.md')).toBeTruthy() expect(screen.getByText('Tool details')).toBeTruthy() + const memoryCardClassName = screen.getByTestId('memory-tool-activity-card').className + expect(memoryCardClassName).toContain('border-[var(--color-memory-border)]') + expect(memoryCardClassName).toContain('bg-[var(--color-memory-surface)]') }) it('promotes memory file reads into collapsible memory references', () => { diff --git a/desktop/src/components/chat/ToolCallGroup.tsx b/desktop/src/components/chat/ToolCallGroup.tsx index 9239b1a4..d97f7bf0 100644 --- a/desktop/src/components/chat/ToolCallGroup.tsx +++ b/desktop/src/components/chat/ToolCallGroup.tsx @@ -195,7 +195,10 @@ function MemoryToolActivityGroup({ return (
-
+
@@ -226,7 +229,7 @@ function MemoryToolActivityGroup({ onClick={() => openMemorySettings(file.path)} className="group flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-[var(--color-surface-hover)] focus:outline-none focus-visible:shadow-[var(--shadow-focus-ring)]" > - + diff --git a/desktop/src/components/layout/Sidebar.test.tsx b/desktop/src/components/layout/Sidebar.test.tsx index 73e79ed6..085bb9f8 100644 --- a/desktop/src/components/layout/Sidebar.test.tsx +++ b/desktop/src/components/layout/Sidebar.test.tsx @@ -348,6 +348,13 @@ describe('Sidebar', () => { expect(screen.getByTestId('sidebar-session-list-section')).toHaveClass('flex', 'flex-1', 'min-h-0', 'flex-col') }) + it('keeps the settings dock opaque above the scrolling session list', () => { + render() + + expect(screen.getByTestId('sidebar-settings-dock')).toHaveClass('sidebar-settings-dock') + expect(screen.getByTestId('sidebar-settings-dock')).toHaveClass('absolute', 'bottom-0') + }) + it('keeps mobile navigation focused on chat sessions', async () => { const onRequestClose = vi.fn() createSession.mockResolvedValue('session-mobile-new') diff --git a/desktop/src/components/layout/Sidebar.tsx b/desktop/src/components/layout/Sidebar.tsx index 7c9247c5..8186e370 100644 --- a/desktop/src/components/layout/Sidebar.tsx +++ b/desktop/src/components/layout/Sidebar.tsx @@ -593,7 +593,10 @@ export function Sidebar({ isMobile = false, onRequestClose }: SidebarProps) { )} {!isMobile && ( -
+