Skip to content

refactor(config): 移除模板初始化并统一配置懒加载 - #155

Merged
LevelDownRefine merged 5 commits into
mainfrom
codex/genshin-completion-option
Oct 4, 2026
Merged

LevelDownRefine merged 5 commits into
mainfrom
codex/genshin-completion-option

Conversation

@LevelDownRefine

@LevelDownRefine LevelDownRefine commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

原神适配器首次构造和脚本路径变化时,原先会用模板将 CompletionAction 强制覆盖为「关闭游戏和软件」。移除这套模板初始化,在 task_switch_list.yml 声明「完成后操作」,复用现有 TaskOptions 的反读、保存机制,用户修改后才写回。

两套 GUI 对只有一个同名字段的独立选项组直接显示一行控件,不增加分组标题或缩进。「完成后操作」显示为标签加下拉框。

配置适配器统一采用懒初始化:首次使用时构造,之后复用缓存。ScriptConfig 基类仅装配日常、周常,MAA 在自身构造期维护原生任务队列。删除显式 init_config / init_config_all、ensure_config 和 Qt 配置预热;新增或修改脚本路径、标识时仅清除适配器缓存,下次使用时重新构造,不额外执行初始化。输入控件预热仍在首帧后执行。

删除旧 BGI 模板及已无消费者的脚本级 template 元数据,保留日常模板机制。补充反读与显式保存、缓存失效不写盘、首次使用只初始化一次及单行显示的回归测试,并更新测试夹具和 Google 风格函数文档。

验证:

  • Rust 全套 101 项测试通过;Clippy、cargo fmt --check 通过。
  • Qt GUI 全套 380 项测试通过(27 项跳过)。
  • Ruff check、format --check(python-backend、python-gui、tools、runner)及 git diff --check 通过。
  • 最新后端全套运行 966 项:18 项跳过,剩余已有的 1 项计时精度失败、2 项 Windows 符号链接权限错误;本次改动相关测试通过。测试使用当前工作树的后端及 GUI 源码。

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2b4ee074-cbff-4e38-8047-330e4d204a2c
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@LevelDownRefine LevelDownRefine changed the title 移除原神模板初始化,完成后操作复用反读机制 移除原神模板初始化并统一配置懒加载 Oct 4, 2026
@LevelDownRefine LevelDownRefine changed the title 移除原神模板初始化并统一配置懒加载 refactor(config): 移除模板初始化并统一配置懒加载 Oct 4, 2026
@LevelDownRefine
LevelDownRefine merged commit ebd5854 into main Oct 4, 2026
5 checks passed
@LevelDownRefine
LevelDownRefine deleted the codex/genshin-completion-option branch October 4, 2026 11:11
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