diff --git a/src/Apps/NetPad.Apps.App/App/src/windows/main/panes/output-pane/output-pane.scss b/src/Apps/NetPad.Apps.App/App/src/windows/main/panes/output-pane/output-pane.scss index bdbea69a..ca109a50 100644 --- a/src/Apps/NetPad.Apps.App/App/src/windows/main/panes/output-pane/output-pane.scss +++ b/src/Apps/NetPad.Apps.App/App/src/windows/main/panes/output-pane/output-pane.scss @@ -53,7 +53,10 @@ output-pane { } .empty-collection { - @extend %null; + color: white; + background-color: $table-info-header-bg-color; + padding: 0.25rem 0.2rem; + display: inline-block; } .group { @@ -112,14 +115,6 @@ output-pane { } } - td { - img, - audio, - video { - margin: 5px 0; - } - } - &.titled { border-left: 2px orange solid; margin-top: 0.5rem; @@ -160,6 +155,7 @@ output-pane { } th { + font-weight: 600; line-height: 1; padding: 3px 5px; color: white; @@ -189,14 +185,8 @@ output-pane { top: -4px; // An extra -1 to account for border of info header } - td { - line-height: $font-size + 5; - padding: 0 5px; - - > table { - margin-top: 4px !important; - margin-bottom: 4px !important; - } + td > table { + margin: 3px !important; } tbody td { @@ -208,7 +198,7 @@ output-pane { } .property-name { - font-weight: bold; + font-weight: 600; } .collapse-actionable { diff --git a/src/External/O2Html/Converters/CollectionHtmlConverter.cs b/src/External/O2Html/Converters/CollectionHtmlConverter.cs index df3ed790..84fd79a6 100644 --- a/src/External/O2Html/Converters/CollectionHtmlConverter.cs +++ b/src/External/O2Html/Converters/CollectionHtmlConverter.cs @@ -21,7 +21,14 @@ public override Node WriteHtml( SerializationScope serializationScope, HtmlSerializer htmlSerializer) { - return Convert(obj, type, serializationScope, htmlSerializer).node; + var result = Convert(obj, type, serializationScope, htmlSerializer); + + if (result.collectionLength == 0 && serializationScope.Depth > 0 && htmlSerializer.SerializerOptions.DoNotSerializeNonRootEmptyCollections) + { + return new EmptyCollection(type).AddClass(htmlSerializer.SerializerOptions.CssClasses.EmptyCollection); + } + + return result.node; } public override void WriteHtmlWithinTableRow( @@ -41,7 +48,7 @@ public override void WriteHtmlWithinTableRow( var result = Convert(obj, type, serializationScope, htmlSerializer); - if (result.collectionLength == 0 && htmlSerializer.SerializerOptions.DoNotSerializeNonRootEmptyCollections) + if (result.collectionLength == 0 && serializationScope.Depth > 0 && htmlSerializer.SerializerOptions.DoNotSerializeNonRootEmptyCollections) { td.AddChild(new EmptyCollection(type).AddClass(htmlSerializer.SerializerOptions.CssClasses.EmptyCollection)); } @@ -138,7 +145,7 @@ protected string GetHeaderRowText( { keyValueStr = keyValue.ToString(); } - else if( typeCategory == TypeCategory.Collection) + else if (typeCategory == TypeCategory.Collection) { keyValueStr = keyValue.GetType().GetReadableName(); } @@ -167,7 +174,6 @@ protected string GetHeaderRowText( keyValueStr += "}"; } - } keyValueStr = keyValueStr == null diff --git a/src/External/O2Html/Dom/Elements/EmptyCollection.cs b/src/External/O2Html/Dom/Elements/EmptyCollection.cs index b72e3510..12eeba6c 100644 --- a/src/External/O2Html/Dom/Elements/EmptyCollection.cs +++ b/src/External/O2Html/Dom/Elements/EmptyCollection.cs @@ -11,6 +11,6 @@ public EmptyCollection() : base("span") public EmptyCollection(Type collectionType) : base("span") { - this.AddEscapedText($"0 items ({collectionType.GetReadableName()})"); + this.AddEscapedText("(0 items)"); } }