Repository navigation
fix(windows): 补齐运行时反馈和平台化交互 - #23
Conversation
Reviewer's GuideImplements Windows-focused runtime feedback and platform-specific behavior: adds a global hotkey installation status IPC and UI, differentiates hotkey labels/options per OS, improves microphone permission probing on non‑macOS, refines text insertion result reporting, wires up feedback/help/update/history entry points, and aligns the repolish IPC contract with the backend. Sequence diagram for global hotkey installation status IPC flowsequenceDiagram
actor User
participant SettingsPageTs as SettingsPage
participant IpcTs as ipc_getHotkeyStatus
participant Tauri as TauriRuntime
participant CommandsRs as get_hotkey_status
participant Coordinator as Coordinator
User->>SettingsPageTs: Open Settings page
activate SettingsPageTs
SettingsPageTs->>IpcTs: getHotkeyStatus()
activate IpcTs
IpcTs->>Tauri: invoke get_hotkey_status
activate Tauri
Tauri->>CommandsRs: get_hotkey_status(coord)
activate CommandsRs
CommandsRs->>Coordinator: hotkey_status()
activate Coordinator
Coordinator-->>CommandsRs: HotkeyStatusRs
deactivate Coordinator
CommandsRs-->>Tauri: HotkeyStatusRs
deactivate CommandsRs
Tauri-->>IpcTs: HotkeyStatusRs (serialized)
deactivate Tauri
IpcTs-->>SettingsPageTs: Promise<HotkeyStatusTs>
deactivate IpcTs
SettingsPageTs->>SettingsPageTs: setHotkey(status)
SettingsPageTs-->>User: Render HotkeyStatusPill
deactivate SettingsPageTs
Sequence diagram for updated text insertion result and capsule feedbacksequenceDiagram
actor User
participant CapsuleTs as CapsuleComponent
participant Backend as TauriBackend
participant Inserter as TextInserter
participant OS as OperatingSystem
User->>CapsuleTs: Confirm insert
activate CapsuleTs
CapsuleTs->>Backend: end_session()
activate Backend
Backend->>Inserter: insert(text)
activate Inserter
Inserter->>Inserter: copy_to_clipboard(text)
Inserter->>OS: simulate_paste()
OS-->>Inserter: Result<(), String>
alt simulate_paste error
Inserter->>Inserter: log warn
Inserter-->>Backend: InsertStatus::CopiedFallback
else simulate_paste ok
Inserter->>OS: insertion_success_status()
OS-->>Inserter: InsertStatus (mac inserted, others copiedFallback)
Inserter-->>Backend: InsertStatus
end
deactivate Inserter
Backend->>Backend: map InsertStatus to done_message
Backend-->>CapsuleTs: emit_capsule(state=Done, message, inserted_chars)
deactivate Backend
CapsuleTs->>CapsuleTs: render message or fallback
CapsuleTs-->>User: Shows "已插入" or "已复制,请 Ctrl+V"
deactivate CapsuleTs
Class diagram for updated hotkey status tracking across frontend and backendclassDiagram
class HotkeyStatusRs {
+HotkeyStatusState state
+Option~String~ message
+default() HotkeyStatusRs
}
class HotkeyStatusStateRs {
<<enum>>
+Starting
+Installed
+Failed
}
class Inner {
+Mutex~Option~Arc~VolcengineStreamingASR~~~~ asr
+Mutex~Option~Recorder~ recorder
+Mutex~Option~HotkeyMonitor~ hotkey
+Mutex~HotkeyStatusRs~ hotkey_status
}
class Coordinator {
-Arc~Inner~ inner
+new() Coordinator
+hotkey_status() HotkeyStatusRs
+start_dictation() Result
+end_dictation() Result
}
class CommandsRs {
+get_settings(coord CoordinatorState) UserPreferences
+set_settings(coord CoordinatorState, prefs UserPreferences) Result
+get_hotkey_status(coord CoordinatorState) HotkeyStatusRs
}
class HotkeyStatusTs {
+HotkeyStatusStateTs state
+string message
}
class HotkeyStatusStateTs {
<<string-literal-union>>
+'starting'
+'installed'
+'failed'
}
class IpcTs {
+getHotkeyStatus() Promise~HotkeyStatusTs~
+getSettings() Promise~UserPreferences~
+setSettings(prefs UserPreferences) Promise~void~
+repolish(rawText string, mode PolishMode) Promise~string~
+openExternal(url string) Promise~void~
}
class SettingsPageTs {
+RecordingSection()
+PermissionsSection()
+ShortcutsSection()
+AboutSection()
}
class PermissionsSectionTs {
-PermissionStatus accessibility
-PermissionStatus microphone
-HotkeyStatusTs hotkey
+refresh()
+render()
}
class HotkeyStatusPillTs {
+status HotkeyStatusTs
+render()
}
HotkeyStatusRs --> HotkeyStatusStateRs
Inner o-- HotkeyStatusRs
Coordinator *-- Inner
Coordinator ..> HotkeyStatusRs : returns
CommandsRs ..> Coordinator : uses
CommandsRs ..> HotkeyStatusRs : returns
HotkeyStatusTs --> HotkeyStatusStateTs
IpcTs ..> HotkeyStatusTs : returns
PermissionsSectionTs ..> IpcTs : calls getHotkeyStatus
PermissionsSectionTs --> HotkeyStatusTs
HotkeyStatusPillTs --> HotkeyStatusTs
SettingsPageTs *-- PermissionsSectionTs
SettingsPageTs ..> HotkeyStatusPillTs
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The non-macOS branch of
open_system_settingsincommands.rsalways shells out viacmd /C startand uses Windowsms-settings:URIs, which will break on Linux; consider gating this logic behind#[cfg(target_os = "windows")]and providing a no-op or Linux-appropriate behavior for other platforms. - In several React components (
History,Overview,FloatingShellBody) you calldetectOS()or derive the hotkey label multiple times inside render logic; it would be cleaner and slightly more efficient to computeos/hotkeyLabelonce per component and reuse those values (e.g., also reusehotkeyLabelin the history insert-status text instead of callingdetectOS()again). - The clickable “检查更新” button in
FloatingShellis styled withcursor: 'default', which makes it appear non-interactive; consider switching tocursor: 'pointer'to match its actual behavior.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The non-macOS branch of `open_system_settings` in `commands.rs` always shells out via `cmd /C start` and uses Windows `ms-settings:` URIs, which will break on Linux; consider gating this logic behind `#[cfg(target_os = "windows")]` and providing a no-op or Linux-appropriate behavior for other platforms.
- In several React components (`History`, `Overview`, `FloatingShellBody`) you call `detectOS()` or derive the hotkey label multiple times inside render logic; it would be cleaner and slightly more efficient to compute `os`/`hotkeyLabel` once per component and reuse those values (e.g., also reuse `hotkeyLabel` in the history insert-status text instead of calling `detectOS()` again).
- The clickable “检查更新” button in `FloatingShell` is styled with `cursor: 'default'`, which makes it appear non-interactive; consider switching to `cursor: 'pointer'` to match its actual behavior.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
Windows 真机回归已跑完,结论:构建和基本启动通过,但这版还不建议合并,需要继续改两处。 通过项:
需要修改:
GitHub 不允许我对自己发起的 PR 提交 |
|
已根据上一轮 Windows review findings 追加修复,提交: 修复项:
复验:
|
|
已更新 PR head,补齐 fork/dev 中已经验证过的 Windows 构建交付,并回填 CI。 新增提交:
本次更新包含:
本地复验:
|
|
fork/dev CI 已回填并通过。
当前 #23 仍为 mergeable,且没有失败 check。 |
|
继续同步 fork/dev Windows 回归能力到 #23:
当前无人值守环境缺少真实 ASR/LLM 凭据,且 rdev 全局热键不能稳定用 SendInput 合成触发,所以真实“语音转写 + 前台粘贴 fallback”仍需要配置真实凭据后用物理按键做人工验收。脚本已把这些步骤列为 manual checks。 |
变更摘要
关联 Issue
Fixes #16
Fixes #17
Fixes #18
Fixes #19
Fixes #20
Fixes #21
Fixes #22
验证
备注
openless -all仍会触发已记录的 Windows GNU 空格路径问题,因此 Rust 门禁在D:\Users\cooper\Practice-Project\202604\openless_all_app_copy中执行。.agents/、.codex/或.github/workflows/ci.yml。Summary by Sourcery
Improve Windows runtime behavior and platform-specific UX, including hotkey monitoring visibility, microphone permission detection, text insertion feedback, and entry points to help, feedback, and updates.
New Features:
Bug Fixes:
Enhancements: