fix(butler): runtime fixes — SQLite mode=rwc + React hooks ordering
Some checks failed
CI / Build Frontend (push) Has been cancelled
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Some checks failed
CI / Build Frontend (push) Has been cancelled
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
- Add ?mode=rwc to pain.db SQLite URL so it creates the file on first run - Move useUIModeStore hook before conditional returns in App.tsx to fix React "Rendered more hooks than during the previous render" error
This commit is contained in:
@@ -28,7 +28,7 @@ import type { Clone } from './store/agentStore';
|
||||
import { createLogger } from './lib/logger';
|
||||
import { startOfflineMonitor } from './store/offlineStore';
|
||||
import { useUIModeStore } from './store/uiModeStore';
|
||||
import { SimpleTopBar } from './components/SimpleTopBar';
|
||||
import { SimpleSidebar } from './components/SimpleSidebar';
|
||||
|
||||
const log = createLogger('App');
|
||||
|
||||
@@ -65,6 +65,7 @@ function App() {
|
||||
const loadHands = useHandStore((s) => s.loadHands);
|
||||
const { setCurrentAgent } = useChatStore();
|
||||
const { isNeeded: onboardingNeeded, isLoading: onboardingLoading, markCompleted } = useOnboarding();
|
||||
const uiMode = useUIModeStore((s) => s.mode);
|
||||
|
||||
// Proposal notifications
|
||||
const { toast } = useToast();
|
||||
@@ -445,17 +446,30 @@ function App() {
|
||||
);
|
||||
}
|
||||
|
||||
const uiMode = useUIModeStore((s) => s.mode);
|
||||
|
||||
// Simple mode: single-column layout with top bar only
|
||||
// Simple mode: sidebar + chat + detail drawer (Trae Solo style)
|
||||
if (uiMode === 'simple') {
|
||||
return (
|
||||
<div className="h-screen flex flex-col overflow-hidden text-gray-800 text-sm bg-white dark:bg-gray-950">
|
||||
<SimpleTopBar onToggleMode={() => useUIModeStore.getState().setMode('professional')} />
|
||||
<div className="flex-1 min-h-0">
|
||||
<ChatArea compact />
|
||||
<div className="h-screen flex overflow-hidden text-gray-800 text-sm bg-white dark:bg-gray-950">
|
||||
{/* 简洁侧边栏: 对话 + 行业资讯 */}
|
||||
<SimpleSidebar
|
||||
onOpenSettings={() => setView('settings')}
|
||||
onToggleMode={() => useUIModeStore.getState().setMode('professional')}
|
||||
/>
|
||||
|
||||
{/* 主聊天区域 */}
|
||||
<div className="flex-1 flex flex-col overflow-hidden">
|
||||
<ChatArea compact onOpenDetail={() => setShowDetailDrawer(true)} />
|
||||
</div>
|
||||
|
||||
{/* 详情抽屉 - 简洁模式仅 状态/Agent/管家 */}
|
||||
<DetailDrawer
|
||||
open={showDetailDrawer}
|
||||
onClose={() => setShowDetailDrawer(false)}
|
||||
title="详情"
|
||||
>
|
||||
<RightPanel simpleMode />
|
||||
</DetailDrawer>
|
||||
|
||||
{/* Hand Approval Modal (global) */}
|
||||
<HandApprovalModal
|
||||
handRun={pendingApprovalRun}
|
||||
|
||||
Reference in New Issue
Block a user