Skip to content

Commit 9e7abaa

Browse files
BornToBeRootclaude
andcommitted
Feature: Align RDAP result layout with other tools
- Detail rows use CenterTextBlock labels and a 10px gap without extra row margins, like IP Geolocation and Network Interface. - Section labels (Events, Nameservers, ...) use the gray group label style instead of an enlarged header. - No duplicate "Result" title; Registry/Registrar titles are only shown if the referral was followed. - Notice texts are shown in normal weight (only values are bold). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 421c516 commit 9e7abaa

3 files changed

Lines changed: 14 additions & 9 deletions

File tree

‎Source/NETworkManager/ViewModels/RDAPObjectViewModel.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ public string ToText()
207207
{
208208
var text = new StringBuilder();
209209

210-
text.AppendLine($"# {Title}");
211-
text.AppendLine();
210+
if (!string.IsNullOrEmpty(Title))
211+
text.AppendLine($"# {Title}").AppendLine();
212212

213213
foreach (var detail in Details)
214214
text.AppendLine($"{detail.Name}: {detail.Value}");

‎Source/NETworkManager/ViewModels/RDAPViewModel.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ private async Task RunQuery()
310310

311311
List<RDAPObjectViewModel> results =
312312
[
313-
new(_result, _result.Referral == null ? Strings.Result : Strings.Registry)
313+
// The "Result" header is already shown. Titles are only needed to tell registry and registrar apart.
314+
new(_result, _result.Referral == null ? null : Strings.Registry)
314315
];
315316

316317
if (_result.Referral != null)

‎Source/NETworkManager/Views/RDAPView.xaml‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@
3131
</MenuItem.Icon>
3232
</MenuItem>
3333
</ContextMenu>
34-
<Style x:Key="RDAPSectionTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource HeaderTextBlock}">
35-
<Setter Property="FontSize" Value="16" />
34+
<converters:StringIsNotNullOrEmptyToVisibilityCollapsedConverter
35+
x:Key="StringIsNotNullOrEmptyToVisibilityCollapsedConverter" />
36+
<Style x:Key="RDAPSectionTextBlock" TargetType="{x:Type TextBlock}" BasedOn="{StaticResource DefaultTextBlock}">
37+
<Setter Property="Foreground" Value="{DynamicResource MahApps.Brushes.Gray3}" />
3638
<Setter Property="Margin" Value="0,20,0,10" />
3739
</Style>
3840
<Style x:Key="RDAPDataGrid" TargetType="{x:Type DataGrid}" BasedOn="{StaticResource DefaultDataGrid}">
@@ -46,19 +48,20 @@
4648
</Style>
4749
<DataTemplate x:Key="RDAPObjectTemplate" DataType="{x:Type viewModels:RDAPObjectViewModel}">
4850
<StackPanel Margin="0,0,0,20">
49-
<TextBlock Text="{Binding Title}" Style="{StaticResource HeaderTextBlock}" />
51+
<TextBlock Text="{Binding Title}" Style="{StaticResource HeaderTextBlock}"
52+
Visibility="{Binding Title, Converter={StaticResource StringIsNotNullOrEmptyToVisibilityCollapsedConverter}}" />
5053
<!-- Details -->
5154
<ItemsControl ItemsSource="{Binding Details}" Grid.IsSharedSizeScope="True">
5255
<ItemsControl.ItemTemplate>
5356
<DataTemplate DataType="{x:Type viewModels:RDAPDetailItem}">
54-
<Grid Margin="0,0,0,5">
57+
<Grid>
5558
<Grid.ColumnDefinitions>
5659
<ColumnDefinition Width="Auto" SharedSizeGroup="RDAPDetailName" />
57-
<ColumnDefinition Width="20" />
60+
<ColumnDefinition Width="10" />
5861
<ColumnDefinition Width="*" />
5962
</Grid.ColumnDefinitions>
6063
<TextBlock Grid.Column="0" Text="{Binding Name}"
61-
Style="{StaticResource DefaultTextBlock}" VerticalAlignment="Top" />
64+
Style="{StaticResource CenterTextBlock}" />
6265
<TextBox Grid.Column="2" Text="{Binding Value, Mode=OneWay}"
6366
Style="{StaticResource TextBlockAsTextBox}" TextWrapping="Wrap"
6467
ContextMenu="{StaticResource CopyContextMenu}" />
@@ -150,6 +153,7 @@
150153
TextWrapping="Wrap" />
151154
<TextBox Text="{Binding Description, Mode=OneWay}"
152155
Style="{StaticResource TextBlockAsTextBox}" TextWrapping="Wrap"
156+
FontWeight="Normal"
153157
ContextMenu="{StaticResource CopyContextMenu}" />
154158
<ItemsControl ItemsSource="{Binding Links}">
155159
<ItemsControl.ItemTemplate>

0 commit comments

Comments
 (0)