Skip to content

Commit 68d8684

Browse files
committed
fix(classroom): 领域自动重评跳过用户手动覆写维度(用户裁决优先)
1 parent 618644b commit 68d8684

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

‎app/src-tauri/src/live_session_frame.rs‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ pub fn run_screen_worker(
128128
// v0.11.5(Task 6):已生效形态/领域状态(内存跟踪;None=未定)
129129
let mut current_form: Option<crate::video_profile_spec::ContentForm> = None;
130130
let mut current_domain_kind: Option<crate::video_profile_domain::DomainKind> = None;
131+
// v0.11.5(终审 I-1):领域用户手动覆写标记——用户裁决 > 自动检测,
132+
// 覆写后自动重评不再覆盖该维度(用户手动改过的不自动推翻)
133+
let mut domain_user_locked = false;
131134
// OCR 文本累计(领域自动检测用;去重上限 50 条)
132135
let mut accumulated_ocr_text: Vec<String> = Vec::new();
133136
// 重评窗口计数器(form/domain 仅在窗口结算后做一次自动重评)
@@ -420,7 +423,12 @@ pub fn run_screen_worker(
420423
changed = true;
421424
}
422425
if let Some(f) = po.form { current_form = Some(f); changed = true; }
423-
if let Some(d) = po.domain { current_domain_kind = Some(d); changed = true; }
426+
if let Some(d) = po.domain {
427+
current_domain_kind = Some(d);
428+
// 用户手动覆写 → 锁定该维度(重评不覆盖)
429+
domain_user_locked = true;
430+
changed = true;
431+
}
424432
if changed {
425433
let snapshot = crate::live_session::ProfileOverride {
426434
form: current_form,
@@ -475,7 +483,9 @@ pub fn run_screen_worker(
475483
asr_opening,
476484
};
477485
let detected = crate::video_profile_domain::detect_domain(&domain_signal);
478-
if detected.kind.is_some()
486+
// 终审 I-1:用户已手动覆写领域 → 跳过自动覆盖(用户裁决优先)
487+
if !domain_user_locked
488+
&& detected.kind.is_some()
479489
&& detected.kind != current_domain_kind
480490
&& detected.confidence >= 0.6
481491
{

0 commit comments

Comments
 (0)