翻译模式(issue #4)
按住录音键时随时按一下 Shift(任一侧)→ 录音结束后走"翻译输出"管线,
按"翻译"页中选定的目标语言翻译后插入到光标。
- hotkey.rs 三平台(CGEventTap / Win32 hook / rdev)都监听 Shift down 边沿,
通过新增的 HotkeyEvent::TranslationModifierPressed 上报
- coordinator.rs 加 translation_modifier_seen 标志位(begin_session 重置);
end_session 路径根据它 + 非空 target_language 选 polish 或 translate
- polish.rs 抽 chat_completion 共享通道;新增 translate_to + translate_system_prompt;
working_languages 作为 system prompt 头部前提注入两条管线
- types.rs::UserPreferences 加 working_languages(默认 ["简体中文"])+
translation_target_language(默认空)
- Settings.tsx 删除原来的录音 section 翻译配置;新建 Translation.tsx 一级页(在风格下面),
含工作语言多选 + 目标语言下拉 + 5 步使用指南
- 新增 capsule.tsx 翻译徽章:"● 正在翻译" 蓝色药丸,绝对定位在 pill 上方 8px,
opacity + translateY transition 平滑出入;CapsulePayload 加 translation: bool
- capsule 窗口高度 96 → 110 给 badge 让出空间
- 内置 SUPPORTED_LANGUAGES 列表(15 种自然语言原生名)
Codex 后审修复(基于 4f45dee main 上跑的整体审查)
- tauri.conf.json 主窗口 decorations 由 #108 设的 false 还原为 true,
Windows-only 在 lib.rs::setup 里 set_decorations(false),让 macOS 拿回原生红黄绿
- coordinator.rs::SessionState 加 session_id;spawn_recorder_error_monitor
捕获当前 id,迟到的 cpal 错误若 id 不匹配直接 drop,不会误中止后续 session
- volcengine.rs 把 spawn-per-chunk 模式改成单 mpsc worker 串行 send,
彻底消除跨 consume 调用的 writer 锁 race(之前的 fix 仅在 burst flush 内部有效)
附带修复
- insertion.rs Windows/Linux 粘贴后剪贴板恢复加用户开关 restore_clipboard_after_paste
(issue #111),默认 true 保留现行行为;关掉后听写文本留剪贴板,paste 失败时可手动 Ctrl+V 找回
- SettingsModal 内容区改为 flex column + overflow:hidden,X 按钮 + 标题固定,
只 section 内容区滚动;Settings.tsx 嵌入模式右栏独立 scroll
- Settings → 提供商:火山引擎 "App Key" 文案改为 "App ID"
(keychain account name 不变,老用户凭据不丢)
- i18n 增加 capsule.translating / nav.translation / translation.* 完整命名空间
OpenLess All-Platform
This is the current cross-platform OpenLess workspace.
App Directory
The runnable Tauri app lives in app/.
cd app
npm ci
npm run tauri dev
macOS Build
Use the project build script instead of calling tauri build directly:
cd app
INSTALL=0 ./scripts/build-mac.sh
Generated macOS artifacts:
app/src-tauri/target/release/bundle/macos/OpenLess.appapp/src-tauri/target/release/bundle/dmg/OpenLess_1.1.0_aarch64.dmg
For local install during development:
cd app
./scripts/build-mac.sh
Windows Build
The runnable Tauri app is still app/. Windows contributors should run a
preflight before building so missing MSVC, Windows SDK, or MinGW tools fail
with actionable messages.
cd app
powershell -ExecutionPolicy Bypass -File .\scripts\windows-preflight.ps1
MSVC Route
Use this route when Visual Studio Build Tools and the Windows SDK are installed.
Open a Developer PowerShell, or call vcvars64.bat, then run:
cd app
npm ci
npm run tauri -- build
Required Visual Studio Installer components:
Microsoft.VisualStudio.Workload.VCTools- MSVC v143 x64/x86 build tools
- Windows 10/11 SDK that provides
kernel32.lib
If link.exe or kernel32.lib is missing, rerun:
powershell -ExecutionPolicy Bypass -File .\scripts\windows-preflight.ps1 -Toolchain msvc
GNU / MinGW Route
Use this route when MSVC/Windows SDK is unavailable. The app now lives under
the no-space openless-all directory to avoid GNU/MinGW path quoting issues
while generating import libraries. Use the helper script to keep the GNU build
environment and target setup consistent.
cd app
scoop install rustup mingw
rustup toolchain install stable-x86_64-pc-windows-gnu
rustup target add x86_64-pc-windows-gnu
powershell -ExecutionPolicy Bypass -File .\scripts\windows-preflight.ps1 -Toolchain gnu
powershell -ExecutionPolicy Bypass -File .\scripts\windows-build-gnu.ps1
Generated GNU artifacts:
%TEMP%\openless-windows-gnu\src-tauri\target\x86_64-pc-windows-gnu\release\openless.exe%TEMP%\openless-windows-gnu\src-tauri\target\x86_64-pc-windows-gnu\release\bundle\msi\OpenLess_*_x64_en-US.msi%TEMP%\openless-windows-gnu\src-tauri\target\x86_64-pc-windows-gnu\release\bundle\nsis\OpenLess_*_x64-setup.exe
Hotkey Injection Gate
Use this gate before/after Windows hotkey changes when a physical keyboard
regression is unavailable. It injects a dev/test-only hotkey click through the
coordinator handle_pressed / handle_released path, asserts the log contains
[coord] hotkey pressed, and cancels the dry-run session automatically.
cd app
npm run check:hotkey-injection
Windows Runtime Notes
- Windows does not need the macOS Accessibility permission. Use Settings -> Permissions -> Global hotkey to inspect listener status.
- Microphone permission is checked by opening a short-lived input stream, so a device-format query alone is not treated as permission granted.
- Text insertion through
Ctrl+Vis treated as copy fallback unless the app can confirm insertion.
Release Signing
Tagged releases (v*-tauri) must be Developer ID signed and notarized so users can download and open the macOS app without manually removing quarantine attributes.
Required GitHub secrets:
APPLE_CERTIFICATEAPPLE_CERTIFICATE_PASSWORDAPPLE_IDAPPLE_PASSWORDAPPLE_TEAM_ID
Optional:
APPLE_PROVIDER_SHORT_NAMEKEYCHAIN_PASSWORD
Manual workflow runs can still produce ad-hoc signed test builds, but tagged macOS releases fail if signing/notarization secrets are missing.
Ignored Local Output
The following are intentionally local-only:
app/node_modules/app/dist/app/src-tauri/target/app/src-tauri/gen/.DS_Store