feat: AI Agent 处理器扩展 + 服药打卡确认链路 + AI 气泡配色微调 + 数据刷新 providers 抽离 + 多端页面细节调整

This commit is contained in:
MingNian
2026-07-20 17:12:00 +08:00
parent 9cea41705e
commit 0cb5b8e85a
45 changed files with 1435 additions and 276 deletions

View File

@@ -46,6 +46,22 @@ void main() {
expect(messageAtDisplayIndex(messages, 1).id, 'user');
});
test('loaded history keeps one current health card at the top', () {
final history = [
ChatMessage(
id: 'history-message',
role: 'user',
content: '历史消息',
createdAt: DateTime(2026, 1, 1),
),
];
final withCard = prependTodayHealthCard(history, now: DateTime(2026, 1, 2));
expect(withCard.first.type, MessageType.taskCard);
expect(withCard[1].id, 'history-message');
});
test('today health keeps one cached snapshot during background refresh', () {
final providers = File(
'lib/providers/data_providers.dart',
@@ -112,10 +128,7 @@ void main() {
final source = File('lib/pages/home/home_page.dart').readAsStringSync();
expect(source, contains('drawerEnableOpenDragGesture: false'));
expect(
source,
contains('onHorizontalDragUpdate: _updateConversationDrawerDrag'),
);
expect(source, contains('_updateConversationDrawerDrag,'));
expect(source, isNot(contains('_drawerDragStartX')));
});
@@ -159,4 +172,16 @@ void main() {
expect(input, isNot(contains('Border.all(color: AppColors.borderLight)')));
expect(source, isNot(contains('class _RoundToolButton')));
});
test('keyboard translates the conversation layer without state updates', () {
final home = File('lib/pages/home/home_page.dart').readAsStringSync();
final keyboard = File('lib/widgets/keyboard_lift.dart').readAsStringSync();
expect(home, contains('KeyboardTranslate('));
expect(home, contains('resizeToAvoidBottomInset: false'));
expect(keyboard, contains('class KeyboardTranslate'));
expect(keyboard, contains('Transform.translate('));
expect(keyboard, contains('child: RepaintBoundary(child: child)'));
expect(keyboard, isNot(contains('setState(')));
});
}