From 13d82e750a1554f34f71591ee357004e0d11f44c Mon Sep 17 00:00:00 2001 From: Andrea De Pirro Date: Fri, 16 Oct 2026 16:23:27 +0200 Subject: [PATCH] Leave a primitive variant's panel empty behind a union chip A primitive's chip already names its type, so its panel repeated `string` or `number` under the picked chip. The panel now shows only the description, if any. Co-Authored-By: Claude Sonnet 5.5 --- .../PropertyTree/_Partials/_UnionOptions.cshtml | 6 +++--- .../UnionOptionsRenderingTests.cs | 12 ++++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Elastic.ApiExplorer/Components/PropertyTree/_Partials/_UnionOptions.cshtml b/src/Elastic.ApiExplorer/Components/PropertyTree/_Partials/_UnionOptions.cshtml index 3e11acadab..93f4afac64 100644 --- a/src/Elastic.ApiExplorer/Components/PropertyTree/_Partials/_UnionOptions.cshtml +++ b/src/Elastic.ApiExplorer/Components/PropertyTree/_Partials/_UnionOptions.cshtml @@ -70,9 +70,9 @@ var collapsible = variant.IsCollapsible; var expanded = Model.UseChips || variant.DefaultExpanded; var folded = variant.UseHidden && !Model.UseChips; - // An array variant keeps its "X[]" heading, so its fields read as each item's; a primitive keeps its type, which is - // all its panel has to show. - var showName = !Model.UseChips || variant.PageUrl is { Length: > 0 } || variant.IsArrayVariant || !variant.IsObjectType; + // An array variant keeps its "X[]" heading, so its fields read as each item's. A primitive's chip already says its + // type, so its panel shows nothing more than the description, if any. + var showName = !Model.UseChips || variant.PageUrl is { Length: > 0 } || variant.IsArrayVariant; var showLabel = showName || variant.DiscriminatorLabel is { Length: > 0 };