refactor: simplify to thin picker architecture#13
Merged
alextnetto merged 1 commit intomainfrom Mar 17, 2026
Merged
Conversation
The TUI is now just a session picker. It collects user intent and exits. All tmux commands run AFTER the TUI closes. Before: persistent TUI → async tmux operations → refresh loop After: fetch sessions → show picker → exit → run tmux command Removed: - setup package (--setup flag, auto-prompt) - tmux.Client interface and mock - Async command pattern (sessionsMsg, operationMsg) - 40+ tests replaced with 21 focused ones Added: - Action struct: TUI returns what to do, caller executes - Package-level tmux functions (no interface indirection) - Clean separation: TUI knows nothing about tmux execution The result: ~300 lines of Go total, zero input handling bugs.
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
Complete rewrite from persistent TUI to thin picker.
Before
TUI stays open → runs async tmux commands → refreshes → handles errors inline
→ Complex state machine, mock objects, input bugs in tmux popup
After
Fetch sessions → show picker → user picks action → TUI exits → run tmux command
→ ~300 lines total, zero input handling bugs
Removed (-1,983 lines)
internal/setup/— auto-setup prompt, --setup flagtmux.Clientinterface,MockClient, integration testssessionsMsg,operationMsg)SetupFuncinjectionAdded (+388 lines)
tui.Actionstruct — TUI returns intent, caller executestmux.*functions — no interface indirectionArchitecture