fix: 第四轮调试 — 回复去重/消息时序/UI布局/自主思考深度优化 + 文档重整

后端修复:
- main.go: 恢复 /api/v1/chat 路由中丢失的 handleChat 调用 (空响应回归)
- orchestrator.go: splitChatByLines 改为双换行分割, 避免单换行误拆
- chat_handler.go: multi_message 增加 !hasReview 守卫, 消息延迟 200→800ms
- thinker.go: RecordUserMessage 追踪活跃会话ID, 推送主动消息到正确会话
- thinker.go: 增强思考提示词 — 禁止在用户休息/离开时发送主动消息

前端修复:
- useWebSocket.ts: stream_segments 不再创建消息气泡, 消除重复回复
- MessageBubble.tsx: 动作消息居左对齐无头像, 时间戳移至气泡外侧 hover 显示
- ChatInput.tsx: 昔涟输入提示移至输入框上方, 波点动画效果
- MessageList/TypingIndicator/ChatContainer: 清理冗余 isTyping 传递
- MemoryPanel.tsx: 新增记忆面板组件

文档重整:
- docs/debug/ → docs/debug_log/ 重命名统一
- 新增 debug_log/README.md 索引
- .gitignore: 新增 android/ 排除规则

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-23 13:09:18 +08:00
parent 0c1bbff7b4
commit b123a36aae
37 changed files with 580 additions and 174 deletions
@@ -2,6 +2,7 @@ import { useState } from 'react';
import { Sidebar } from './Sidebar';
import { Header } from './Header';
import { SearchModal } from './SearchModal';
import { MemoryPanel } from './MemoryPanel';
import { useAuth } from '@/hooks/useAuth';
interface AppLayoutProps {
@@ -11,6 +12,7 @@ interface AppLayoutProps {
export function AppLayout({ children }: AppLayoutProps) {
const [sidebarOpen, setSidebarOpen] = useState(false);
const [searchOpen, setSearchOpen] = useState(false);
const [memoryOpen, setMemoryOpen] = useState(false);
const { isLoggedIn } = useAuth();
return (
@@ -31,7 +33,7 @@ export function AppLayout({ children }: AppLayoutProps) {
${sidebarOpen ? 'translate-x-0' : '-translate-x-full lg:translate-x-0'}
`}
>
<Sidebar onClose={() => setSidebarOpen(false)} />
<Sidebar onClose={() => setSidebarOpen(false)} onMemoryClick={() => setMemoryOpen(true)} />
</div>
</>
)}
@@ -49,6 +51,8 @@ export function AppLayout({ children }: AppLayoutProps) {
{/* 搜索弹窗 */}
<SearchModal isOpen={searchOpen} onClose={() => setSearchOpen(false)} />
{/* 记忆管理弹窗 */}
<MemoryPanel isOpen={memoryOpen} onClose={() => setMemoryOpen(false)} />
</div>
);
}