feat(settings): add microphone device selection#306
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
PR Reviewer Guide 🔍(Review updated until commit 98e3d37)Here are some key observations to aid the review process:
|
c24c72c to
be9daa1
Compare
|
Persistent review updated to latest commit be9daa1 |
|
@claude 这个问题是否确实存在?是否已经解决?是否代码逻辑质量结构清晰完整?如果可以,请告诉我。 |
|
Claude finished @appergb's task in 1m 52s —— View job 代码审查结果
1. 重复设备名称问题:确实存在,本 PR 未解决,属于已知且有意推迟的设计决策问题是否真实存在? result.push(MicrophoneDevice {
id: name.clone(), // ← id 只是 name 的副本,不是稳定平台 ID
name,
is_default: ...,
});
if device.name().ok().as_deref() == Some(preferred) {
return Ok(device); // 同名时取第一个,无法区分
}如果有两个同名设备(常见场景:两个相同型号的 USB 耳麦,或"USB Audio"/"Headset Microphone"等通用名),选择行为是不确定的——总是匹配到枚举顺序中第一个同名设备。 是否已解决?
这是一个有充分理由的有意推迟,并非遗漏。对于大多数用户(单一设备或设备名唯一)不构成实际问题。 2. 代码逻辑质量和结构完整性评估做得好的地方:
可以改进的地方: (偏轻量,不阻 merge)
(需确认)
总结该问题(重复设备名称)确实存在,本 PR 有意未解决,并在 PR 描述中诚实说明了原因和后续路径。这个决策是合理的。 整体代码结构清晰,并发问题修复正确,IPC/状态/前端分层符合项目约定。上述可改进点均为轻量性建议,不影响功能正确性。可以 merge,后续单独跟进稳定设备 ID 支持。 |
|
修复 claude提出的这些问题,随后经过审查便可合并了。 |
be9daa1 to
98e3d37
Compare
|
已处理 Claude 提到的轻量改进项:
关于 验证:
|
|
Persistent review updated to latest commit 98e3d37 |
User description
变更范围:
Review 后补充修复:
平台验证:
npm run build通过。cargo check --manifest-path src-tauri/Cargo.toml通过。cpal跨平台设备枚举,理论上可用。cpal跨平台设备枚举,理论上可用。实现说明:
cpal暴露的设备名称保存和匹配,保持跨平台实现简单,并兼容现有偏好数据。cpal的跨平台公共 API 没有统一暴露稳定 ID;完整实现需要分别接入 Windows endpoint ID / macOS CoreAudio UID,并设计旧偏好的兼容迁移,适合后续单独处理。PR Type
Enhancement
Description
Add microphone device selection to settings and tray
Implement live level monitor in settings picker dialog
Integrate tray microphone menu with auto-refresh
Update i18n strings for English, Japanese, Korean, Chinese
Diagram Walkthrough
File Walkthrough
14 files
Add microphone listing, level monitor start/stop commands, and traystate syncIntegrate microphone device selection and preview stop into recordingpipelineBuild tray microphone menu, background device watcher, and eventhandlingAdd device enumeration and selectable input device parameterAdd microphone_device_name field to UserPreferences and wire typeAdd English microphone UI localization stringsAdd Japanese microphone UI localization stringsAdd Korean microphone UI localization stringsAdd Chinese microphone UI localization stringsAdd Chinese (Taiwan) microphone UI localization stringsAdd frontend IPC wrappers and mock data for microphone featuresAdd MicrophoneDevice interface and microphoneDeviceName toUserPreferencesAdd microphone picker dialog with live level meter and monitor controlAdd prefs:changed event listener for cross-component microphone sync