fix(ui): forward init refresh + tick messages while splash is showing#5
Merged
Conversation
The catch-all message-forwarding block in app.Update was gated screen's Init (the immediate RefreshedMsg, plus the first TickMsg from state.TickCmd) arrived while the splash was still on screen and was silently dropped. Combined with clock.Real().Tick() returning a one-shot channel via time.After, this killed the auto-refresh polling loop entirely. The user saw '0 items · 0 running' until they happened to switch screens or press 'r'. Now RefreshedMsg, TickMsg, and other internal messages are forwarded to the active screen even while the splash is up; only KeyMsg and WindowSizeMsg are still routed to the splash itself. While I was here, also re-record docs/assets/c9s.gif against the fixed build and rewrite tools/demos/c9s.tape to a single dark-theme walk-through covering every major scenario. The tape sets up a fresh XDG_CONFIG_HOME so the recording always picks up the v0.1.4 default skin (k9s-gruvbox-dark) regardless of the recorder's local config.
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.
Summary
Fixes a real bug where the active screen's first
RefreshedMsgand firstTickMsgwere silently dropped while the splash was on screen, leaving users staring at0 items · 0 runninguntil they happened to switch screens or pressr.Root cause
The active screen's
Initreturns atea.Batchthat includesstate.MakeRefreshedCmd(immediate fetch) andstate.TickCmd(first poll). These run in goroutines and emit messages while the splash is still showing — which were dropped.That alone broke the immediate fetch, but the kicker is
clock.Real().Tick()returnstime.After(d)— a one-shot channel. The screen's polling loop re-arms a newTickCmdonly when it receives aTickMsg. If the first tick is dropped, the polling loop dies entirely.End result: containers shown empty until the user switches screens (which re-runs that screen's
Init) or hitsr. You can see this clearly in the previous demo GIF — the screen shows0 itemsfor the first ~30 seconds even though demo data is fully populated.Fix
Forward
TickMsg, modal traffic, and other internal messages to the active screen even while the splash is up. The splash still ownsKeyMsgandWindowSizeMsgvia the typed cases above. (SplashDoneMsgcontinues to flipshowSplash = false.)Tests
Added
TestAppForwardsInitMessagesDuringSplashininternal/ui/app_test.go. Verified locally:0 items · 0 running, 0 exited.Full suite (
go test ./...) green.Demo refresh
While I was here, regenerated
docs/assets/c9s.gifagainst the fixed build and rewrotetools/demos/c9s.tapeto a single dark-theme walk-through covering every major scenario::df,:dns,:property,:kernel):acr-login,:install-docker-shim)The tape also sets up a fresh
XDG_CONFIG_HOMEso the recording always picks up the v0.1.4 default skin (k9s-gruvbox-dark) regardless of the recorder's local config.