Thanks to visit codestin.com
Credit goes to github.com

Skip to content

refactor: separate docker events from Bubble Tea TUI layer#280

Merged
clangenb merged 1 commit into
mainfrom
refactor/separate-docker-events-from-tui-148
Mar 10, 2026
Merged

refactor: separate docker events from Bubble Tea TUI layer#280
clangenb merged 1 commit into
mainfrom
refactor/separate-docker-events-from-tui-148

Conversation

@eldara-cruncher
Copy link
Copy Markdown
Collaborator

Summary

  • Removed bubbletea dependency from the docker/ package entirely
  • Renamed docker.EventMsgdocker.Event and docker.WatchEventsCmd() tea.Cmddocker.WatchEvent() Event (pure blocking function)
  • Added watchEventsCmd() wrapper in app/update.go that wraps the pure call in a tea.Cmd closure — matching the pattern already used for every other docker operation

Closes #148

Manual test: verify Docker events still refresh the UI

The event watcher drives live UI updates when Docker resources change. To verify:

  1. Start a Swarm (./test-setup/testenv.sh up && ./test-setup/testenv.sh deploy)
  2. Run swarmcli (go run .) — lands on the Stacks view
  3. In a separate terminal, scale a service: docker service scale <stack>_<service>=3
  4. Observe the Stacks view — the replica count should update automatically within a few seconds without pressing any key
  5. Navigate to the Nodes view, then run docker node update --label-add test=true <node-id> — the nodes list should refresh automatically

If both views update reactively without manual refresh, the event watcher is working correctly.

🤖 Generated with Claude Code

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]>
Copy link
Copy Markdown
Collaborator

@clangenb clangenb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. Tested that services update!

@clangenb clangenb merged commit 10e45b8 into main Mar 10, 2026
11 of 17 checks passed
@eldara-cruncher eldara-cruncher deleted the refactor/separate-docker-events-from-tui-148 branch June 5, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[docker] separate pure docker methods from TUI bubble tea functions

2 participants