fix(concurrency): 三个 enum 标 nonisolated
工程开了 SWIFT_DEFAULT_ACTOR_ISOLATION=MainActor,这三个纯值类型 enum 会被推成 MainActor 隔离,跨 actor 使用时报错: - CustomMetricNameConflict (CustomMetricEditor) - SeriesKind (SeriesBucket) - ExportTrendBuilder.Direction 已随 v1.1 (build 6) 一同编译上传。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,7 +13,7 @@ let customMetricIconChoices: [String] = [
|
||||
]
|
||||
|
||||
/// 名称冲突判定结果。`detectNameConflict` 返回此值用于 UI 警告。
|
||||
enum CustomMetricNameConflict: Equatable {
|
||||
nonisolated enum CustomMetricNameConflict: Equatable {
|
||||
case none
|
||||
case builtin(String) // 撞到 MonitorMetric.displayName
|
||||
case existingCustom(String) // 撞到其他 CustomMonitorMetric.name
|
||||
|
||||
@@ -5,7 +5,7 @@ import Foundation
|
||||
/// 趋势桶的来源类别。
|
||||
/// - `.monitor`:长期监测预设 / 自定义 / 血压(按 seriesKey 分组)。
|
||||
/// - `.lab`:任意出现 ≥2 次的化验/手动/报告指标(按 name+unit 分组,无 seriesKey)。
|
||||
enum SeriesKind { case monitor, lab }
|
||||
nonisolated enum SeriesKind { case monitor, lab }
|
||||
|
||||
/// 长期监测系列在 Trends 折线图里的展示桶。
|
||||
/// 单系列(血糖/体重/...)= 1 个 SeriesLine;血压特殊 = 收缩 + 舒张 2 条线同卡。
|
||||
|
||||
@@ -8,7 +8,7 @@ import Foundation
|
||||
/// 从根上杜绝小模型编造趋势数字(§10#5 失败回退 / §12#6 禁止编造)。
|
||||
struct ExportTrend: Sendable {
|
||||
|
||||
enum Direction: Sendable {
|
||||
nonisolated enum Direction: Sendable {
|
||||
case up, down, flat
|
||||
var arrow: String {
|
||||
switch self {
|
||||
|
||||
Reference in New Issue
Block a user