v1.3.13: 模块化注册架构 + PDS流程设计套件更名 + 依赖/圆周交互修复

- 模块化:EdcModule 契约 + registry + 模块独立目录;发布包增加 modules/registry.json
- 更名:PDS流程设计套件 / ProcessDesignSuite;同步构建、发布脚本与文档
- 时序图:依赖偏移以时间显示/编辑;紧贴依赖隐藏箭头并在接缝显示标签;动作条磁吸
- 圆周:依赖标签沿圆弧方向、环间空隙;动作旋转磁吸增强;短弧标签优先动作名
- 清理:release 移至源码同级(本地不入库);tool 合并到 tools;发布说明迁移 docs/release-notes
This commit is contained in:
2026-11-22 10:02:48 +08:00
parent afc4dc6dd7
commit 0a3f2c5cc6
105 changed files with 6309 additions and 3577 deletions
+15 -14
View File
@@ -1,9 +1,9 @@
// 首页(空白启动)与模块注册表测试:
// 注册表唯一性 / AppMode 映射;首页新建文档、未开放模块、品牌菜单回首页。
// 注册表唯一性 / 模块 id 映射;首页新建文档、未开放模块、品牌菜单回首页。
import 'package:flutter/material.dart' hide Action;
import 'package:flutter_test/flutter_test.dart';
import 'package:sequence_diagram/model/models.dart';
import 'package:sequence_diagram/modules/module_registry.dart';
import 'package:sequence_diagram/modules/registry.dart';
import 'package:sequence_diagram/state/app_controller.dart';
import 'package:sequence_diagram/theme/tokens.dart';
import 'package:sequence_diagram/ui/app_shell.dart';
@@ -22,12 +22,13 @@ void main() {
expect(moduleById('unknown-id'), isNull);
});
test('AppMode 映射与标题文案', () {
expect(moduleOf(AppMode.home), isNull);
expect(moduleOf(AppMode.sequence)!.name, '时序图');
expect(moduleOf(AppMode.architecture)!.suffix, '.arch.json');
expect(appModeLabel(AppMode.home), 'EDC易得');
expect(appModeLabel(AppMode.sequence), contains('时序图'));
test('模块 id 映射与标题文案', () {
expect(moduleById(null), isNull);
expect(moduleById('sequence')!.name, '时序图');
expect(moduleById('architecture')!.suffix, '.arch.json');
expect(moduleTitle(null), 'PDS流程设计套件');
expect(moduleTitle('sequence'), contains('时序图'));
expect(moduleTitle('unknown-id'), 'PDS流程设计套件');
});
});
@@ -49,7 +50,7 @@ void main() {
testWidgets('空白启动:新建文档网格 + 未开放标注,不渲染工作区', (WidgetTester tester) async {
final AppController c = await pumpHome(tester);
expect(c.appMode, AppMode.home);
expect(c.activeModuleId, isNull);
expect(find.text('新建文档'), findsOneWidget);
expect(find.text('时序图'), findsOneWidget);
expect(find.text('架构图'), findsOneWidget);
@@ -64,7 +65,7 @@ void main() {
final AppController c = await pumpHome(tester);
await tester.tap(find.text('时序图'));
await tester.pumpAndSettle();
expect(c.appMode, AppMode.sequence);
expect(c.activeModuleId, 'sequence');
expect(find.text('导出'), findsOneWidget);
expect(c.currentFilePath, isNull);
});
@@ -73,14 +74,14 @@ void main() {
final AppController c = await pumpHome(tester);
await tester.tap(find.text('电器原理图'));
await tester.pump();
expect(c.appMode, AppMode.home);
expect(c.activeModuleId, isNull);
});
testWidgets('品牌菜单:已进入模块后返回首页(未保存修改先确认)', (WidgetTester tester) async {
final AppController c = await pumpHome(tester);
await tester.tap(find.text('时序图'));
await tester.pumpAndSettle();
expect(c.appMode, AppMode.sequence);
expect(c.activeModuleId, 'sequence');
// 打开品牌菜单(按钮显示当前模块名 + 设计;状态栏也有同名文案,取第一个)。
await tester.tap(find.text('时序图设计').first);
await tester.pumpAndSettle();
@@ -90,7 +91,7 @@ void main() {
expect(find.text('放弃未保存的修改?'), findsOneWidget);
await tester.tap(find.text('继续'));
await tester.pumpAndSettle();
expect(c.appMode, AppMode.home);
expect(c.activeModuleId, isNull);
expect(find.text('新建文档'), findsOneWidget);
});
@@ -106,7 +107,7 @@ void main() {
expect(find.text('放弃未保存的修改?'), findsOneWidget);
await tester.tap(find.text('继续'));
await tester.pumpAndSettle();
expect(c.appMode, AppMode.architecture);
expect(c.activeModuleId, 'architecture');
expect(find.text('导出'), findsOneWidget);
});
});