fix(tui): finish the MVU I/O eviction (Phase 0 follow-ups) #102
Reference in New Issue
Block a user
Delete Branch "fix/tui-mvu-followups"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Completes the Phase 0 scope from the fresh-eyes review. PR #101 landed the tick-path refactor; this finishes the rest.
Theme global-style race
applyThememutated ~18 package-global lipgloss styles while every SSH session'stea.Programread them concurrently — pressingTor any new connection raced other sessions'Viewand bled themes across users. Styles now live in an immutable per-Modelstylesstruct built bynewStyles; the globals are deleted, so the race is structurally impossible. Free formatter helpers became Model methods.Remaining keypress reads → Cmds
hhistory and the SLA view load vialoadHistoryCmd/loadSLACmdwith loading placeholders; replies for a different site/period are droppedtabDataMsgcarries a monotonic seq — out-of-order replies from slower earlier loads are droppeddetailDataMsgdropped when the cursor moved to another sitedetailRefreshCmd) instead of loading once on entryinitSiteHuhFormreads them.alertscache instead of hitting the storeAll store writes → Cmds
Deletes, pause toggle, end-maintenance, theme/collapse prefs, and all four form submits run through
writeCmd→writeDoneMsg, which logs failures and reloads tab data after the write lands. In-memory engine/model mutations stay in Update so rows react instantly. A failed site delete self-heals: the engine poll loop re-adds any site still in the DB.Notes
testAlertCmdalready had); acceptable per the review planTests
go test -race ./...green, golangci-lint 0 issues. Seven new tests: seq-guard drops, stale history/SLA replies, async delete, write-error logging, detail refresh gating.