Skip to content

feat: 快捷键录入交互重构 + ASR 模型体系升级(6 项按职责拆分) - #884

Merged
appergb merged 6 commits into
betafrom
feat/hotkey-menu-and-asr-models
Aug 3, 2026
Merged

feat: 快捷键录入交互重构 + ASR 模型体系升级(6 项按职责拆分)#884
appergb merged 6 commits into
betafrom
feat/hotkey-menu-and-asr-models

Conversation

@appergb

@appergb appergb commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

User description

目标(一个 PR,六项按单一职责拆分)

  1. feat(hotkey-recorder) — 快捷键录入交互重构:未展开主行只留键帽+箭头(录入入口统一在展开菜单),箭头恒靠最右,菜单动画改固定高度不再卡顿;ShortcutRecorder 支持 value=null 直接录入即启用
  2. fix(update-button) — 检查更新按钮旋转方向(逆时针,与 ccw 图标一致)+ 按钮尺寸稳定(固定宽度居中、图标固定容器)
  3. refactor(coding-agent) — Less Computer 后端/权限模式/模型选择改用官方 SelectLite(替代原生 select)
  4. feat(asr-models) — 云端 ASR 模型预设下拉:加入千问 qwen3-asr-flash(-realtime/-filetrans)、fun-asr 新版本、paraformer;OpenAI 兼容厂商通用预设;与既有 unifiedBailian 机制融合
  5. feat(local-asr) — 本地模型三板块重构(模型选择/下载与管理/其他)+ 下拉选择已下载模型 + 新增 Whisper Large V3 多语
  6. chore(i18n) — 五语言新文案

兼容性影响

  • 无破坏性变更;bailian 隐藏别名(bailian-qwen3-realtime / bailian-fun-asr-flash)逻辑保持
  • CredentialField 新增可选 options prop,既有 provider/onValueChange 行为不变
  • 新增模型为 Whisper 模式复用(Rust sherpa.rs 仅加条目),不影响现有模型

测试命令与结果

  • npx tsc --noEmit ✅(beta 基线 + 本分支)
  • npm run build(tsc + vite)✅
  • cargo check --manifest-path src-tauri/Cargo.toml ✅(无新增 warning)
  • npm run check:hotkey-side-modifiers
  • Tauri 打包(release dmg)✅ 已在本机安装验证(macOS aarch64)

证据

  • macOS 手动验证:快捷键录入新交互(滑动动画/菜单)、检查更新按钮旋转方向、本地模型三板块布局
  • 冲突解决说明:分支基于最新 origin/beta,ProvidersSection 与云端已有 unifiedBailian 机制融合(未覆盖云端改动)

链接

  • 关联 AGENTS.md 提交规范;无 issue 编号(本轮为迭代反馈直接实现)

PR Type

Enhancement, Bug fix


Description

  • Refactor ShortcutRecorder to a dropdown menu with record/reset/disable.

  • Add ASR model presets for Bailian and Whisper-compatible providers.

  • Restructure local ASR page and add Whisper Large V3.

  • Switch coding agent selects to SelectLite; fix update button spin.


Diagram Walkthrough

flowchart LR
  A["ShortcutRecorder"] --> B["Dropdown actions"]
  C["ProvidersSection"] --> D["Model presets"]
  E["LocalAsr"] --> F["Grouped sections"]
  G["sherpa.rs"] --> H["Whisper Large V3"]
Loading

File Walkthrough

Relevant files
Enhancement
8 files
sherpa.rs
Add Whisper Large V3 multilingual model to catalog             
+19/-0   
ShortcutRecorder.tsx
Rewrite shortcut recorder with dropdown menu and animations
+222/-97
hotkey.ts
Add default dictation hotkey helper                                           
+6/-0     
localAsr.ts
Register Whisper Large V3 in local model catalog                 
+13/-0   
index.tsx
Restructure local ASR page into three sections                     
+161/-92
ProvidersSection.tsx
Add ASR model presets with custom model option                     
+91/-12 
RecordingInputSection.tsx
Add reset and disabled-disable for dictation shortcut       
+9/-1     
ShortcutsSection.tsx
Unify nullable shortcut editing with ShortcutRecorder       
+62/-116
I18n
5 files
en.ts
Add English strings for shortcut and ASR UI                           
+13/-0   
ja.ts
Add Japanese strings for shortcut and ASR UI                         
+13/-0   
ko.ts
Add Korean strings for shortcut and ASR UI                             
+13/-0   
zh-CN.ts
Add Simplified Chinese strings for new UI labels                 
+13/-0   
zh-TW.ts
Add Traditional Chinese strings for new UI labels               
+13/-0   
Bug fix
2 files
CheckUpdateButton.tsx
Stabilize update button and fix spin direction                     
+10/-6   
global.css
Reverse update spinner rotation direction                               
+3/-2     
Refactor
1 files
CodingAgentSection.tsx
Replace native selects with SelectLite                                     
+31/-39 

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

