diff --git a/docs/plans/2026-03-29-focus-panel-dedupe-implementation-plan.md b/docs/plans/2026-03-29-focus-panel-dedupe-implementation-plan.md index 56641c39..c0e3e783 100644 --- a/docs/plans/2026-03-29-focus-panel-dedupe-implementation-plan.md +++ b/docs/plans/2026-03-29-focus-panel-dedupe-implementation-plan.md @@ -11,8 +11,8 @@ - `lib/widgets/assistant_focus_panel_core.dart` - `lib/widgets/assistant_focus_panel_previews.dart` - `lib/widgets/assistant_focus_panel_support.dart` -- Web 侧旧的 `web_focus_panel_core.dart`、`web_focus_panel_previews.dart`、`web_focus_panel_support.dart` 已不再存在。 -- 本轮进一步移除了 `lib/web/web_focus_panel.dart` 这一层兼容导出,Web Assistant 侧不再保留旧入口。 +- Web 侧旧 Focus Panel 副本与兼容入口已全部删除。 +- Web Assistant 侧已直接依赖共享 Focus Panel 实现。 ## 验收关注点 diff --git a/docs/plans/2026-03-29-settings-assistant-ui-component-matrix.md b/docs/plans/2026-03-29-settings-assistant-ui-component-matrix.md index ce0797d0..849f810f 100644 --- a/docs/plans/2026-03-29-settings-assistant-ui-component-matrix.md +++ b/docs/plans/2026-03-29-settings-assistant-ui-component-matrix.md @@ -55,11 +55,7 @@ 说明: -- `web_focus_panel_core.dart` -- `web_focus_panel_previews.dart` -- `web_focus_panel_support.dart` - -这三份旧 Web Focus Panel 副本已经不再存在,不再列入候选池。 +- 旧 Web Focus Panel 副本已经删除,不再列入候选池。 --- @@ -68,7 +64,7 @@ ### 第一批:已完成 - Web Focus Panel 共享化已收口到 `lib/widgets/assistant_focus_panel*.dart` -- Web Assistant 不再通过单独的 `web_focus_panel.dart` 兼容壳间接引用共享组件 +- Web Assistant 已直接引用共享 Focus Panel 实现,不再保留旧兼容入口 ### 第二批:已完成公共壳层收口 @@ -82,12 +78,12 @@ Desktop 与 Web 设置页当前已共用: ### 第三批:本轮完成 -- `IosMobileShell` 兼容壳删除后,以 `MobileShell` 作为唯一正式入口 +- 旧 iOS 移动兼容壳已删除,以 `MobileShell` 作为唯一正式入口 ### 第四批:持续维护 - 文档和测试应只引用当前仍存在的 UI 文件 -- 不再记录已经删除的旧 Web Focus Panel 副本路径 +- 守护测试应阻止旧兼容壳和旧副本路径回流 --- diff --git a/test/features/mobile/mobile_shell_suite.dart b/test/features/mobile/mobile_shell_suite.dart index eeb8f435..d2493b32 100644 --- a/test/features/mobile/mobile_shell_suite.dart +++ b/test/features/mobile/mobile_shell_suite.dart @@ -1,6 +1,8 @@ @TestOn('vm') library; +import 'dart:io'; + import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter/services.dart'; @@ -43,6 +45,18 @@ void main() { .setMockMethodCallHandler(mobileScannerChannel, null); }); + test('mobile shell keeps a single active entrypoint', () { + expect(File('lib/features/mobile/mobile_shell.dart').existsSync(), isTrue); + expect( + File('lib/features/mobile/mobile_shell_core.dart').existsSync(), + isTrue, + ); + expect( + File('lib/features/mobile/ios_mobile_shell.dart').existsSync(), + isFalse, + ); + }); + Future pumpMobileShell( WidgetTester tester, { required Widget child, diff --git a/test/widgets/assistant_focus_panel_suite.dart b/test/widgets/assistant_focus_panel_suite.dart index 75818aa9..d6048abd 100644 --- a/test/widgets/assistant_focus_panel_suite.dart +++ b/test/widgets/assistant_focus_panel_suite.dart @@ -31,6 +31,23 @@ void main() { } }); + test('legacy web focus panel duplicates stay removed', () { + const removedTargets = [ + 'lib/web/web_focus_panel.dart', + 'lib/web/web_focus_panel_core.dart', + 'lib/web/web_focus_panel_previews.dart', + 'lib/web/web_focus_panel_support.dart', + ]; + + for (final path in removedTargets) { + expect( + File(path).existsSync(), + isFalse, + reason: 'legacy file should stay removed: $path', + ); + } + }); + testWidgets( 'Settings focused preview reuses language and theme quick actions', (WidgetTester tester) async {