Skip to content

Commit 1cec937

Browse files
authored
Merge pull request #42 from codeGROOVE-dev/correct-highlighting
Fix bad logic that left old PRs in the menu list
2 parents c8c963e + 87bf4ab commit 1cec937

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)