feat(me,home): 模型推理自检 + 启动容错 + 首页假数据清理
- KangkangApp: ModelContainer 创建失败时重置本地 store 重建, 避免 demo 阶段 schema 演进导致旧真机启动崩溃(注:生产需正式迁移) - ModelSelfTestView: 正式的推理自检页(固定 prompt + 流式输出 + tok/s), 仅当 LLM 模型就绪时从「模型管理」出现入口 - 删除 DEBUG-only 的 DebugAIRunner,自检转正为就绪后可见的正式入口 - HomeView: 删除写死的「今日摘记」假数据卡;问候改为按时段动态 (早安/下午好/晚上好)+ 当天日期;影像档案数字接真实 @Query 计数 - MeView: 模型管理卡动态状态 + 关于页接真实版本号(用户改动一并纳入) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,12 @@ struct MeView: View {
|
||||
private var profile: UserProfile? { profiles.first }
|
||||
private var enabledReminderCount: Int { reminders.filter(\.enabled).count }
|
||||
|
||||
/// 真实读取 Bundle 版本号,与「关于」页保持一致。
|
||||
private var appVersionText: String {
|
||||
let short = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "0.1"
|
||||
return "v\(short)"
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
NavigationStack {
|
||||
ScrollView {
|
||||
@@ -23,14 +29,14 @@ struct MeView: View {
|
||||
settingsCard(title: "Face ID 启动锁",
|
||||
detail: "关闭",
|
||||
icon: "faceid")
|
||||
settingsCard(title: "关于",
|
||||
detail: "v0.1 · W2",
|
||||
icon: "info.circle")
|
||||
|
||||
#if DEBUG
|
||||
DebugAIRunner()
|
||||
.padding(.top, 8)
|
||||
#endif
|
||||
NavigationLink {
|
||||
AboutView()
|
||||
} label: {
|
||||
settingsCard(title: "关于",
|
||||
detail: appVersionText,
|
||||
icon: "info.circle")
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
.padding(.horizontal, 16)
|
||||
.padding(.vertical, 20)
|
||||
|
||||
Reference in New Issue
Block a user