简化全局 Loading 遮罩为纯动画展示
移除 Loading UI 中的可见文案,同时保留 message 字段供内部状态及后续使用。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -146,25 +146,16 @@ private struct GlobalLoadingOverlayHost: View {
|
||||
|
||||
VStack(spacing: 14) {
|
||||
loadingAnimation
|
||||
|
||||
if !state.message.isEmpty {
|
||||
Text(state.message)
|
||||
.font(.system(size: 15, weight: .medium))
|
||||
.foregroundStyle(Color(hex: 0x333333))
|
||||
.multilineTextAlignment(.center)
|
||||
.lineLimit(2)
|
||||
.padding(.horizontal, 8)
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 28)
|
||||
.padding(.vertical, 24)
|
||||
.padding(.horizontal, 10)
|
||||
.padding(.vertical, 10)
|
||||
.background(.white, in: RoundedRectangle(cornerRadius: 18, style: .continuous))
|
||||
.shadow(color: Color.black.opacity(0.12), radius: 24, x: 0, y: 10)
|
||||
}
|
||||
.transition(.opacity)
|
||||
.zIndex(10_000)
|
||||
.accessibilityElement(children: .combine)
|
||||
.accessibilityLabel(state.message.isEmpty ? "加载中" : state.message)
|
||||
.accessibilityLabel("加载中")
|
||||
}
|
||||
}
|
||||
.animation(.easeInOut(duration: 0.2), value: state.isVisible)
|
||||
|
||||
Reference in New Issue
Block a user