fix: 数据确认面板修复 - 显示实际数值+确认关闭+侧边栏刷新+清理旧数据

- Handler返回value/unit/isAbnormal到metadata
- DataConfirmCard显示实际数值和单位
- 确认按钮关闭卡片+刷新健康概览
- 健康Agent欢迎卡简化为'查看趋势'
- 清空87条旧健康测试数据
This commit is contained in:
MingNian
2026-06-04 21:57:02 +08:00
parent cd65bc4d65
commit 20a5ce1199
4 changed files with 69 additions and 161 deletions

View File

@@ -14,6 +14,7 @@ class ChatMessage {
final DateTime createdAt;
MessageType type;
final Map<String, dynamic>? metadata;
bool confirmed;
ChatMessage({
required this.id,
required this.role,
@@ -21,6 +22,7 @@ class ChatMessage {
required this.createdAt,
this.type = MessageType.text,
this.metadata,
this.confirmed = false,
});
bool get isUser => role == 'user';
}
@@ -114,6 +116,8 @@ ActiveAgent _parseAgent(String? type) {
class ChatNotifier extends Notifier<ChatState> {
StreamSubscription<Map<String, dynamic>>? _subscription;
void markNeedsRebuild() => state = state.copyWith();
@override
ChatState build() {
Future.microtask(() {