Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,15 +284,15 @@ func printTree(gitClient git.GitClient, node *stack.TreeNode, prefix string, isL
printTreeVertical(gitClient, node, currentBranch, prCache, false)
}

func printTreeVertical(gitClient git.GitClient, node *stack.TreeNode, currentBranch string, prCache map[string]*github.PRInfo, isPipe bool) {
func printTreeVertical(gitClient git.GitClient, node *stack.TreeNode, currentBranch string, prCache map[string]*github.PRInfo, isChild bool) {
if node == nil {
return
}

// Determine the current branch marker
marker := ""
// Determine the node marker (filled for current branch, hollow for others)
nodeMarker := ui.TreeNode()
if node.Name == currentBranch {
marker = ui.CurrentBranchMarker()
nodeMarker = ui.TreeNodeCurrent()
}

// Get PR info from cache
Expand All @@ -303,13 +303,13 @@ func printTreeVertical(gitClient git.GitClient, node *stack.TreeNode, currentBra
}
}

// Print pipe if needed
if isPipe {
fmt.Printf(" %s\n", ui.Pipe())
// Print connecting line if this is a child node
if isChild {
fmt.Printf("%s\n", ui.TreeLine())
}

// Print current node
fmt.Printf(" %s%s%s\n", ui.Branch(node.Name), prInfo, marker)
fmt.Printf("%s %s%s\n", nodeMarker, ui.Branch(node.Name), prInfo)

// Print children vertically
for _, child := range node.Children {
Expand Down
18 changes: 8 additions & 10 deletions cmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,6 @@ func runSync(gitClient git.GitClient, githubClient github.GitHubClient) error {
// Get all remote branches in one call (more efficient than checking each branch individually)
remoteBranches := gitClient.GetRemoteBranchesSet()

fmt.Printf("Processing %d branch(es)...\n\n", len(sorted))

// Build a set of stack branch names for quick lookup
stackBranchSet := make(map[string]bool)
for _, sb := range stackBranches {
Expand Down Expand Up @@ -965,15 +963,15 @@ func printTreeForSync(gitClient git.GitClient, node *stack.TreeNode, currentBran
printTreeVerticalForSync(gitClient, node, currentBranch, prCache, false)
}

func printTreeVerticalForSync(gitClient git.GitClient, node *stack.TreeNode, currentBranch string, prCache map[string]*github.PRInfo, isPipe bool) {
func printTreeVerticalForSync(gitClient git.GitClient, node *stack.TreeNode, currentBranch string, prCache map[string]*github.PRInfo, isChild bool) {
if node == nil {
return
}

// Determine the current branch marker
marker := ""
// Determine the node marker (filled for current branch, hollow for others)
nodeMarker := ui.TreeNode()
if node.Name == currentBranch {
marker = ui.CurrentBranchMarker()
nodeMarker = ui.TreeNodeCurrent()
}

// Get PR info from cache
Expand All @@ -984,13 +982,13 @@ func printTreeVerticalForSync(gitClient git.GitClient, node *stack.TreeNode, cur
}
}

// Print pipe if needed
if isPipe {
fmt.Printf(" %s\n", ui.Pipe())
// Print connecting line if this is a child node
if isChild {
fmt.Printf("%s\n", ui.TreeLine())
}

// Print current node
fmt.Printf(" %s%s%s\n", ui.Branch(node.Name), prInfo, marker)
fmt.Printf("%s %s%s\n", nodeMarker, ui.Branch(node.Name), prInfo)

// Print children vertically
for _, child := range node.Children {
Expand Down
15 changes: 15 additions & 0 deletions internal/ui/color.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,21 @@ func Pipe() string {
return dim.Sprint("|")
}

// TreeNodeCurrent returns the filled circle for current branch (bold green)
func TreeNodeCurrent() string {
return boldGreen.Sprint("●")
}

// TreeNode returns the hollow circle for non-current branches (dim)
func TreeNode() string {
return dim.Sprint("○")
}

// TreeLine returns the vertical line for connecting branches (dim)
func TreeLine() string {
return dim.Sprint("│")
}

// SuccessIcon returns just the green checkmark
func SuccessIcon() string {
return green.Sprint("✓")
Expand Down