@@ -13,6 +13,7 @@ import (
1313 "strings"
1414 "time"
1515
16+ "github.com/codeGROOVE-dev/turnclient/pkg/turn"
1617 "github.com/energye/systray" // needed for MenuItem type
1718)
1819
@@ -342,13 +343,12 @@ func (app *App) addPRSection(ctx context.Context, prs []PR, sectionTitle string,
342343 title = fmt .Sprintf ("%s — tests running..." , title )
343344 }
344345
345- // Add "- NEW!" suffix if workflow state is NEWLY_PUBLISHED
346- if sortedPRs [prIndex ].WorkflowState == "NEWLY_PUBLISHED" {
347- title = fmt .Sprintf ("%s - NEW!" , title )
348- }
349-
350346 // Add bullet point or emoji based on PR status
351- if sortedPRs [prIndex ].NeedsReview || sortedPRs [prIndex ].IsBlocked {
347+ switch {
348+ case sortedPRs [prIndex ].WorkflowState == string (turn .StateNewlyPublished ):
349+ // Use gem emoji for newly published PRs
350+ title = fmt .Sprintf ("💎 %s" , title )
351+ case sortedPRs [prIndex ].NeedsReview || sortedPRs [prIndex ].IsBlocked :
352352 // Get the blocked time from state manager
353353 prState , hasState := app .stateManager .PRState (sortedPRs [prIndex ].URL )
354354
@@ -358,16 +358,27 @@ func (app *App) addPRSection(ctx context.Context, prs []PR, sectionTitle string,
358358 time .Since (prState .FirstBlockedAt ) < blockedPRIconDuration &&
359359 ! prState .IsInitialDiscovery {
360360 timeSinceBlocked := time .Since (prState .FirstBlockedAt )
361- // Use party popper for outgoing PRs, goose for incoming PRs
361+ // Use cockroach for fix_tests, party popper for other outgoing PRs, goose for incoming PRs
362362 if sectionTitle == "Outgoing" {
363- title = fmt .Sprintf ("🎉 %s" , title )
364- slog .Info ("[MENU] Adding party popper to outgoing PR" ,
365- "repo" , sortedPRs [prIndex ].Repository ,
366- "number" , sortedPRs [prIndex ].Number ,
367- "url" , sortedPRs [prIndex ].URL ,
368- "firstBlockedAt" , prState .FirstBlockedAt .Format (time .RFC3339 ),
369- "blocked_ago" , timeSinceBlocked .Round (time .Second ),
370- "remaining" , (blockedPRIconDuration - timeSinceBlocked ).Round (time .Second ))
363+ if sortedPRs [prIndex ].ActionKind == "fix_tests" {
364+ title = fmt .Sprintf ("🪳 %s" , title )
365+ slog .Info ("[MENU] Adding cockroach to outgoing PR with broken tests" ,
366+ "repo" , sortedPRs [prIndex ].Repository ,
367+ "number" , sortedPRs [prIndex ].Number ,
368+ "url" , sortedPRs [prIndex ].URL ,
369+ "firstBlockedAt" , prState .FirstBlockedAt .Format (time .RFC3339 ),
370+ "blocked_ago" , timeSinceBlocked .Round (time .Second ),
371+ "remaining" , (blockedPRIconDuration - timeSinceBlocked ).Round (time .Second ))
372+ } else {
373+ title = fmt .Sprintf ("🎉 %s" , title )
374+ slog .Info ("[MENU] Adding party popper to outgoing PR" ,
375+ "repo" , sortedPRs [prIndex ].Repository ,
376+ "number" , sortedPRs [prIndex ].Number ,
377+ "url" , sortedPRs [prIndex ].URL ,
378+ "firstBlockedAt" , prState .FirstBlockedAt .Format (time .RFC3339 ),
379+ "blocked_ago" , timeSinceBlocked .Round (time .Second ),
380+ "remaining" , (blockedPRIconDuration - timeSinceBlocked ).Round (time .Second ))
381+ }
371382 } else {
372383 title = fmt .Sprintf ("🪿 %s" , title )
373384 slog .Debug ("[MENU] Adding goose to incoming PR" ,
@@ -394,9 +405,11 @@ func (app *App) addPRSection(ctx context.Context, prs []PR, sectionTitle string,
394405 }
395406 }
396407 }
397- } else if sortedPRs [prIndex ].ActionKind != "" {
408+ case sortedPRs [prIndex ].ActionKind != "" :
398409 // PR has an action but isn't blocked - add bullet to indicate it could use input
399410 title = fmt .Sprintf ("• %s" , title )
411+ default :
412+ // No special prefix needed
400413 }
401414 // Format age inline for tooltip
402415 duration := time .Since (sortedPRs [prIndex ].UpdatedAt )
@@ -538,28 +551,38 @@ func (app *App) generatePRSectionTitles(prs []PR, sectionTitle string, hiddenOrg
538551 title = fmt .Sprintf ("%s — tests running..." , title )
539552 }
540553
541- // Add "- NEW!" suffix if workflow state is NEWLY_PUBLISHED
542- if sortedPRs [prIndex ].WorkflowState == "NEWLY_PUBLISHED" {
543- title = fmt .Sprintf ("%s - NEW!" , title )
544- }
545-
546554 // Add bullet point or emoji for blocked PRs (same logic as in addPRSection)
547- if sortedPRs [prIndex ].NeedsReview || sortedPRs [prIndex ].IsBlocked {
555+ switch {
556+ case sortedPRs [prIndex ].WorkflowState == string (turn .StateNewlyPublished ):
557+ // Use gem emoji for newly published PRs
558+ title = fmt .Sprintf ("💎 %s" , title )
559+ case sortedPRs [prIndex ].NeedsReview || sortedPRs [prIndex ].IsBlocked :
548560 prState , hasState := app .stateManager .PRState (sortedPRs [prIndex ].URL )
549561
550562 if hasState && ! prState .FirstBlockedAt .IsZero () &&
551563 time .Since (prState .FirstBlockedAt ) < blockedPRIconDuration &&
552564 ! prState .IsInitialDiscovery {
553565 timeSinceBlocked := time .Since (prState .FirstBlockedAt )
554566 if sectionTitle == "Outgoing" {
555- title = fmt .Sprintf ("🎉 %s" , title )
556- slog .Info ("[MENU] Adding party popper to outgoing PR in generateMenuTitles" ,
557- "repo" , sortedPRs [prIndex ].Repository ,
558- "number" , sortedPRs [prIndex ].Number ,
559- "url" , sortedPRs [prIndex ].URL ,
560- "firstBlockedAt" , prState .FirstBlockedAt .Format (time .RFC3339 ),
561- "blocked_ago" , timeSinceBlocked .Round (time .Second ),
562- "remaining" , (blockedPRIconDuration - timeSinceBlocked ).Round (time .Second ))
567+ if sortedPRs [prIndex ].ActionKind == "fix_tests" {
568+ title = fmt .Sprintf ("🪳 %s" , title )
569+ slog .Info ("[MENU] Adding cockroach to outgoing PR with broken tests in generateMenuTitles" ,
570+ "repo" , sortedPRs [prIndex ].Repository ,
571+ "number" , sortedPRs [prIndex ].Number ,
572+ "url" , sortedPRs [prIndex ].URL ,
573+ "firstBlockedAt" , prState .FirstBlockedAt .Format (time .RFC3339 ),
574+ "blocked_ago" , timeSinceBlocked .Round (time .Second ),
575+ "remaining" , (blockedPRIconDuration - timeSinceBlocked ).Round (time .Second ))
576+ } else {
577+ title = fmt .Sprintf ("🎉 %s" , title )
578+ slog .Info ("[MENU] Adding party popper to outgoing PR in generateMenuTitles" ,
579+ "repo" , sortedPRs [prIndex ].Repository ,
580+ "number" , sortedPRs [prIndex ].Number ,
581+ "url" , sortedPRs [prIndex ].URL ,
582+ "firstBlockedAt" , prState .FirstBlockedAt .Format (time .RFC3339 ),
583+ "blocked_ago" , timeSinceBlocked .Round (time .Second ),
584+ "remaining" , (blockedPRIconDuration - timeSinceBlocked ).Round (time .Second ))
585+ }
563586 } else {
564587 title = fmt .Sprintf ("🪿 %s" , title )
565588 slog .Debug ("[MENU] Adding goose to incoming PR in generateMenuTitles" ,
@@ -586,9 +609,11 @@ func (app *App) generatePRSectionTitles(prs []PR, sectionTitle string, hiddenOrg
586609 "number" , sortedPRs [prIndex ].Number )
587610 }
588611 }
589- } else if sortedPRs [prIndex ].ActionKind != "" {
612+ case sortedPRs [prIndex ].ActionKind != "" :
590613 // PR has an action but isn't blocked - add bullet to indicate it could use input
591614 title = fmt .Sprintf ("• %s" , title )
615+ default :
616+ // No special prefix needed
592617 }
593618
594619 titles = append (titles , title )
0 commit comments