(Review updated until commit 938d52f)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

UI Regression

The disable button in the expanded menu is now always rendered, even when no onDisable handler is provided. For the translation shortcut row in ShortcutsSection, for example, the menu shows a greyed-out "Disable" button with no tooltip (no disableHint is passed), which is confusing because the button is inert. Previously the button was hidden when onDisable was absent. Hide the button when onDisable is missing, or pass a hint explaining why it's disabled.

<motion.button
  initial={{ y: 4, opacity: 0 }}
  animate={{ y: 0, opacity: 1 }}
  transition={{ duration: 0.16, ease: menuEase, delay: 0.06 }}
  whileHover={canDisable ? { y: -1 } : undefined}
  whileTap={canDisable ? { scale: 0.96 } : undefined}
  onClick={canDisable ? doDisable : undefined}
  title={canDisable ? undefined : disableHint}
  style={canDisable ? menuButtonStyle : disabledMenuButtonStyle}
>
  {disableLabel ?? t('settings.shortcuts.disable', 'Disable')}
</motion.button>

sim added 4 commits August 3, 2026 10:37
- 未展开主行只留键帽 + 下拉箭头,录入入口统一在展开菜单里(录制快捷键/重置/停用)
- 箭头恒靠最右;菜单展开/收起高度改为固定值动画,多次切换不再卡顿
- ShortcutRecorder 支持 value=null(问答/切风格/唤起 App 未启用时直接录入即启用)
- 菜单支持 Esc / 点击外部收起;滑动方向统一向右
- 新增 defaultDictationHotkey()(RightControl,与 mock/Rust 默认一致)
- ol-spin 改为逆时针,与 refresh(ccw)图标方向一致
- 按钮固定宽度 + 内容居中;图标固定 14x14 容器,check/refresh 切换与旋转时不再跳动
统一三平台下拉观感,替换原生 <select>(issue #418 同类问题);模型下拉保留
「默认」选项,可选回 CLI 默认模型
- 百炼:qwen3-asr-flash(-realtime)、fun-asr 系列新版本、paraformer 预设
  (filetrans 官方只接受公网 URL、后端显式拒绝,不放预设)
- Whisper 兼容厂商(whisper/groq/siliconflow/openrouter):通用预设下拉
- CredentialField 支持 options 下拉,含「自定义模型…」逃生口(切回输入框),
  与既有 unifiedBailian 协议提示/onValueChange 机制融合
@appergb
appergb force-pushed the feat/hotkey-menu-and-asr-models branch from 44733ac to 0a1a8ad Compare August 3, 2026 02:37
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 0a1a8ad

sim added 2 commits August 3, 2026 10:51
- 新增「模型选择」板块:SelectLite 下拉直接选用已下载模型(选择即激活)
- 板块重排:模型选择 / 下载与管理 / 其他(存储位置、Apple 语音)
- 新增 sherpa-onnx Whisper Large V3 多语模型(Rust 下载配置 + TS 目录 + mock)
- 同步 static_catalog_preserves_ui_order 期望列表
- 快捷键:comboResetBtn / comboMenuToggle / comboDisableHint
- 本地模型:sherpaModelWhisperLargeV3(+Desc)、modelSelect*、groupDownload/Other
- 模型预设:customModelLabel / presetListLabel
@appergb
appergb force-pushed the feat/hotkey-menu-and-asr-models branch from 0a1a8ad to 938d52f Compare August 3, 2026 02:51
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 938d52f

@appergb
appergb merged commit 3244df1 into beta Aug 3, 2026
5 checks passed
@appergb
appergb deleted the feat/hotkey-menu-and-asr-models branch August 3, 2026 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant