拆分 coordinator 子状态机模块#378
Merged
H-Chris233 merged 1 commit intoMay 9, 2026
Merged
Conversation
coordinator.rs had accumulated dictation lifecycle, QA panel state, and shared recording resources in one file. This split keeps behavior unchanged while moving the dictation edge/session helpers, QA panel state helpers, and resource ownership helpers into child modules under coordinator/. Constraint: Issue Open-Less#296 asks for module boundaries after Rust state-machine coverage is in place Rejected: Split every helper into separate public modules | larger churn with no behavior benefit Confidence: high Scope-risk: moderate Directive: Keep cross-module wiring in coordinator; leaf modules should remain coordinator-private Tested: cargo check --manifest-path openless-all/app/src-tauri/Cargo.toml Tested: cargo test --manifest-path openless-all/app/src-tauri/Cargo.toml --lib Tested: cargo test --manifest-path openless-all/app/src-tauri/backend-tests/Cargo.toml Co-authored-by: OmX <omx@oh-my-codex.dev>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
appergb
pushed a commit
that referenced
this pull request
May 9, 2026
Beta-6 包含的合并: - #379 fix(recorder): watchdog 在 sleep 醒来后重检 stop_flag,消除停采误报 - #380 fix(commands): wrap tray refresh in run_on_main_thread 修主线程死锁 - #381 feat(ui): consolidate footer/nav, sliding indicator, hover cues, top-right saved toast - #378 拆分 coordinator 子状态机模块(间接合入) Tag: v1.2.24-6-beta-tauri 推到 main 后触发 release-tauri.yml Beta 流水线。
appergb
pushed a commit
that referenced
this pull request
May 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
变更说明
Closes #296
按最小改动原则,把
coordinator.rs中已经有测试覆盖的高风险区域拆到 coordinator 私有子模块:coordinator/dictation.rs:主听写 hotkey edge、begin / stop / cancel session 生命周期及错误收尾。coordinator/qa.rs:QA 浮窗状态类型与 QA panel / Option edge 路由。coordinator/resources.rs:ASR / Recorder session resource、录音静音、预览 recorder 清理等共享资源管理。保留
Coordinator/Inner作为统一 owner,外部 IPC 与跨模块 wiring 仍在coordinator.rs,避免扩大行为变更面。验证
cargo check --manifest-path openless-all/app/src-tauri/Cargo.tomlcargo test --manifest-path openless-all/app/src-tauri/Cargo.toml --libcargo test --manifest-path openless-all/app/src-tauri/backend-tests/Cargo.tomlPR Type
Enhancement
Description
Split the 3842-line
coordinator.rsinto three submodulesMove dictation session lifecycle to
dictation.rsMove QA panel state machine to
qa.rsExtract shared recording resources into
resources.rsDiagram Walkthrough
File Walkthrough
coordinator.rs
Remove moved functions and add module declarationsopenless-all/app/src-tauri/src/coordinator.rs
moved to submodules
mod dictation; mod qa; mod resources;declarations and necessaryimports
new submodules)
dictation.rs
Extract dictation session lifecycle into new moduleopenless-all/app/src-tauri/src/coordinator/dictation.rs
hotkey edge handlers
insertion logic
abort_recording_with_erroranddictation_error_codefor testuse
qa.rs
Extract QA panel state machine into qa moduleopenless-all/app/src-tauri/src/coordinator/qa.rs
QaPhase,QaSessionState,open/close panel functions
resources.rs
Extract shared recording resources into resources moduleopenless-all/app/src-tauri/src/coordinator/resources.rs
SessionResource,SharedRecordingMuteStateacquire/release, and cleanup functions