diff --git a/src-tauri/src/actions.rs b/src-tauri/src/actions.rs index a26f060..f15efc0 100644 --- a/src-tauri/src/actions.rs +++ b/src-tauri/src/actions.rs @@ -7,7 +7,9 @@ use crate::managers::transcription::TranscriptionManager; use crate::settings::{get_settings, AppSettings, APPLE_INTELLIGENCE_PROVIDER_ID}; use crate::shortcut; use crate::tray::{change_tray_icon, TrayIconState}; -use crate::utils::{self, show_recording_overlay, show_transcribing_overlay}; +use crate::utils::{ + self, show_processing_overlay, show_recording_overlay, show_transcribing_overlay, +}; use crate::ManagedToggleState; use ferrous_opencc::{config::BuiltinConfig, OpenCC}; use log::{debug, error}; @@ -341,6 +343,9 @@ impl ShortcutAction for TranscribeAction { // Then apply LLM post-processing if this is the post-process hotkey // Uses final_text which may already have Chinese conversion applied + if post_process { + show_processing_overlay(&ah); + } let processed = if post_process { post_process_transcription(&settings, &final_text).await } else { diff --git a/src-tauri/src/overlay.rs b/src-tauri/src/overlay.rs index 5fa51a1..b08f650 100644 --- a/src-tauri/src/overlay.rs +++ b/src-tauri/src/overlay.rs @@ -272,39 +272,7 @@ pub fn create_recording_overlay(app_handle: &AppHandle) { } } -/// Shows the recording overlay window with fade-in animation -pub fn show_recording_overlay(app_handle: &AppHandle) { - // Check if overlay should be shown based on position setting - let settings = settings::get_settings(app_handle); - if settings.overlay_position == OverlayPosition::None { - return; - } - - if let Some(overlay_window) = app_handle.get_webview_window("recording_overlay") { - // Update position before showing to prevent flicker from position changes - #[cfg(target_os = "linux")] - { - update_gtk_layer_shell_anchors(&overlay_window); - } - - if let Some((x, y)) = calculate_overlay_position(app_handle) { - let _ = overlay_window - .set_position(tauri::Position::Logical(tauri::LogicalPosition { x, y })); - } - - let _ = overlay_window.show(); - - // On Windows, aggressively re-assert "topmost" in the native Z-order after showing - #[cfg(target_os = "windows")] - force_overlay_topmost(&overlay_window); - - // Emit event to trigger fade-in animation with recording state - let _ = overlay_window.emit("show-overlay", "recording"); - } -} - -/// Shows the transcribing overlay window -pub fn show_transcribing_overlay(app_handle: &AppHandle) { +fn show_overlay_state(app_handle: &AppHandle, state: &str) { // Check if overlay should be shown based on position setting let settings = settings::get_settings(app_handle); if settings.overlay_position == OverlayPosition::None { @@ -320,11 +288,25 @@ pub fn show_transcribing_overlay(app_handle: &AppHandle) { #[cfg(target_os = "windows")] force_overlay_topmost(&overlay_window); - // Emit event to switch to transcribing state - let _ = overlay_window.emit("show-overlay", "transcribing"); + let _ = overlay_window.emit("show-overlay", state); } } +/// Shows the recording overlay window with fade-in animation +pub fn show_recording_overlay(app_handle: &AppHandle) { + show_overlay_state(app_handle, "recording"); +} + +/// Shows the transcribing overlay window +pub fn show_transcribing_overlay(app_handle: &AppHandle) { + show_overlay_state(app_handle, "transcribing"); +} + +/// Shows the processing overlay window +pub fn show_processing_overlay(app_handle: &AppHandle) { + show_overlay_state(app_handle, "processing"); +} + /// Updates the overlay window position based on current settings pub fn update_overlay_position(app_handle: &AppHandle) { if let Some(overlay_window) = app_handle.get_webview_window("recording_overlay") { diff --git a/src/i18n/locales/ar/translation.json b/src/i18n/locales/ar/translation.json index 18bbe14..7a4e59b 100644 --- a/src/i18n/locales/ar/translation.json +++ b/src/i18n/locales/ar/translation.json @@ -497,6 +497,7 @@ "description": "تغيير لغة واجهة Handy" }, "overlay": { - "transcribing": "...جاري التفريغ" + "transcribing": "...جاري التفريغ", + "processing": "...جاري المعالجة" } } diff --git a/src/i18n/locales/cs/translation.json b/src/i18n/locales/cs/translation.json index 4f67129..5bd50b0 100644 --- a/src/i18n/locales/cs/translation.json +++ b/src/i18n/locales/cs/translation.json @@ -497,6 +497,7 @@ "description": "Změňte jazyk rozhraní Handy" }, "overlay": { - "transcribing": "Přepisuji..." + "transcribing": "Přepisuji...", + "processing": "Zpracovávám..." } } diff --git a/src/i18n/locales/de/translation.json b/src/i18n/locales/de/translation.json index 4085e5c..9a6b676 100644 --- a/src/i18n/locales/de/translation.json +++ b/src/i18n/locales/de/translation.json @@ -497,6 +497,7 @@ "description": "Sprache der Handy-Oberfläche ändern" }, "overlay": { - "transcribing": "Transkribiere..." + "transcribing": "Transkribiere...", + "processing": "Verarbeite..." } } diff --git a/src/i18n/locales/en/translation.json b/src/i18n/locales/en/translation.json index 58d842d..c6c2841 100644 --- a/src/i18n/locales/en/translation.json +++ b/src/i18n/locales/en/translation.json @@ -497,6 +497,7 @@ "description": "Change the language of the Handy interface" }, "overlay": { - "transcribing": "Transcribing..." + "transcribing": "Transcribing...", + "processing": "Processing..." } } diff --git a/src/i18n/locales/es/translation.json b/src/i18n/locales/es/translation.json index 6ae8f86..617d63c 100644 --- a/src/i18n/locales/es/translation.json +++ b/src/i18n/locales/es/translation.json @@ -497,6 +497,7 @@ "description": "Cambia el idioma de la interfaz de Handy" }, "overlay": { - "transcribing": "Transcribiendo..." + "transcribing": "Transcribiendo...", + "processing": "Procesando..." } } diff --git a/src/i18n/locales/fr/translation.json b/src/i18n/locales/fr/translation.json index 826412d..47f0b0e 100644 --- a/src/i18n/locales/fr/translation.json +++ b/src/i18n/locales/fr/translation.json @@ -497,6 +497,7 @@ "description": "Changer la langue de l'interface de Handy" }, "overlay": { - "transcribing": "Transcription..." + "transcribing": "Transcription...", + "processing": "Traitement..." } } diff --git a/src/i18n/locales/it/translation.json b/src/i18n/locales/it/translation.json index ae8fae4..cac1cbf 100644 --- a/src/i18n/locales/it/translation.json +++ b/src/i18n/locales/it/translation.json @@ -497,6 +497,7 @@ "description": "Cambia la lingua dell'interfaccia di Handy" }, "overlay": { - "transcribing": "Trascrizione..." + "transcribing": "Trascrizione...", + "processing": "Elaborazione..." } } diff --git a/src/i18n/locales/ja/translation.json b/src/i18n/locales/ja/translation.json index 503b77b..bdf30a8 100644 --- a/src/i18n/locales/ja/translation.json +++ b/src/i18n/locales/ja/translation.json @@ -497,6 +497,7 @@ "description": "Handyインターフェースの言語を変更" }, "overlay": { - "transcribing": "文字起こし中..." + "transcribing": "文字起こし中...", + "processing": "処理中..." } } diff --git a/src/i18n/locales/ko/translation.json b/src/i18n/locales/ko/translation.json index aa18e95..38603f4 100644 --- a/src/i18n/locales/ko/translation.json +++ b/src/i18n/locales/ko/translation.json @@ -497,6 +497,7 @@ "description": "Handy 인터페이스의 언어를 변경하세요" }, "overlay": { - "transcribing": "텍스트로 변환 중..." + "transcribing": "텍스트로 변환 중...", + "processing": "처리 중..." } } diff --git a/src/i18n/locales/pl/translation.json b/src/i18n/locales/pl/translation.json index 8c89e4b..6a51452 100644 --- a/src/i18n/locales/pl/translation.json +++ b/src/i18n/locales/pl/translation.json @@ -497,6 +497,7 @@ "description": "Zmień język interfejsu Handy" }, "overlay": { - "transcribing": "Transkrypcja..." + "transcribing": "Transkrypcja...", + "processing": "Przetwarzanie..." } } diff --git a/src/i18n/locales/pt/translation.json b/src/i18n/locales/pt/translation.json index 887917f..db2cf94 100644 --- a/src/i18n/locales/pt/translation.json +++ b/src/i18n/locales/pt/translation.json @@ -497,6 +497,7 @@ "description": "Alterar o idioma da interface do Handy" }, "overlay": { - "transcribing": "Transcrevendo..." + "transcribing": "Transcrevendo...", + "processing": "Processando..." } } diff --git a/src/i18n/locales/ru/translation.json b/src/i18n/locales/ru/translation.json index ec71884..98645d8 100644 --- a/src/i18n/locales/ru/translation.json +++ b/src/i18n/locales/ru/translation.json @@ -497,6 +497,7 @@ "description": "Изменить языка интерфейса Handy" }, "overlay": { - "transcribing": "Расшифровка..." + "transcribing": "Расшифровка...", + "processing": "Обработка..." } } diff --git a/src/i18n/locales/tr/translation.json b/src/i18n/locales/tr/translation.json index 192745f..0271aa3 100644 --- a/src/i18n/locales/tr/translation.json +++ b/src/i18n/locales/tr/translation.json @@ -497,6 +497,7 @@ "description": "Handy arayüzünün dilini değiştirin" }, "overlay": { - "transcribing": "Transkribe ediliyor..." + "transcribing": "Transkribe ediliyor...", + "processing": "İşleniyor..." } } diff --git a/src/i18n/locales/uk/translation.json b/src/i18n/locales/uk/translation.json index ad040e0..25c5874 100644 --- a/src/i18n/locales/uk/translation.json +++ b/src/i18n/locales/uk/translation.json @@ -497,6 +497,7 @@ "description": "Змінити мову інтерфейсу Handy" }, "overlay": { - "transcribing": "Обробка..." + "transcribing": "Обробка...", + "processing": "Постобробка..." } } diff --git a/src/i18n/locales/vi/translation.json b/src/i18n/locales/vi/translation.json index c2a9699..076f31d 100644 --- a/src/i18n/locales/vi/translation.json +++ b/src/i18n/locales/vi/translation.json @@ -497,6 +497,7 @@ "description": "Thay đổi ngôn ngữ giao diện của Handy" }, "overlay": { - "transcribing": "Đang chuyển đổi..." + "transcribing": "Đang chuyển đổi...", + "processing": "Đang xử lý..." } } diff --git a/src/i18n/locales/zh/translation.json b/src/i18n/locales/zh/translation.json index a30babd..627957a 100644 --- a/src/i18n/locales/zh/translation.json +++ b/src/i18n/locales/zh/translation.json @@ -497,6 +497,7 @@ "description": "更改 Handy 界面的语言" }, "overlay": { - "transcribing": "正在转录..." + "transcribing": "正在转录...", + "processing": "处理中..." } } diff --git a/src/overlay/RecordingOverlay.tsx b/src/overlay/RecordingOverlay.tsx index b90cdc2..67f354d 100644 --- a/src/overlay/RecordingOverlay.tsx +++ b/src/overlay/RecordingOverlay.tsx @@ -11,7 +11,7 @@ import { commands } from "@/bindings"; import i18n, { syncLanguageFromSettings } from "@/i18n"; import { getLanguageDirection } from "@/lib/utils/rtl"; -type OverlayState = "recording" | "transcribing"; +type OverlayState = "recording" | "transcribing" | "processing"; const RecordingOverlay: React.FC = () => { const { t } = useTranslation(); @@ -96,6 +96,9 @@ const RecordingOverlay: React.FC = () => { {state === "transcribing" && (