From d7cba2fe3a0cd2e3dd22236113d90a449b9b79a9 Mon Sep 17 00:00:00 2001 From: Max Topolsky Date: Fri, 3 Oct 2025 14:22:21 -0700 Subject: [PATCH 1/3] working full size treemap --- .../components/modals/insightChartModal.tsx | 4 +- .../visualizations/appSizeTreemap.tsx | 71 ++++++++++++++----- 2 files changed, 55 insertions(+), 20 deletions(-) diff --git a/static/app/components/modals/insightChartModal.tsx b/static/app/components/modals/insightChartModal.tsx index d0e0114709a9c3..4d27848ddb10d4 100644 --- a/static/app/components/modals/insightChartModal.tsx +++ b/static/app/components/modals/insightChartModal.tsx @@ -11,6 +11,7 @@ export type InsightChartModalOptions = { children: React.ReactNode; title: React.ReactNode; footer?: React.ReactNode; + height?: number; }; type Props = ModalRenderProps & InsightChartModalOptions; @@ -20,6 +21,7 @@ export default function InsightChartModal({ children, Footer, footer, + height = 300, }: Props) { return ( @@ -28,7 +30,7 @@ export default function InsightChartModal({

{title}

- + {children} diff --git a/static/app/views/preprod/components/visualizations/appSizeTreemap.tsx b/static/app/views/preprod/components/visualizations/appSizeTreemap.tsx index fe95d621456089..139637cccece4d 100644 --- a/static/app/views/preprod/components/visualizations/appSizeTreemap.tsx +++ b/static/app/views/preprod/components/visualizations/appSizeTreemap.tsx @@ -1,10 +1,17 @@ +import {useContext} from 'react'; import {useTheme} from '@emotion/react'; import styled from '@emotion/styled'; import type {TreemapSeriesOption, VisualMapComponentOption} from 'echarts'; +import {openInsightChartModal} from 'sentry/actionCreators/modal'; import BaseChart, {type TooltipOption} from 'sentry/components/charts/baseChart'; +import {Button} from 'sentry/components/core/button'; +import {Container, Flex} from 'sentry/components/core/layout'; import {Heading} from 'sentry/components/core/text'; +import {IconExpand} from 'sentry/icons'; +import {t} from 'sentry/locale'; import {formatBytesBase10} from 'sentry/utils/bytes/formatBytesBase10'; +import {ChartRenderingContext} from 'sentry/views/insights/common/components/chart'; import {getAppSizeCategoryInfo} from 'sentry/views/preprod/components/visualizations/appSizeTheme'; import {TreemapType, type TreemapElement} from 'sentry/views/preprod/types/appSizeTypes'; @@ -15,8 +22,11 @@ interface AppSizeTreemapProps { export function AppSizeTreemap(props: AppSizeTreemapProps) { const theme = useTheme(); - const {root} = props; + const {root, searchQuery} = props; const appSizeCategoryInfo = getAppSizeCategoryInfo(theme); + const renderingContext = useContext(ChartRenderingContext); + const isFullscreen = renderingContext?.isFullscreen ?? false; + const contextHeight = renderingContext?.height; function convertToEChartsData(element: TreemapElement): any { const categoryInfo = @@ -82,7 +92,7 @@ export function AppSizeTreemap(props: AppSizeTreemapProps) { // Empty state if (root === null) { return ( - + No files match your search:{' '} - + ); } @@ -109,8 +119,8 @@ export function AppSizeTreemap(props: AppSizeTreemapProps) { type: 'treemap', animationEasing: 'quarticOut', animationDuration: 300, - height: `calc(100% - 22px)`, - width: `100%`, + height: isFullscreen ? '100%' : `calc(100% - 22px)`, + width: '100%', top: '22px', breadcrumb: { show: true, @@ -224,21 +234,44 @@ export function AppSizeTreemap(props: AppSizeTreemapProps) { }; return ( - + + + {!isFullscreen && ( + + + + )} + + + + + + + ); } export function AppSizeTreemap(props: AppSizeTreemapProps) { const theme = useTheme(); - const {root, searchQuery} = props; + const {root, searchQuery, unfilteredRoot, onSearchChange} = props; const appSizeCategoryInfo = getAppSizeCategoryInfo(theme); const renderingContext = useContext(ChartRenderingContext); const isFullscreen = renderingContext?.isFullscreen ?? false; @@ -256,7 +310,13 @@ export function AppSizeTreemap(props: AppSizeTreemapProps) { openInsightChartModal({ title: t('Size Analysis'), height: 600, - children: ( + children: unfilteredRoot ? ( + + ) : ( From b2812dc38d9a6924e5716af1123e4729b960a0a0 Mon Sep 17 00:00:00 2001 From: Max Topolsky Date: Fri, 3 Oct 2025 14:54:56 -0700 Subject: [PATCH 3/3] change height --- .../views/preprod/components/visualizations/appSizeTreemap.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/app/views/preprod/components/visualizations/appSizeTreemap.tsx b/static/app/views/preprod/components/visualizations/appSizeTreemap.tsx index add1975612080d..a6c21d7d239039 100644 --- a/static/app/views/preprod/components/visualizations/appSizeTreemap.tsx +++ b/static/app/views/preprod/components/visualizations/appSizeTreemap.tsx @@ -309,7 +309,7 @@ export function AppSizeTreemap(props: AppSizeTreemapProps) { onClick={() => { openInsightChartModal({ title: t('Size Analysis'), - height: 600, + height: 500, children: unfilteredRoot ? (