Skip to content

Commit ac1bd7c

Browse files
committed
ux: hide tag message if it's the same with its name (#1305)
1 parent 142ee5a commit ac1bd7c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/Commands/QueryTags.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,17 @@ public QueryTags(string repo)
2929
continue;
3030

3131
var name = subs[0].Substring(10);
32+
var message = subs[5].Trim();
33+
if (!string.IsNullOrEmpty(message) && message.Equals(name, StringComparison.Ordinal))
34+
message = null;
35+
3236
tags.Add(new Models.Tag()
3337
{
3438
Name = name,
3539
IsAnnotated = subs[1].Equals("tag", StringComparison.Ordinal),
3640
SHA = string.IsNullOrEmpty(subs[3]) ? subs[2] : subs[3],
3741
CreatorDate = ulong.Parse(subs[4]),
38-
Message = subs[5].Trim(),
42+
Message = message,
3943
});
4044
}
4145

src/Views/TagsView.axaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
</Border>
3939
</StackPanel>
4040

41-
<TextBlock Text="{Binding Message}" IsVisible="{Binding Message, Converter={x:Static c:StringConverters.IsNotNullOrWhitespace}}"/>
41+
<TextBlock Text="{Binding Message}" IsVisible="{Binding Message, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
4242
</StackPanel>
4343
</DataTemplate>
4444
</Border.DataTemplates>
@@ -95,7 +95,7 @@
9595
</Border>
9696
</StackPanel>
9797

98-
<TextBlock Text="{Binding Message}" IsVisible="{Binding Message, Converter={x:Static c:StringConverters.IsNotNullOrWhitespace}}"/>
98+
<TextBlock Text="{Binding Message}" IsVisible="{Binding Message, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
9999
</StackPanel>
100100
</ToolTip.Tip>
101101

0 commit comments

Comments
 (0)