feat: 添加起卦教程首次访问追踪和Agent时间上下文

- 后端 ProfileSettingsV1 添加 DivinationTutorialSettings 字段
- 前端三个起卦页面添加首次访问检测,自动弹出教程
- 教程展示后更新 settings 标记,避免重复弹出
- 使用本地状态管理避免并发更新覆盖问题
- Agent 系统提示添加时间上下文信息
This commit is contained in:
qzl
2026-04-15 18:56:41 +08:00
parent 55eeab43df
commit 69b34bd723
13 changed files with 624 additions and 0 deletions
@@ -11,6 +11,7 @@ import 'package:meeyao_qianwen/features/divination/data/services/divination_run_
import 'package:meeyao_qianwen/features/divination/presentation/screens/auto_divination_screen.dart';
import 'package:meeyao_qianwen/features/divination/presentation/screens/divination_screen.dart';
import 'package:meeyao_qianwen/features/divination/presentation/screens/manual_divination_screen.dart';
import 'package:meeyao_qianwen/features/settings/data/models/profile_settings.dart';
import 'package:meeyao_qianwen/l10n/app_localizations.dart';
void main() {
@@ -18,6 +19,9 @@ void main() {
api: DivinationApi(apiClient: ApiClient(baseUrl: 'http://localhost:5775')),
);
final sessionStore = SessionStore(LocalKvStore());
final profileSettings = ProfileSettingsV1.defaultsForLocale(
const Locale('zh'),
);
testWidgets('divination screen navigates to auto screen', (tester) async {
await tester.pumpWidget(
@@ -36,6 +40,8 @@ void main() {
userId: 'user_test',
onCompleted: (_) async {},
runServiceOverride: runService,
profileSettings: profileSettings,
onProfileSettingsChanged: (_) async {},
),
),
);
@@ -77,6 +83,8 @@ void main() {
params: params,
runService: runService,
onCompleted: (_) async {},
profileSettings: profileSettings,
onProfileSettingsChanged: (_) async {},
),
),
);
@@ -108,6 +116,8 @@ void main() {
userId: 'user_test',
onCompleted: (_) async {},
runServiceOverride: runService,
profileSettings: profileSettings,
onProfileSettingsChanged: (_) async {},
),
),
);
@@ -7,6 +7,7 @@ import 'package:meeyao_qianwen/features/divination/data/apis/divination_api.dart
import 'package:meeyao_qianwen/features/divination/data/models/divination_params.dart';
import 'package:meeyao_qianwen/features/divination/data/services/divination_run_service.dart';
import 'package:meeyao_qianwen/features/divination/presentation/screens/manual_divination_screen.dart';
import 'package:meeyao_qianwen/features/settings/data/models/profile_settings.dart';
import 'package:meeyao_qianwen/l10n/app_localizations.dart';
void main() {
@@ -24,6 +25,9 @@ void main() {
apiClient: ApiClient(baseUrl: 'http://localhost:5775'),
),
);
final profileSettings = ProfileSettingsV1.defaultsForLocale(
const Locale('zh'),
);
await tester.pumpWidget(
MaterialApp(
@@ -39,6 +43,8 @@ void main() {
params: params,
runService: runService,
onCompleted: (_) async {},
profileSettings: profileSettings,
onProfileSettingsChanged: (_) async {},
),
),
);