Skip to content

fix(hotkey): make registration robust and persist only on success#1244

Open
WeeZHnMin wants to merge 1 commit into
pot-app:masterfrom
WeeZHnMin:fix/hotkey-stability
Open

fix(hotkey): make registration robust and persist only on success#1244
WeeZHnMin wants to merge 1 commit into
pot-app:masterfrom
WeeZHnMin:fix/hotkey-stability

Conversation

@WeeZHnMin
Copy link
Copy Markdown

@WeeZHnMin WeeZHnMin commented Mar 12, 2026

Summary

  • Make hotkey registration robust on backend:
    • unregister old shortcut before register
    • persist config only after successful backend flow
    • support clearing shortcut safely
    • avoid "all" registration being blocked by one failure (aggregate errors)
    • return error on unknown hotkey name
  • Update Hotkey settings UI:
    • avoid persisting while typing (sync: false)
    • remove destructive onFocus unregister/clear behavior
    • persist only when backend registration succeeds

Why

  • Prevent invalid/failed hotkey values from being written to config
  • Reduce frontend-backend coupling in unregister/register order
  • Improve startup registration resilience

简要

  • 增强后端热键注册的稳定性:
    • 注册新快捷键前先取消旧快捷键的注册
    • 仅在后端流程成功后才保存配置
    • 安全支持快捷键清除操作
    • 避免因单一注册失败导致“全部”注册被阻塞(聚合错误处理)
    • 对未知的热键名称返回错误提示
  • 更新热键设置界面:
    • 输入时避免即时保存(设置 sync: false)
    • 移除聚焦时自动取消注册或清除的破坏性行为
    • 仅在后端注册成功后才保存配置

原因

  • 防止无效或注册失败的热键值写入配置文件
  • 降低前端与后端在取消注册/重新注册顺序上的耦合度
  • 提升启动时热键注册的容错能力

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant