Skip to content

Commit f10e448

Browse files
committed
fix(tui): auto-dismiss skill loaded notices after 3 seconds
Transient notices (skill loaded, memory, signal, subagent logs) were piling up because every new event reset the single expiry sweep timer. Now each transient notice gets its own 3-second sweep, so expired notices are pruned independently instead of waiting for a quiet gap. - Reduce noticeTTL from 5s to 3s. - Always prune on noticeExpireMsg; drop the stale-sequence guard that delayed expiry when newer notices arrived.
1 parent 883482c commit f10e448

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

internal/tui/coverage_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func TestTransientNoticeExpires(t *testing.T) {
9696
if got := strings.Join(m.notices, "\n"); got != "sticky" {
9797
t.Errorf("notices after expiry = %q", got)
9898
}
99-
// A stale timer (superseded by a newer notice) must not clear anything.
99+
// A stale timer must not clear notices that have not expired yet.
100100
m.addTransientNote("skill · saved")
101101
m.Update(noticeExpireMsg{seq: m.noticeSeq - 1})
102102
if len(m.notices) != 2 {

internal/tui/model.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ func (a autocomplete) height() int {
169169

170170
// noticeTTL is how long transient info traces (skill / memory / signal /
171171
// subagent) stay on screen before fading out.
172-
const noticeTTL = 5 * time.Second
172+
const noticeTTL = 3 * time.Second
173173

174-
// noticeExpireMsg fires noticeTTL after the last transient notice was added.
174+
// noticeExpireMsg fires noticeTTL after a transient notice was added.
175175
type noticeExpireMsg struct {
176176
seq int
177177
}
@@ -287,10 +287,8 @@ func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
287287
return m.handleEvent(client.Event(msg))
288288

289289
case noticeExpireMsg:
290-
if msg.seq == m.noticeSeq {
291-
m.pruneNotices(time.Now())
292-
m.refresh()
293-
}
290+
m.pruneNotices(time.Now())
291+
m.refresh()
294292
return m, nil
295293

296294
case tea.MouseMsg:

0 commit comments

Comments
 (0)