Skip to content

Commit fa58a70

Browse files
committed
fix: hide primary view section if it only aggregates other views (via
view sections)
1 parent 555593f commit fa58a70

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

src/pages/views/components/SingleView.tsx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,13 @@ const SingleView: React.FC<SingleViewProps> = ({ id }) => {
165165
}
166166
};
167167

168+
// Check if this view only aggregates other views (has sections but no content of its own)
169+
const isAggregatorView =
170+
viewResult.sections &&
171+
viewResult.sections.length > 0 &&
172+
!viewResult.panels &&
173+
!viewResult.columns;
174+
168175
return (
169176
<ViewLayout
170177
title={title || name}
@@ -196,13 +203,16 @@ const SingleView: React.FC<SingleViewProps> = ({ id }) => {
196203
<hr className="my-4 border-gray-200" />
197204
)}
198205

199-
<div className="mt-2">
200-
<ViewSection
201-
key={`${namespace || "default"}:${name}`}
202-
section={primaryViewSection}
203-
hideVariables
204-
/>
205-
</div>
206+
{/* Only show the primary ViewSection if this view has its own content */}
207+
{!isAggregatorView && (
208+
<div className="mt-2">
209+
<ViewSection
210+
key={`${namespace || "default"}:${name}`}
211+
section={primaryViewSection}
212+
hideVariables
213+
/>
214+
</div>
215+
)}
206216

207217
{viewResult?.sections && viewResult.sections.length > 0 && (
208218
<>

0 commit comments

Comments
 (0)