@@ -205,15 +205,16 @@ func TestMenuItemTitleTransition(t *testing.T) {
205205 _ = ctx // Unused in this test but would be used for real menu operations
206206}
207207
208- // TestWorkflowStateNewlyPublished tests that PRs with NEWLY_PUBLISHED workflow state get a 💎 bullet.
208+ // TestWorkflowStateNewlyPublished tests that PRs with NEWLY_PUBLISHED workflow state get a 💎 bullet
209+ // only when updated within the last minute and not blocked/needing review.
209210func TestWorkflowStateNewlyPublished (t * testing.T ) {
210211 tests := []struct {
211212 name string
212213 pr PR
213214 expectedTitle string
214215 }{
215216 {
216- name : "newly_published_with_action " ,
217+ name : "newly_published_needs_review_gets_block_not_diamond " ,
217218 pr : PR {
218219 Repository : "test/repo" ,
219220 Number : 123 ,
@@ -222,10 +223,10 @@ func TestWorkflowStateNewlyPublished(t *testing.T) {
222223 NeedsReview : true ,
223224 UpdatedAt : time .Now (),
224225 },
225- expectedTitle : "💎 test/repo #123 — review" ,
226+ expectedTitle : "■ test/repo #123 — review" ,
226227 },
227228 {
228- name : "newly_published_without_action " ,
229+ name : "newly_published_recent_gets_diamond " ,
229230 pr : PR {
230231 Repository : "test/repo" ,
231232 Number : 456 ,
@@ -235,7 +236,17 @@ func TestWorkflowStateNewlyPublished(t *testing.T) {
235236 expectedTitle : "💎 test/repo #456" ,
236237 },
237238 {
238- name : "newly_published_with_running_tests" ,
239+ name : "newly_published_stale_no_prefix" ,
240+ pr : PR {
241+ Repository : "test/repo" ,
242+ Number : 457 ,
243+ WorkflowState : string (turn .StateNewlyPublished ),
244+ UpdatedAt : time .Now ().Add (- 2 * time .Minute ),
245+ },
246+ expectedTitle : "test/repo #457" ,
247+ },
248+ {
249+ name : "newly_published_with_running_tests_gets_diamond" ,
239250 pr : PR {
240251 Repository : "test/repo" ,
241252 Number : 789 ,
@@ -245,6 +256,17 @@ func TestWorkflowStateNewlyPublished(t *testing.T) {
245256 },
246257 expectedTitle : "💎 test/repo #789 — tests running..." ,
247258 },
259+ {
260+ name : "newly_published_with_action_gets_bullet_not_diamond" ,
261+ pr : PR {
262+ Repository : "test/repo" ,
263+ Number : 790 ,
264+ ActionKind : "review" ,
265+ WorkflowState : string (turn .StateNewlyPublished ),
266+ UpdatedAt : time .Now (),
267+ },
268+ expectedTitle : "• test/repo #790 — review" ,
269+ },
248270 {
249271 name : "not_newly_published_with_action" ,
250272 pr : PR {
@@ -273,12 +295,15 @@ func TestWorkflowStateNewlyPublished(t *testing.T) {
273295 title = fmt .Sprintf ("%s — tests running..." , title )
274296 }
275297
276- // Add prefix based on workflow state or blocked status
298+ // Add prefix based on blocked status, action, or newly published
299+ // (mirrors priority order in ui.go - diamond is lowest priority)
277300 switch {
278- case pr .WorkflowState == string (turn .StateNewlyPublished ):
279- title = fmt .Sprintf ("💎 %s" , title )
280301 case pr .NeedsReview || pr .IsBlocked :
281302 title = fmt .Sprintf ("■ %s" , title )
303+ case pr .ActionKind != "" :
304+ title = fmt .Sprintf ("• %s" , title )
305+ case pr .WorkflowState == string (turn .StateNewlyPublished ) && time .Since (pr .UpdatedAt ) < time .Minute :
306+ title = fmt .Sprintf ("💎 %s" , title )
282307 }
283308
284309 return title
0 commit comments