Skip to content

feat(worktree): interactive add-repo, config scope, and clean command#31

Merged
EndersonPro merged 5 commits intomainfrom
codex/worktree-management-improvements
Apr 22, 2026
Merged

feat(worktree): interactive add-repo, config scope, and clean command#31
EndersonPro merged 5 commits intomainfrom
codex/worktree-management-improvements

Conversation

@EndersonPro
Copy link
Copy Markdown
Owner

@EndersonPro EndersonPro commented Apr 22, 2026

Summary

This PR delivers three substantial UX and infrastructure improvements to flutree:

  • Interactive add-repo wizard — replaces the basic numeric selection with a Bubble Tea–powered multi-select UI using arrow keys, space to toggle, and an explicit review/confirm step before mutations. Includes full PTY-based integration tests for apply and cancel paths.
  • Persisted scope.root config — new config set/get scope.root commands that persist a default discovery root path with precedence (--scope flag > persisted config > . fallback). Includes validation for invalid/non-directory/unreachable paths.
  • flutree clean command — new command to clean the current managed worktree, with optional --force to also remove pubspec.lock.

Changes

Commit Description
7acdcdf feat(app): add clean/config services and add-repo wizard core
c98a145 feat(cli): wire config, clean, interactive add-repo, and table UX

Files Changed

File Change
cmd/flutree/main.go New clean command, config set/get handlers, interactive add-repo wiring with TTY gating
internal/ui/add_repo_wizard.go New Bubble Tea wizard model with multi-select, review, and confirm steps
internal/ui/add_repo_wizard_test.go New unit tests for wizard state machine (navigation, toggle, cancel, apply)
internal/app/config_service.go New config service with SetScopeRoot/GetScopeRoot and validation
internal/app/scope_resolver.go New scope precedence resolver (--scope > config > .)
internal/app/clean_service.go New clean service with force mode and lock removal
internal/infra/config/repository.go New versioned JSON config persistence with atomic writes
internal/ui/table.go Migrated flutree list to lipgloss/table with width-aware truncation
integration/cli_contract_test.go PTY harness, PTY tests for wizard apply/cancel, config roundtrip, precedence coverage
docs/usage.md, README.md Updated usage documentation

Test Plan

  • go test ./...183 passed, 0 failed
  • go vet ./... → no issues
  • PTY-based integration tests for interactive apply and cancel paths
  • Config set/get roundtrip integration tests
  • Scope precedence integration tests for create and add-repo

@EndersonPro EndersonPro self-assigned this Apr 22, 2026
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@EndersonPro EndersonPro changed the title Codex/worktree management improvements feat(worktree): interactive add-repo, config scope, and clean command Apr 22, 2026
@EndersonPro EndersonPro added the enhancement New feature or request label Apr 22, 2026
@EndersonPro EndersonPro merged commit 819eb6f into main Apr 22, 2026
2 checks passed
@EndersonPro EndersonPro deleted the codex/worktree-management-improvements branch April 22, 2026 19:19
@EndersonPro EndersonPro restored the codex/worktree-management-improvements branch April 22, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant