fix(tui): autoclose every notice in the strip with severity-based TTLs - #38
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Sticky notices —
error: iteration 22: llm: stream idle for over 1m0s without an eventbeing the report — never left the screen. The strip had two tiers: transient notes (3s TTL, self-arming sweep) andaddNotestickies (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
noticeTTL(3s); a newalertTTL(10s) covers errors, warnings, disconnects, and shutdown/upgrade hints — long enough to read, bounded like everything else.noticeSweep()schedules at the earliest pending expiry;noticeExpireMsgprunes and re-arms until the strip is clean, then stops. Replaces thenoticeSeq/noticeTimerdance whose per-caller arming contract was exactly how the sticky path never got a timer.● 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) andTestNoticeSweepRearms(lifecycle: arm, prune-and-rearm, stop) written first, observed RED, then green. Four tests pinning the old sticky contract updated deliberately (TestActionableNotesStaySticky→TestActionableNotesFade…). README notices section synced.go fmt·go vet·golangci-lint(0 issues) ·go test -race -count=1 ./...all green.