fix(ui): 空catch块添加日志 + ErrorBoundary覆盖高风险组件
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
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
空catch块修复 (12处, 6文件): - ModelsAPI: 4处 localStorage 配置读写添加 console.warn - VikingPanel: 2处 viking 操作添加日志 - Workspace/MCPServices/SaaSStatus/TOTPSettings: 各1-3处 ErrorBoundary新增覆盖: - ChatArea: 两种UI模式均包裹(防白屏) - RightPanel: 两种UI模式均包裹 - AuditLogsPanel/HeartbeatConfig/VikingPanel: 设置页包裹
This commit is contained in:
@@ -3,6 +3,7 @@ import './index.css';
|
||||
import { Sidebar } from './components/Sidebar';
|
||||
import { ChatArea } from './components/ChatArea';
|
||||
import { RightPanel } from './components/RightPanel';
|
||||
import { ErrorBoundary } from './components/ui/ErrorBoundary';
|
||||
import { SettingsLayout } from './components/Settings/SettingsLayout';
|
||||
import { AgentOnboardingWizard } from './components/AgentOnboardingWizard';
|
||||
import { HandApprovalModal } from './components/HandApprovalModal';
|
||||
@@ -458,7 +459,9 @@ function App() {
|
||||
|
||||
{/* 主聊天区域 */}
|
||||
<div className="flex-1 flex flex-col overflow-hidden">
|
||||
<ChatArea compact onOpenDetail={() => setShowDetailDrawer(true)} />
|
||||
<ErrorBoundary fallback={<div className="flex-1 flex items-center justify-center text-gray-500">聊天区域加载失败</div>}>
|
||||
<ChatArea compact onOpenDetail={() => setShowDetailDrawer(true)} />
|
||||
</ErrorBoundary>
|
||||
</div>
|
||||
|
||||
{/* 详情抽屉 - 简洁模式仅 状态/Agent/管家 */}
|
||||
@@ -467,7 +470,9 @@ function App() {
|
||||
onClose={() => setShowDetailDrawer(false)}
|
||||
title="详情"
|
||||
>
|
||||
<RightPanel simpleMode />
|
||||
<ErrorBoundary fallback={<div className="p-6 text-center text-gray-500">详情面板加载失败</div>}>
|
||||
<RightPanel simpleMode />
|
||||
</ErrorBoundary>
|
||||
</DetailDrawer>
|
||||
|
||||
{/* Hand Approval Modal (global) */}
|
||||
@@ -502,7 +507,9 @@ function App() {
|
||||
/>
|
||||
|
||||
{/* 聊天区域 */}
|
||||
<ChatArea />
|
||||
<ErrorBoundary fallback={<div className="flex-1 flex items-center justify-center text-gray-500">聊天区域加载失败,请刷新页面</div>}>
|
||||
<ChatArea />
|
||||
</ErrorBoundary>
|
||||
</div>
|
||||
|
||||
{/* 详情抽屉 - 按需显示 */}
|
||||
@@ -511,7 +518,9 @@ function App() {
|
||||
onClose={() => setShowDetailDrawer(false)}
|
||||
title="详情"
|
||||
>
|
||||
<RightPanel />
|
||||
<ErrorBoundary fallback={<div className="p-6 text-center text-gray-500">详情面板加载失败</div>}>
|
||||
<RightPanel />
|
||||
</ErrorBoundary>
|
||||
</DetailDrawer>
|
||||
|
||||
{/* Hand Approval Modal (global) */}
|
||||
|
||||
Reference in New Issue
Block a user