DeepSeek-Reasonix icon indicating copy to clipboard operation
DeepSeek-Reasonix copied to clipboard

[Feature]: 希望桌面端加入通知功能,在跑完的时候通过windows系统发通知

Open FastTiger1010 opened this issue 5 months ago • 1 comments

Version line

v2 — Go rewrite (1.x), main-v2 (active development)

What problem does this solve?

希望如果reasonix在后台,跑完一个任务或者需要审批的时候能发通知

Proposed solution

No response

FastTiger1010 avatar Jun 25 '26 09:06 FastTiger1010

现状

  • 桌面端(Wails)在前台已有音效 —— frontend`sound.ts` 的 `playSuccessChime()` / `playAttentionChime()` 已接入事件流,用户可在设置中选择音效
  • 但完全没有 Windows 系统通知(Toast),窗口最小化到后台后无法感知
  • CLI 版已用 `internal/notify` 包支持了通知,桌面端没接

方案(3个文件改动)

  1. `internal/notify/sender_windows.go` — PowerShell 调 BurntToast 不够稳定,改用 `go-toast` 库直接调用 Windows Toast API(库已在 go.mod 中)
  2. `desktop/app.go` — `App` 结构体加 `notificationSender` 字段,`startup()` 时根据配置初始化
  3. `desktop/tabs.go` — 在 `buildTabControllerWithLoadedSession()` 中,用 `notify.NewSink()` 包装 `tabEventSink`,事件 emit 时自动触发 Toast

触发事件: TurnDone(完成)、ApprovalRequest(审批)、AskRequest(提问) 声音策略: 前台走前端 sound.ts WAV,后台走 go-toast 默认系统提示音 配置: 编辑 `~/.config/reasonix.toml` 的 `[notifications]` 段

Barsit avatar Jun 26 '26 08:06 Barsit

已通过 #5847 修复并合并到 main-v2。

修复内容:

  • 桌面端现在会在 [notifications].enabled = true 时复用已有 internal/notify 事件 sink。
  • TurnDone、失败的 TurnDone、ApprovalRequest、AskRequest 都会转成系统级通知。
  • Windows 使用 go-toast / native Toast,macOS 和 Linux 复用已有平台 sender。
  • 通知是 OS-level system notification,和已有的桌面前端音效/应用内提示分开。

相关贡献:#5365 的 Windows Toast 和桌面事件接入方向已被 #5847 采纳并在 PR body 与 commit history 中明确归因给 @Barsit。

验证:#5847 合并前通过了 Windows/macOS/Ubuntu tests、desktop、race、coverage、lint、govulncheck、CodeQL 和 cache-impact。

SivanCola avatar Jul 03 '26 08:07 SivanCola