Skip to content

fix(tui): autoclose every notice in the strip with severity-based TTLs - #38

Merged
jkyberneees merged 1 commit into
mainfrom
fix/notice-autoclose
Aug 27, 2026
Merged

fix(tui): autoclose every notice in the strip with severity-based TTLs#38
jkyberneees merged 1 commit into
mainfrom
fix/notice-autoclose

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

Problem

Sticky notices — error: iteration 22: llm: stream idle for over 1m0s without an event being the report — never left the screen. The strip had two tiers: transient notes (3s TTL, self-arming sweep) and addNote stickies (zero expiry, no sweep ever armed). Errors landed in the second tier and lived forever.

Fix — holistic, per the report's scope: all messages rendered in the same location

  • No sticky tier anymore. Info traces keep noticeTTL (3s); a new alertTTL (10s) covers errors, warnings, disconnects, and shutdown/upgrade hints — long enough to read, bounded like everything else.
  • Self-re-arming sweep. noticeSweep() schedules at the earliest pending expiry; noticeExpireMsg prunes and re-arms until the strip is clean, then stops. Replaces the noticeSeq/noticeTimer dance whose per-caller arming contract was exactly how the sticky path never got a timer.
  • No state lost. Connection/server state stays visible in the header badge (● disconnected, ● reconnecting…, ● server shut down); retry affordances stay in the footer and ⏎-on-empty. The sticky notes were duplication, not the sole carrier.

Tests

TDD: TestNoticesAutoclose (the reported regression — error events, both addNote branches, disconnect notes) and TestNoticeSweepRearms (lifecycle: arm, prune-and-rearm, stop) written first, observed RED, then green. Four tests pinning the old sticky contract updated deliberately (TestActionableNotesStayStickyTestActionableNotesFade …). README notices section synced.

go fmt · go vet · golangci-lint (0 issues) · go test -race -count=1 ./... all green.

Sticky notices (errors, disconnects, shutdown hints) stored a zero expiry
and never armed the expiry timer, so an error like "llm: stream idle for
over 1m0s" stayed on screen forever.

Nothing in the strip is sticky anymore: info traces keep the 3s TTL, and
a new alertTTL (10s) covers errors, warnings, and disconnect notes — long
enough to read, bounded like everything else. Durable state lives in the
header badge (disconnected / server shut down) and footer retry hints.

The noticeSeq/noticeTimer dance is replaced by noticeSweep(), which
schedules at the earliest pending expiry and re-arms on every tick until
the strip is clean — no per-caller bookkeeping to get wrong.
@jkyberneees
jkyberneees merged commit 0e956c0 into main Aug 27, 2026
5 checks passed
@jkyberneees
jkyberneees deleted the fix/notice-autoclose branch August 27, 2026 17:57
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