refactor: separate docker events from Bubble Tea TUI layer#280
Merged
Conversation
Move tea.Cmd/tea.Msg wrapping out of the docker/ package into app/, making docker/ fully TUI-free. The docker package now exposes a pure blocking WatchEvent() → Event function, and the app layer wraps it in a tea.Cmd closure — matching the pattern already used for every other docker operation. Closes #148 Co-Authored-By: Claude Opus 4.6 <[email protected]>
cd425dd to
2ac945f
Compare
clangenb
approved these changes
Mar 10, 2026
Collaborator
clangenb
left a comment
There was a problem hiding this comment.
Code looks good. Tested that services update!
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
bubbleteadependency from thedocker/package entirelydocker.EventMsg→docker.Eventanddocker.WatchEventsCmd() tea.Cmd→docker.WatchEvent() Event(pure blocking function)watchEventsCmd()wrapper inapp/update.gothat wraps the pure call in atea.Cmdclosure — matching the pattern already used for every other docker operationCloses #148
Manual test: verify Docker events still refresh the UI
The event watcher drives live UI updates when Docker resources change. To verify:
./test-setup/testenv.sh up && ./test-setup/testenv.sh deploy)go run .) — lands on the Stacks viewdocker service scale <stack>_<service>=3docker node update --label-add test=true <node-id>— the nodes list should refresh automaticallyIf both views update reactively without manual refresh, the event watcher is working correctly.
🤖 Generated with Claude Code