Skip to content

Commit ae1d3c2

Browse files
committed
Fix notify/watch bug
1 parent 81bb9fc commit ae1d3c2

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

main.go

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,13 @@ func displayPR(pr PR, username string) {
742742
}
743743

744744
// Create styled components
745-
bullet := lipgloss.NewStyle().Foreground(lipgloss.Color("#FF79C6")).Render("●")
745+
var bulletColor string
746+
if isBlockingOnUser(pr, username) {
747+
bulletColor = "#FF0000" // Intense red for blocked PRs
748+
} else {
749+
bulletColor = "#FF79C6" // Pink for regular PRs
750+
}
751+
bullet := lipgloss.NewStyle().Foreground(lipgloss.Color(bulletColor)).Render("●")
746752
prIcon := lipgloss.NewStyle().Foreground(lipgloss.Color("#FF79C6")).Render(icon)
747753
title := prTitleStyle.Render(truncate(pr.Title, 60))
748754
ageFormatted := ageStyle.Render(age)
@@ -881,8 +887,10 @@ func truncateURL(url string, maxLen int) string {
881887
}
882888

883889
func runWatchMode(ctx context.Context, token, username string, blockingOnly bool, notifyMode bool, interval time.Duration, logger *log.Logger, httpClient *http.Client, turnClient *turn.Client, debug bool, org string) {
884-
// Clear screen
885-
fmt.Print("\033[H\033[2J")
890+
// Clear screen only if not in notify mode
891+
if !notifyMode {
892+
fmt.Print("\033[H\033[2J")
893+
}
886894

887895
var lastPRs []PR
888896
ticker := time.NewTicker(interval)
@@ -895,10 +903,9 @@ func runWatchMode(ctx context.Context, token, username string, blockingOnly bool
895903
fmt.Fprintf(os.Stderr, "Error fetching PRs: %v\n", err)
896904
}
897905
} else {
898-
lastPRs = prs
899-
900-
// Display PRs unless we're in notify-only mode
906+
// In notify mode, don't set lastPRs initially - start fresh
901907
if !notifyMode {
908+
lastPRs = prs
902909
header := "🔄 Live PR Dashboard - Press 'q' to quit"
903910
fmt.Println(titleStyle.Render(header))
904911
fmt.Println()

0 commit comments

Comments
 (0)