fix(desktop): session persistence — refresh/login/context/empty-content 4-bug fix
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

1. App.tsx: add restoreSession() call on startup to prevent redirect
   to login page after refresh (isRestoring guard + BootstrapScreen)
2. CloneManager: call syncAgents() after loadClones() to restore
   currentAgent and conversation history on app load
3. zclaw-memory: add get_or_create_session() so frontend session UUID
   is persisted directly — kernel no longer creates mismatched IDs
4. openai.rs: assistant message content must be non-empty for
   Kimi/Qwen APIs — replace empty content with meaningful placeholders

Also includes admin-v2 ModelServices unified page (merge providers +
models + API keys into expandable row layout)
This commit is contained in:
iven
2026-03-31 13:38:59 +08:00
parent 3e5d64484e
commit 6cae768401
29 changed files with 1982 additions and 933 deletions

View File

@@ -0,0 +1,51 @@
import { Button, Result } from 'antd'
import type { FallbackProps } from 'react-error-boundary'
interface ErrorStateProps {
title?: string
message?: string
onRetry?: () => void
}
export function ErrorState({
title = '加载失败',
message,
onRetry,
}: ErrorStateProps) {
return (
<div className="flex items-center justify-center min-h-[200px] p-8">
<Result
status="error"
title={title}
subTitle={message}
extra={
onRetry ? (
<Button type="primary" onClick={onRetry}>
</Button>
) : undefined
}
/>
</div>
)
}
export function ErrorFallback({ error, resetErrorBoundary }: FallbackProps) {
return (
<div className="flex items-center justify-center min-h-[200px] p-8">
<Result
status="error"
title="页面出现错误"
subTitle={error.message}
extra={
<div className="flex gap-2">
<Button onClick={resetErrorBoundary}></Button>
<Button type="primary" onClick={() => window.location.reload()}>
</Button>
</div>
}
/>
</div>
)
}