Fix panels not redrawing on async updates#9
Merged
bluestreak01 merged 3 commits intomasterfrom Mar 29, 2026
Merged
Conversation
Focused panel handlers (CI, Claude, Shell) intercepted Tick actions and polled async sources, but never set `self.dirty = true`, so the event loop skipped redraws. This caused CI checks to show "loading" forever and panels to appear frozen until a mouse click forced a redraw. Refactor: extract `poll_async()` from duplicated Tick arms in 4 handlers into a single method called once at the top of `handle_action()`, before focus-based input dispatch. This separates the global "time passed, check the world" concern from the per-panel "route this keypress" concern, eliminating ~80 lines of copy-pasted polling code and preventing this class of bug from recurring. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
handle_ci_action,handle_claude_action,handle_shell_action) interceptedAction::Tickand polled async sources, but never setself.dirty = true. The event loop only redraws when dirty, so results were silently dropped.poll_async()method called at the top ofhandle_action()before focus-based dispatch. This ensures polling and dirty-flagging happen exactly once per tick regardless of which panel has focus.What changed
The dispatch flow was:
Now:
Net -79 lines — duplicated polling code across 4 handlers consolidated into one method.
Test plan
🤖 Generated with Claude Code