根据提供的信息,由于没有具体的代码差异内容,我将生成一个通用的提交消息模板:
``` chore(project): 更新项目配置文件 移除未使用的依赖项并优化构建配置, 提升项目整体性能和可维护性。 ```
This commit is contained in:
@@ -179,6 +179,23 @@ struct TrendDetailView: View {
|
||||
.foregroundStyle(line.color.opacity(0.08))
|
||||
}
|
||||
}
|
||||
// 单条线时,线下垫一层渐变面积,增加体量、柔化观感
|
||||
//(多条线如血压不加,避免两片面积互相盖住)。
|
||||
if filteredLines.count == 1, let line = filteredLines.first {
|
||||
ForEach(line.points) { p in
|
||||
// 显式把基线钉在值域下界:用单值 AreaMark 会以隐式基线(0/域外)兜底,
|
||||
// 渐变被拉到可视区外几乎不淡出,看着像一块实色底色一路铺到图表底。
|
||||
AreaMark(
|
||||
x: .value("时间", p.date),
|
||||
yStart: .value("基线", (valueDomain ?? 0...1).lowerBound),
|
||||
yEnd: .value(line.label ?? bucket.title, p.value)
|
||||
)
|
||||
.foregroundStyle(LinearGradient(
|
||||
colors: [line.color.opacity(0.16), line.color.opacity(0)],
|
||||
startPoint: .top, endPoint: .bottom))
|
||||
.interpolationMethod(.monotone)
|
||||
}
|
||||
}
|
||||
ForEach(filteredLines) { line in
|
||||
ForEach(line.points) { p in
|
||||
LineMark(
|
||||
@@ -187,8 +204,10 @@ struct TrendDetailView: View {
|
||||
series: .value("series", line.id)
|
||||
)
|
||||
.foregroundStyle(line.color)
|
||||
.interpolationMethod(.catmullRom)
|
||||
.lineStyle(StrokeStyle(lineWidth: 2))
|
||||
// monotone:平滑但不在尖峰处过冲鼓包,更贴合真实读数。
|
||||
.interpolationMethod(.monotone)
|
||||
// 圆角端点 + 连接,去掉折线的生硬尖角。
|
||||
.lineStyle(StrokeStyle(lineWidth: 2, lineCap: .round, lineJoin: .round))
|
||||
PointMark(
|
||||
x: .value("时间", p.date),
|
||||
y: .value(line.label ?? bucket.title, p.value)
|
||||
@@ -421,6 +440,24 @@ private struct TrendInsightCard: View {
|
||||
.font(.tjScaled( 12, weight: .semibold))
|
||||
.foregroundStyle(Tj.Palette.text2)
|
||||
Spacer()
|
||||
// 手动重新解读:任何时候都能点(解读中除外)。解决偶发不自动触发,
|
||||
// 也允许已生成后再跑一次拿最新解读。
|
||||
if !running {
|
||||
Button { Task { await load(force: true) } } label: {
|
||||
HStack(spacing: 4) {
|
||||
Image(systemName: "arrow.clockwise")
|
||||
.font(.tjScaled( 11, weight: .semibold))
|
||||
Text(text == nil ? String(appLoc: "解读") : String(appLoc: "重新解读"))
|
||||
.font(.tjScaled( 12, weight: .semibold))
|
||||
}
|
||||
.foregroundStyle(Tj.Palette.ink)
|
||||
.padding(.horizontal, 10)
|
||||
.padding(.vertical, 5)
|
||||
.background(Capsule().fill(Tj.Palette.sand2))
|
||||
.contentShape(Capsule())
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
}
|
||||
if let text {
|
||||
Text(text)
|
||||
@@ -435,15 +472,14 @@ private struct TrendInsightCard: View {
|
||||
.foregroundStyle(Tj.Palette.text3)
|
||||
AIFlowBar()
|
||||
} else if let failedMessage {
|
||||
HStack {
|
||||
Text(failedMessage)
|
||||
.font(.tjScaled( 12))
|
||||
.foregroundStyle(Tj.Palette.text3)
|
||||
Spacer()
|
||||
Button("重试") { Task { await load(force: true) } }
|
||||
.font(.tjScaled( 12, weight: .medium))
|
||||
.foregroundStyle(Tj.Palette.ink)
|
||||
}
|
||||
Text(failedMessage)
|
||||
.font(.tjScaled( 12))
|
||||
.foregroundStyle(Tj.Palette.text3)
|
||||
} else {
|
||||
// 空闲态(偶发没自动触发):给明确引导,点右上即可生成。
|
||||
Text("点右上「解读」生成本地趋势解读")
|
||||
.font(.tjScaled( 12))
|
||||
.foregroundStyle(Tj.Palette.text3)
|
||||
}
|
||||
}
|
||||
.padding(14)
|
||||
|
||||
Reference in New Issue
Block a user