From 2f9d0754dc1dc089e45665055576b8b3fc734822 Mon Sep 17 00:00:00 2001 From: Thomas Stromberg Date: Sun, 9 Nov 2025 15:36:31 -0500 Subject: [PATCH] Change assignment formatting --- pkg/notify/format_test.go | 16 ++++++++-------- pkg/notify/notify.go | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pkg/notify/format_test.go b/pkg/notify/format_test.go index 97b5e51..bfa3fbc 100644 --- a/pkg/notify/format_test.go +++ b/pkg/notify/format_test.go @@ -293,7 +293,7 @@ func TestFormatNextActionsInternal(t *testing.T) { nextActions: map[string]turn.Action{ "user1": {Kind: turn.ActionReview}, }, - expected: "review: @user1", + expected: "*review* → @user1", }, { name: "multiple users same action", @@ -301,7 +301,7 @@ func TestFormatNextActionsInternal(t *testing.T) { "user1": {Kind: turn.ActionReview}, "user2": {Kind: turn.ActionReview}, }, - expected: "review: @user1, @user2", + expected: "*review* → @user1, @user2", }, { name: "system user filtered out", @@ -316,7 +316,7 @@ func TestFormatNextActionsInternal(t *testing.T) { "_system": {Kind: turn.ActionReview}, "user1": {Kind: turn.ActionReview}, }, - expected: "review: @user1", + expected: "*review* → @user1", }, } @@ -650,7 +650,7 @@ func TestFormatNextActionsSuffixWithActions(t *testing.T) { Domain: "example.com", UserMapper: mapper, }, - expected: " → review: @user1", + expected: " • *review* → @user1", }, { name: "suffix with multiple users", @@ -667,7 +667,7 @@ func TestFormatNextActionsSuffixWithActions(t *testing.T) { Domain: "example.com", UserMapper: mapper, }, - expected: " → review: ", + expected: " • *review* → ", }, { name: "suffix filters system user", @@ -683,7 +683,7 @@ func TestFormatNextActionsSuffixWithActions(t *testing.T) { Domain: "example.com", UserMapper: mapper, }, - expected: " → review", + expected: " • review", }, } @@ -693,8 +693,8 @@ func TestFormatNextActionsSuffixWithActions(t *testing.T) { // For tests with multiple users, just check that result starts with the prefix // since map iteration order is not guaranteed if tt.name == "suffix with multiple users" { - if !contains(result, " → review: ") { - t.Errorf("expected result to contain \" → review: \", got: %q", result) + if !contains(result, " • *review* → ") { + t.Errorf("expected result to contain \" • *review* → \", got: %q", result) } } else if result != tt.expected { t.Errorf("expected %q, got %q", tt.expected, result) diff --git a/pkg/notify/notify.go b/pkg/notify/notify.go index 8a1a48d..8decbf8 100644 --- a/pkg/notify/notify.go +++ b/pkg/notify/notify.go @@ -126,7 +126,7 @@ func FormatNextActionsSuffix(ctx context.Context, params MessageParams) string { actions := formatNextActionsInternal(ctx, params.CheckResult.Analysis.NextAction, params.Owner, params.Domain, params.UserMapper) if actions != "" { - return fmt.Sprintf(" → %s", actions) + return fmt.Sprintf(" • %s", actions) } return "" } @@ -272,10 +272,10 @@ func formatNextActionsInternal(ctx context.Context, nextActions map[string]turn. // Format user mentions (will be empty if only _system was assigned) userMentions := userMapper.FormatUserMentions(ctx, users, owner, domain) - // If action has users, format as "action: users" - // If no users (was only _system), just show the action + // If action has users, format as "*action* → users" (bold action when assigned to person) + // If no users (was only _system), just show the action without bold if userMentions != "" { - parts = append(parts, fmt.Sprintf("%s: %s", actionName, userMentions)) + parts = append(parts, fmt.Sprintf("*%s* → %s", actionName, userMentions)) } else { parts = append(parts, actionName) }