Skip to content

Commit cfec8da

Browse files
authored
fix(preprod): Only display path if present (#96798)
Previously we were displaying `null` in the tooltip when a treemap node didn't have the `path` set. This field is optional since we can't always attribute a node exactly to a file, so I've fixed the display handling to account for that. with: <img width="265" height="129" alt="Screenshot 2025-07-30 at 4 30 05 PM" src="https://github.com/user-attachments/assets/ddeee97e-a386-42a9-9353-fc4cbc2c8e73" /> without: <img width="167" height="115" alt="Screenshot 2025-07-30 at 4 30 02 PM" src="https://github.com/user-attachments/assets/6cc9602e-712c-4471-bc33-8d99c4c802d0" />
1 parent d9abf86 commit cfec8da

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

static/app/views/preprod/main/appSizeTreemap.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@ export function AppSizeTreemap(props: AppSizeTreemapProps) {
220220
formatter: function (params: any) {
221221
const value = typeof params.value === 'number' ? params.value : 0;
222222
const percent = ((value / totalSize) * 100).toFixed(2);
223+
const pathElement = params.data?.path
224+
? `<p style="font-size: 12px; margin-bottom: -4px;">${params.data.path}</p>`
225+
: null;
226+
223227
return `
224228
<div style="font-family: Rubik;">
225229
<div style="display: flex; align-items: center; font-size: 12px; font-weight: bold; line-height: 1; margin-bottom: ${space(1)}; gap: ${space(1)}">
@@ -228,11 +232,11 @@ export function AppSizeTreemap(props: AppSizeTreemapProps) {
228232
</div>
229233
<div style="display: flex; flex-direction: column; line-height: 1; gap: ${space(0.5)}">
230234
<p style="font-size: 14px; font-weight: bold; margin-bottom: -2px;">${params.name}</p>
231-
<p style="font-size: 12px; margin-bottom: -4px;">${params.data?.path}</p>
235+
${pathElement || ''}
232236
<p style="font-size: 12px; margin-bottom: -4px;">${formatBytesBase10(value)} (${percent}%)</p>
233237
</div>
234238
</div>
235-
`;
239+
`.trim();
236240
},
237241
};
238242

0 commit comments

Comments
 (0)