Skip to content

Commit 2cbd377

Browse files
authored
Always show usernames in reaction tooltips (#26444)
Even if GetDisplayName() is normally preferred elsewhere, this change provides more consistency, as usernames are also always being shown when participating in a conversation taking place in an issue or a pull request. This change makes conversations easier to follow, as you would not have to have a mental association between someone's username and someone's real name in order to follow what is happening. This behavior matches GitHub's. Optimally, both the username and the full name (if applicable) could be shown, but such an effort is a much bigger task that needs to be thought out well.
1 parent 7a69d71 commit 2cbd377

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

models/issues/reaction.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ func (list ReactionList) GetFirstUsers() string {
377377
if buffer.Len() > 0 {
378378
buffer.WriteString(", ")
379379
}
380-
buffer.WriteString(reaction.User.DisplayName())
380+
buffer.WriteString(reaction.User.Name)
381381
if rem--; rem == 0 {
382382
break
383383
}

models/issues/reaction_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func TestIssueReactionCount(t *testing.T) {
109109
reactions := reactionsList.GroupByType()
110110
assert.Len(t, reactions["heart"], 4)
111111
assert.Equal(t, 2, reactions["heart"].GetMoreUserCount())
112-
assert.Equal(t, user1.DisplayName()+", "+user2.DisplayName(), reactions["heart"].GetFirstUsers())
112+
assert.Equal(t, user1.Name+", "+user2.Name, reactions["heart"].GetFirstUsers())
113113
assert.True(t, reactions["heart"].HasUser(1))
114114
assert.False(t, reactions["heart"].HasUser(5))
115115
assert.False(t, reactions["heart"].HasUser(0))

0 commit comments

Comments
 (0)