From 18230f1279d3c21fd20dc164eca6f68df544aae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=95=E6=9F=8F=E9=9D=92?= Date: Tue, 16 Jun 2026 13:13:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(remote):=20=E5=90=AC=E5=86=99=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E5=90=8E=20emit=20remote:result=EF=BC=8C=E6=89=8B?= =?UTF-8?q?=E6=9C=BA=E7=AB=AF=E6=89=8D=E8=83=BD=E7=9C=8B=E5=88=B0=E8=AF=86?= =?UTF-8?q?=E5=88=AB=E7=BB=93=E6=9E=9C=20(#691)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit remote_server 的 WS handler 订阅了 "remote:result" 并转发给手机、H5 也准备好显示, 但全仓没有任何一处 emit 该事件——手机端结果区永远空。 在 finalize(history.append 之后)按已有 app.emit("vocab:updated", ...) 同模式 emit 最终文字 polished 到 "remote:result"(非空才发)。无手机连接时无人转发 = 无害空操作。 --- openless-all/app/src-tauri/src/coordinator/dictation.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openless-all/app/src-tauri/src/coordinator/dictation.rs b/openless-all/app/src-tauri/src/coordinator/dictation.rs index cd5e263c..7c8bbd5e 100644 --- a/openless-all/app/src-tauri/src/coordinator/dictation.rs +++ b/openless-all/app/src-tauri/src/coordinator/dictation.rs @@ -2406,6 +2406,14 @@ pub(super) async fn end_session(inner: &Arc) -> Result<(), String> { ) { log::error!("[coord] history append failed: {e}"); } + // 把本次最终文字转发给已连接的远程手机:remote_server 的 WS handler 订阅了 + // "remote:result",H5 在状态区下方显示(type=result)。此前全仓无任何处 emit 该事件, + // 手机用户永远看不到识别结果。无手机连接时该事件无人转发 = 无害空操作。 + if !polished.trim().is_empty() { + if let Some(app) = inner.app.lock().clone() { + let _ = app.emit("remote:result", polished.clone()); + } + } let done_message = if tsf_required_insert_failed { Some("TSF 未上屏,已禁止非 TSF 兜底".to_string()) } else {