fix(butler): wire verification gaps — pain storage init, cold start, UI mode switches
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (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

- Call init_pain_storage() in Tauri .setup() so pain persistence activates on boot
- Integrate useColdStart hook into FirstConversationPrompt for auto-greeting
- Add UI mode toggle section to Settings/General (already had imports)
- Add "简洁" mode switch-back button to TopBar in professional layout
- Update SemanticSkillRouter @reserved annotation to reflect active status
This commit is contained in:
iven
2026-04-09 10:38:49 +08:00
parent e6937e1e5f
commit 646d8c21af
5 changed files with 78 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ import { useConnectionStore } from '../../store/connectionStore';
import { useConfigStore } from '../../store/configStore';
import { useConversationStore } from '../../store/chat/conversationStore';
import { useSaaSStore } from '../../store/saasStore';
import { useUIModeStore } from '../../store/uiModeStore';
import { getStoredGatewayToken, setStoredGatewayToken } from '../../lib/gateway-client';
import { silentErrorHandler } from '../../lib/error-utils';
@@ -20,6 +21,8 @@ export function General() {
const [showToolCalls, setShowToolCalls] = useState(quickConfig.showToolCalls ?? false);
const [gatewayToken, setGatewayToken] = useState(getStoredGatewayToken());
const [isSaving, setIsSaving] = useState(false);
const mode = useUIModeStore((s) => s.mode);
const setMode = useUIModeStore((s) => s.setMode);
const connected = connectionState === 'connected';
const connecting = connectionState === 'connecting' || connectionState === 'reconnecting';
@@ -185,6 +188,35 @@ export function General() {
</div>
<Toggle checked={showToolCalls} onChange={handleShowToolCallsChange} disabled={isSaving} />
</div>
<div>
<div className="text-sm font-medium text-gray-900"></div>
<div className="text-xs text-gray-500 mt-0.5 mb-2"></div>
<div className="flex gap-3">
<button
onClick={() => setMode('simple')}
className={`flex-1 p-3 rounded-lg border text-sm text-center transition-colors ${
mode === 'simple'
? 'border-orange-500 bg-orange-50 text-orange-700 dark:bg-orange-900/20 dark:text-orange-300'
: 'border-gray-200 hover:bg-gray-50 dark:border-gray-700 dark:hover:bg-gray-800'
}`}
>
<p className="text-xs text-gray-500 mt-1">使</p>
</button>
<button
onClick={() => setMode('professional')}
className={`flex-1 p-3 rounded-lg border text-sm text-center transition-colors ${
mode === 'professional'
? 'border-orange-500 bg-orange-50 text-orange-700 dark:bg-orange-900/20 dark:text-orange-300'
: 'border-gray-200 hover:bg-gray-50 dark:border-gray-700 dark:hover:bg-gray-800'
}`}
>
<p className="text-xs text-gray-500 mt-1"></p>
</button>
</div>
</div>
</div>
</div>
);