Skip to content

Commit ad2db0d

Browse files
nikkikapadiacleptric
authored andcommitted
fix(dashboards): dashboard card preview misalignment (#114628)
Closes DAIN-1580 fixes the widget previews in a dashboard card on the All Dashboards page. I think the grid layout better utilizes indexes instead of the unique ids and measuring before mount produces the incorrect positions | Before | After | |--------|--------| | <img width="1216" height="714" alt="image" src="https://github.com/user-attachments/assets/d8708c27-d4e0-4cf8-b0b0-4ae149f003e6" />| <img width="1256" height="697" alt="image" src="https://github.com/user-attachments/assets/689ed1f2-0e94-4f1c-ac47-fe346ac82d9e" /> |
1 parent 4d20b6c commit ad2db0d

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

  • static/app/views/dashboards/manage/gridPreview

static/app/views/dashboards/manage/gridPreview/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {useTheme} from '@emotion/react';
55
import styled from '@emotion/styled';
66

77
import {defined} from 'sentry/utils';
8-
import {uniqueId} from 'sentry/utils/guid';
98
import {
109
assignDefaultLayout,
1110
calculateColumnDepths,
@@ -58,12 +57,11 @@ export function GridPreview({widgetPreview}: Props) {
5857
isResizable={false}
5958
isDraggable={false}
6059
useCSSTransforms={false}
61-
measureBeforeMount
6260
>
6361
{renderPreview.map(({displayType, layout}, index) => {
6462
const color = chartPalette[index % chartPalette.length]!;
6563
return (
66-
<Chart key={uniqueId()} data-grid={{...layout}}>
64+
<Chart key={index} data-grid={{...layout}}>
6765
<PreviewWrapper>
6866
<MiniWidget displayType={displayType} color={color} />
6967
</PreviewWrapper>

0 commit comments

Comments
 (0)