Skip to content

CodexBar 是一个 macOS 菜单栏应用,用于查看本机 Codex 账号状态、额度、Token 用量、详细统计信息

fix: 修正同步状态占位并简化重建提示

Bob8c26575f030d
diff --git a/CodexBar/Resources/Localizable.xcstrings b/CodexBar/Resources/Localizable.xcstrings
index 17d6068..567bcfc 100644
--- a/CodexBar/Resources/Localizable.xcstrings
+++ b/CodexBar/Resources/Localizable.xcstrings
@@ -2022,13 +2022,13 @@
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Recalculate activity data and session data for %@ from locally collected app-server events and Token records.\nAfter syncing, local data will be replaced and cloud data updated"
+ "value" : "Recalculate activity data and session data for %@ from locally collected app-server events\nAfter syncing, local data will be replaced and cloud data updated"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "将从本机采集的 app-server 事件和 Token 记录 重新统计 %@ 的活动数据和会话数据\n同步后将替换本机数据并更新云端数据"
+ "value" : "将从本地采集的 app-server 事件重新统计 %@ 的活动数据和会话数据\n同步后将替换本机数据并更新云端数据"
}
}
}
@@ -2054,13 +2054,13 @@
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "The original event log contains unreadable records. Previous results have been kept. Repair the log and retry."
+ "value" : "The original event data contains unreadable records. Please fix them and retry."
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "原始事件日志包含无法读取的记录, 已保留原结果, 请修复日志后重试"
+ "value" : "原始事件包含无法读取的记录, 请修复后重试"
}
}
}
@@ -2182,13 +2182,13 @@
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "Days fully rebuilt: %1$lld; rebuilt events: %2$lld"
+ "value" : "Days rebuilt: %1$lld; events: %2$lld"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "完整重建 %1$lld 天, 已重算活动事件 %2$lld 条"
+ "value" : "已重建 %1$lld 天, 活动事件 %2$lld 条"
}
}
}
@@ -2209,34 +2209,34 @@
}
}
},
- "history.rebuild.summary.retry-later" : {
+ "history.rebuild.summary.request-failed" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : ", will retry automatically"
+ "value" : "; rebuild could not start, please retry"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : ", 稍后会自动重试"
+ "value" : "; 部分重建未能开始, 请重新尝试"
}
}
}
},
- "history.rebuild.summary.request-failed" : {
+ "history.rebuild.summary.retry-later" : {
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "; rebuild could not start for %@, please retry"
+ "value" : ", will retry automatically"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "; 重建请求未能保存 (%@), 请重新尝试"
+ "value" : ", 稍后会自动重试"
}
}
}
@@ -2246,13 +2246,13 @@
"en" : {
"stringUnit" : {
"state" : "translated",
- "value" : "; session data rebuild incomplete (%@), please retry the incomplete dates"
+ "value" : "; session data rebuild incomplete, please retry"
}
},
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
- "value" : "; 会话数据重建未完成 (%@), 请重新尝试未完成日期"
+ "value" : "; 会话数据未完成重建, 请重试"
}
}
}
diff --git a/CodexBar/Services/AppServer/AppServerLogStore.swift b/CodexBar/Services/AppServer/AppServerLogStore.swift
index b11ab89..5bc840c 100644
--- a/CodexBar/Services/AppServer/AppServerLogStore.swift
+++ b/CodexBar/Services/AppServer/AppServerLogStore.swift
@@ -22,11 +22,7 @@ final nonisolated class AppServerLogStore: @unchecked Sendable {
AppStorage.directoryURL().appendingPathComponent("Logs", isDirectory: true)
}
- #if DEBUG
- static let databaseName = "logs-debug.sqlite"
- #else
- static let databaseName = "logs.sqlite"
- #endif
+ static let databaseName = "logs.sqlite"
struct Limits: Sendable {
var entries = 10000
diff --git a/CodexBar/Views/Settings/AppSettingsView.swift b/CodexBar/Views/Settings/AppSettingsView.swift
index 5ea5e54..6101372 100644
--- a/CodexBar/Views/Settings/AppSettingsView.swift
+++ b/CodexBar/Views/Settings/AppSettingsView.swift
@@ -654,9 +654,7 @@ private extension AppSettingsView {
if let message = syncSettings.unavailableMessage {
SettingsCaptionMessageRow(message: message)
.frame(minHeight: Metrics.syncStatusRowHeight, alignment: .top)
- } else if state.isActive {
- let showsSyncStatus = state.shouldShowSyncStatus(lastSyncText: lastSyncText)
-
+ } else if state.shouldShowSyncStatus(lastSyncText: lastSyncText) {
SettingsIndentedRow {
Text("sync.status.last-sync")
.font(.caption)
@@ -690,7 +688,6 @@ private extension AppSettingsView {
.animation(Metrics.statusAnimation, value: syncSettings.isSyncing)
}
.frame(height: Metrics.syncStatusRowHeight)
- .opacity(showsSyncStatus ? 1 : 0)
}
}
}
@@ -814,8 +811,7 @@ private extension AppSettingsView {
)
message += String(localized: "history.rebuild.summary.token-record-count", defaultValue: "\(summary.tokenTurnCount, specifier: "%lld")")
if summary.didFailTokenRebuild {
- let dates = summary.failedTokenDateKeys.prefix(rebuildFailedDateListLimit).joined(separator: ", ")
- message += String(localized: "history.rebuild.summary.token-history-incomplete", defaultValue: "\(dates)")
+ message += String(localized: "history.rebuild.summary.token-history-incomplete")
}
let retryDates = summary.failedDateKeys.filter { !summary.failedRequestDateKeys.contains($0) }
@@ -830,8 +826,7 @@ private extension AppSettingsView {
}
if !summary.failedRequestDateKeys.isEmpty {
- let dates = summary.failedRequestDateKeys.prefix(rebuildFailedDateListLimit).joined(separator: ", ")
- message += String(localized: "history.rebuild.summary.request-failed", defaultValue: "\(dates)")
+ message += String(localized: "history.rebuild.summary.request-failed")
}
if summary.isSyncReplacementPending {
message += String(localized: "history.rebuild.summary.cloud-replacement-pending")