diff --git a/ILSpy.Tests/Metadata/MetadataRowDetailsTests.cs b/ILSpy.Tests/Metadata/MetadataRowDetailsTests.cs index 2f0ec9282..061058f4e 100644 --- a/ILSpy.Tests/Metadata/MetadataRowDetailsTests.cs +++ b/ILSpy.Tests/Metadata/MetadataRowDetailsTests.cs @@ -186,6 +186,7 @@ public class MetadataRowDetailsTests editor.IsReadOnly.Should().BeTrue(); editor.WordWrap.Should().BeTrue(); editor.MaxHeight.Should().Be(400, "the host row must stay bounded; the editor scrolls internally"); + editor.MinHeight.Should().Be(100, "a short payload must still get a recognisable details area, not a squeezed strip"); editor.SyntaxHighlighting.Should().NotBeNull(); editor.SyntaxHighlighting!.Name.Should().Be("C#"); diff --git a/ILSpy/Metadata/MetadataRowDetails.cs b/ILSpy/Metadata/MetadataRowDetails.cs index a0bc9607a..a9c584e0d 100644 --- a/ILSpy/Metadata/MetadataRowDetails.cs +++ b/ILSpy/Metadata/MetadataRowDetails.cs @@ -121,8 +121,10 @@ namespace ICSharpCode.ILSpy.Metadata /// in the decompiler-view-styled AvaloniaEdit editor: text payloads are mostly code, /// so they get syntax colours (selected by , /// e.g. ".cs" or ".json"; stays plain) and line virtualization - /// keeps large embedded-source documents cheap. Height is bounded so the host row - /// cannot grow unbounded; the editor scrolls internally. + /// keeps large embedded-source documents cheap. Height is bounded in both directions: + /// capped so the host row cannot grow unbounded (the editor scrolls internally), and + /// floored so a short payload still reads as a details area rather than a squeezed + /// one-line strip. /// public static Control BuildTextBlob(string text, string? highlightExtension = null) { @@ -131,6 +133,7 @@ namespace ICSharpCode.ILSpy.Metadata Text = text, IsReadOnly = true, WordWrap = true, + MinHeight = 100, MaxHeight = 400, }; if (highlightExtension != null)