Skip to content

refactor: isolate input method switching and recovery - #45

Merged
ygsgdbd merged 1 commit into
mainfrom
codex/extract-switching-feature
Sep 12, 2026
Merged

ygsgdbd merged 1 commit into
mainfrom
codex/extract-switching-feature

Conversation

@ygsgdbd

@ygsgdbd ygsgdbd commented Sep 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

输入法切换、目录恢复和前台重试的状态与取消规则原本分散在根 AppFeature 的多个事件分支中,修改交错事件处理时需要同时理解菜单、规则编辑和切换时序。

本次将这些运行状态及结果收敛逻辑集中到 SwitchingFeature,根 AppFeature 保留菜单、规则编辑和开机启动职责。两者复用现有 Shared 存储,忽略及退出应用仍在同一次事件处理中同步取消切换;菜单通过只读投影读取状态。应用记录更新集中到 AppRulesStore,并新增 CONTEXT.md 记录领域词汇。

保留现有行为与存储格式,将 20 项核心行为测试迁移到 SwitchingFeatureTests,其余根级集成测试继续覆盖菜单和规则交接。

Testing

  • 完整 macOS XCTest:137 项通过,0 失败;原有 81 项 AppFeature 行为测试全部保留,迁移仅调整动作及状态路径。
  • 新增启动测试:已配置应用作为启动前台时,仅加载前台与目录,不执行切换或增加统计。
  • 新增共享存储测试:根中编辑规则后,切换按新目标执行;切换统计可从根读取并清空。
  • SwiftFormat 0.62.1:46 个 Swift 文件无需格式调整;git diff --check 通过。

Changelog

Select exactly one:

  • Updated both Chinese and English entries under Unreleased in CHANGELOG.md.
  • No changelog entry is needed. Reason: 内部架构重构,保持用户可见行为与持久化格式不变。

Privacy

  • This change does not add telemetry or upload user data, or the reason this is not applicable is explained above.

@ygsgdbd
ygsgdbd marked this pull request as ready for review September 12, 2026 05:12
@ygsgdbd
ygsgdbd merged commit 265ba8a into main Sep 12, 2026
3 checks passed
@ygsgdbd
ygsgdbd deleted the codex/extract-switching-feature branch September 12, 2026 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant