Simplify global loading overlay to animation-only display.
Remove visible message text from the loading UI while keeping the message field for internal state and future use. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@ -71,6 +71,8 @@ Core 模块提供跨业务复用的基础能力,包括网络请求、缓存存
|
|||||||
|
|
||||||
Loading 的可观察状态只在 `GlobalLoadingOverlayHost` 内部订阅,并由 `RootView` 挂载到应用根部。这样切换 Loading 显隐时,只会刷新根部 Overlay,不会让当前页面、Tab 根视图或业务子视图形成观察依赖。
|
Loading 的可观察状态只在 `GlobalLoadingOverlayHost` 内部订阅,并由 `RootView` 挂载到应用根部。这样切换 Loading 显隐时,只会刷新根部 Overlay,不会让当前页面、Tab 根视图或业务子视图形成观察依赖。
|
||||||
|
|
||||||
|
当前全局 Loading UI 不展示文案;`message` 字段保留为内部展示状态,便于后续需要时恢复文案展示。
|
||||||
|
|
||||||
全局 Loading 只用于阻塞型等待,例如冷启动恢复、登录、首屏加载、提交表单和核销。列表加载更多、上传进度、按钮内局部反馈继续保留在页面局部状态中。
|
全局 Loading 只用于阻塞型等待,例如冷启动恢复、登录、首屏加载、提交表单和核销。列表加载更多、上传进度、按钮内局部反馈继续保留在页面局部状态中。
|
||||||
|
|
||||||
## Upload
|
## Upload
|
||||||
|
|||||||
@ -146,25 +146,16 @@ private struct GlobalLoadingOverlayHost: View {
|
|||||||
|
|
||||||
VStack(spacing: 14) {
|
VStack(spacing: 14) {
|
||||||
loadingAnimation
|
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(.horizontal, 10)
|
||||||
.padding(.vertical, 24)
|
.padding(.vertical, 10)
|
||||||
.background(.white, in: RoundedRectangle(cornerRadius: 18, style: .continuous))
|
.background(.white, in: RoundedRectangle(cornerRadius: 18, style: .continuous))
|
||||||
.shadow(color: Color.black.opacity(0.12), radius: 24, x: 0, y: 10)
|
.shadow(color: Color.black.opacity(0.12), radius: 24, x: 0, y: 10)
|
||||||
}
|
}
|
||||||
.transition(.opacity)
|
.transition(.opacity)
|
||||||
.zIndex(10_000)
|
.zIndex(10_000)
|
||||||
.accessibilityElement(children: .combine)
|
.accessibilityElement(children: .combine)
|
||||||
.accessibilityLabel(state.message.isEmpty ? "加载中" : state.message)
|
.accessibilityLabel("加载中")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.animation(.easeInOut(duration: 0.2), value: state.isVisible)
|
.animation(.easeInOut(duration: 0.2), value: state.isVisible)
|
||||||
|
|||||||
Reference in New Issue
Block a user