feat(sync): selective project export with TUI checkboxes#108
Open
alvarorestrepo wants to merge 1 commit intoGentleman-Programming:mainfrom
Open
feat(sync): selective project export with TUI checkboxes#108alvarorestrepo wants to merge 1 commit intoGentleman-Programming:mainfrom
alvarorestrepo wants to merge 1 commit intoGentleman-Programming:mainfrom
Conversation
Add --projects flag and interactive TUI selector for choosing which projects to export during sync. - Add --projects=a,b flag for non-interactive multi-project export - Add interactive y/n prompt on TTY before launching project selector - Add ScreenProjectSelector TUI screen with j/k navigation, space toggle, enter confirm and q/esc cancel (channel-based result handoff) - Replace single syncExport call with per-project export loop that accumulates results and prints a summary - Preserve full backward compatibility: --all, --project and CWD default behave exactly as before - Warn to stderr when --all overrides --projects - Add table-driven tests for resolveProjects() and unit tests for handleProjectSelectorKeys() state machine (277 tests passing) Closes Gentleman-Programming#107
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
This PR implements Selective Project Sync, allowing users to choose which projects to export instead of relying solely on CWD auto-detection.
Changes
CLI (
cmd/engram/main.go)--projects=a,bflag for non-interactive multi-project export (comma-separated)resolveProjects()helper with strict precedence:--all>--projects>--project> TUI > CWD defaultsyncExport()call with per-project export loop--alloverrides--projects--project,--all, and CWD default behaviorTUI (
internal/tui/)ScreenProjectSelector,NewProjectSelector()constructor, 3 state fields (ProjectSelectorItems,ProjectSelectorChecked,ProjectSelectorCursor)handleProjectSelectorKeys()with j/k navigation, space toggle, enter confirm, q/esc cancel. Uses buffered channel for result handoff.viewProjectSelector()for checkbox list renderingTesting
TestResolveProjects()– table-driven with 8 cases (flag parsing, precedence, TTY fallback, CWD default)TestHandleProjectSelectorKeys*()– 7 test functions covering all navigation and toggle statesUsage Examples
Issue
Closes #107