fix(daemon): use NoticeClipboard for empty yank-history warn
NoticeInternal is reserved for unclassified failures; an empty notification history is a known, benign outcome of the yank command, not an internal error.
- commit
- 7a384bc6a5e9760cb3b30756a849c4e1824d85c8
- author
- brice · · 2026-07-20 17:11 UTC
- parent
- 2cb5bb3
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +2 -2
M internal/usecase/daemon/notices_overlay_test.go +1 -1
| @@ -203,7 +203,7 @@ func TestYankLastNotificationWithEmptyHistoryShowsWarnToast(t *testing.T) { | |||
| 203 | 203 | ||
| 204 | 204 | history := d.notices.history() | |
| 205 | 205 | require.Len(t, history, 1) | |
| 206 | - | require.Equal(t, domain.NoticeInternal, history[0].Code) | |
| 206 | + | require.Equal(t, domain.NoticeClipboard, history[0].Code) | |
| 207 | 207 | require.Equal(t, domain.NoticeWarn, history[0].Severity) | |
| 208 | 208 | require.Equal(t, "no notifications yet", history[0].Message) | |
| 209 | 209 | } | |
| @@ -203,7 +203,7 @@ func TestYankLastNotificationWithEmptyHistoryShowsWarnToast(t *testing.T) { | |||||
| 203 | 203 | ||||
| 204 | history := d.notices.history() | 204 | history := d.notices.history() | ||
| 205 | require.Len(t, history, 1) | 205 | require.Len(t, history, 1) | ||
| 206 | - | require.Equal(t, domain.NoticeInternal, history[0].Code) | 206 | + | require.Equal(t, domain.NoticeClipboard, history[0].Code) |
| 207 | require.Equal(t, domain.NoticeWarn, history[0].Severity) | 207 | require.Equal(t, domain.NoticeWarn, history[0].Severity) | ||
| 208 | require.Equal(t, "no notifications yet", history[0].Message) | 208 | require.Equal(t, "no notifications yet", history[0].Message) | ||
| 209 | } | 209 | } | ||
M internal/usecase/daemon/palette.go +1 -1
| @@ -491,7 +491,7 @@ func (e paletteExec) YankLastNotification() error { | |||
| 491 | 491 | // Reported directly rather than returned: the generic cmd.Run error | |
| 492 | 492 | // path only logs, so a returned error here would never reach the | |
| 493 | 493 | // user as the warn toast this no-op is supposed to produce. | |
| 494 | - | e.d.reportError(e.sess, domain.UserWarn(domain.NoticeInternal, "no notifications yet", nil)) | |
| 494 | + | e.d.reportError(e.sess, domain.UserWarn(domain.NoticeClipboard, "no notifications yet", nil)) | |
| 495 | 495 | return nil | |
| 496 | 496 | } | |
| 497 | 497 | e.d.yankNotice(e.sess, e.ac, n) | |
| @@ -491,7 +491,7 @@ func (e paletteExec) YankLastNotification() error { | |||||
| 491 | // Reported directly rather than returned: the generic cmd.Run error | 491 | // Reported directly rather than returned: the generic cmd.Run error | ||
| 492 | // path only logs, so a returned error here would never reach the | 492 | // path only logs, so a returned error here would never reach the | ||
| 493 | // user as the warn toast this no-op is supposed to produce. | 493 | // user as the warn toast this no-op is supposed to produce. | ||
| 494 | - | e.d.reportError(e.sess, domain.UserWarn(domain.NoticeInternal, "no notifications yet", nil)) | 494 | + | e.d.reportError(e.sess, domain.UserWarn(domain.NoticeClipboard, "no notifications yet", nil)) |
| 495 | return nil | 495 | return nil | ||
| 496 | } | 496 | } | ||
| 497 | e.d.yankNotice(e.sess, e.ac, n) | 497 | e.d.yankNotice(e.sess, e.ac, n) | ||