diff --git a/desktop/src/__tests__/memorySettings.test.tsx b/desktop/src/__tests__/memorySettings.test.tsx index 131a4bec..efbeaa3f 100644 --- a/desktop/src/__tests__/memorySettings.test.tsx +++ b/desktop/src/__tests__/memorySettings.test.tsx @@ -163,6 +163,33 @@ describe('MemorySettings', () => { expect(await screen.findByTestId('markdown-preview')).toHaveTextContent('Prefer small diffs') }) + it('does not select a missing current project with no memory files', async () => { + memoryApiMock.listProjects.mockResolvedValue({ + projects: [ + { + id: '-programs-claude-code', + label: 'C:\\Programs\\claude-code', + memoryDir: 'C:\\Users\\HUAWEI\\.claude\\projects\\-programs-claude-code\\memory', + exists: false, + fileCount: 0, + isCurrent: true, + }, + ], + }) + + render() + + await waitFor(() => { + expect(screen.getAllByText('Programs/claude-code')).toHaveLength(1) + }) + expect(screen.getByText('Missing')).toBeInTheDocument() + expect(screen.getAllByText('No file selected').length).toBeGreaterThan(0) + expect(screen.getByText('Select a project.')).toBeInTheDocument() + expect(screen.queryByText(/HUAWEI/)).not.toBeInTheDocument() + expect(memoryApiMock.listFiles).not.toHaveBeenCalled() + expect(useMemoryStore.getState().selectedProjectId).toBeNull() + }) + it('lets the markdown editor fill the remaining detail pane height', async () => { render() diff --git a/desktop/src/components/chat/MessageList.test.tsx b/desktop/src/components/chat/MessageList.test.tsx index a9e37cb7..a3b47e76 100644 --- a/desktop/src/components/chat/MessageList.test.tsx +++ b/desktop/src/components/chat/MessageList.test.tsx @@ -2269,6 +2269,80 @@ describe('MessageList nested tool calls', () => { expect(scrollTop).toBe(600) }) + it('keeps auto-scrolling when active tool input updates in place', async () => { + const scrollIntoView = vi.fn() + Object.defineProperty(HTMLElement.prototype, 'scrollIntoView', { + configurable: true, + value: scrollIntoView, + }) + + useChatStore.setState({ + sessions: { + [ACTIVE_TAB]: makeSessionState({ + chatState: 'tool_executing', + streamingToolInput: '{"file_path":"/tmp/app.vue","content":"