Skip to content

Commit 87bf4ab

Browse files
committed
Fix bad highlighting logic
1 parent 2bb58e0 commit 87bf4ab

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

cmd/goose/main.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -728,9 +728,21 @@ func (app *App) checkForNewlyBlockedPRs(ctx context.Context) {
728728
app.mu.Unlock()
729729

730730
// Update UI after releasing the lock
731-
// Only update if there are newly blocked PRs
732-
if menuInitialized && len(currentBlocked) > len(previousBlocked) {
733-
log.Print("[BLOCKED] Updating UI for newly blocked PRs")
731+
// Check if the set of blocked PRs has changed
732+
blockedPRsChanged := !reflect.DeepEqual(currentBlocked, previousBlocked)
733+
734+
// Update UI if blocked PRs changed or if we cleaned up stale entries
735+
if menuInitialized && (blockedPRsChanged || removedCount > 0) {
736+
switch {
737+
case len(currentBlocked) > len(previousBlocked):
738+
log.Print("[BLOCKED] Updating UI for newly blocked PRs")
739+
case len(currentBlocked) < len(previousBlocked):
740+
log.Print("[BLOCKED] Updating UI - blocked PRs were removed")
741+
case blockedPRsChanged:
742+
log.Print("[BLOCKED] Updating UI - blocked PRs changed (same count)")
743+
default:
744+
log.Printf("[BLOCKED] Updating UI after cleaning up %d stale entries", removedCount)
745+
}
734746
app.setTrayTitle()
735747
app.updateMenu(ctx)
736748
}

0 commit comments

Comments
 (0)