Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

fix(dashboard): stop panel type drawers flashing on open and close (#13114)

Abhi kumar1371cb0bebd8
diff --git a/frontend/src/pages/DashboardPage/DashboardContainer/PanelEditor/ConfigPane/PanelTypeSwitcher/PanelTypeSwitcher.tsx b/frontend/src/pages/DashboardPage/DashboardContainer/PanelEditor/ConfigPane/PanelTypeSwitcher/PanelTypeSwitcher.tsx
index bf5f34ffe8..5e3c94ab05 100644
--- a/frontend/src/pages/DashboardPage/DashboardContainer/PanelEditor/ConfigPane/PanelTypeSwitcher/PanelTypeSwitcher.tsx
+++ b/frontend/src/pages/DashboardPage/DashboardContainer/PanelEditor/ConfigPane/PanelTypeSwitcher/PanelTypeSwitcher.tsx
@@ -8,6 +8,7 @@ import type { EQueryType } from 'types/common/dashboard';
import PanelTypeBrowser from '../../../PanelsAndSectionsLayout/Panel/PanelTypeSelectionModal/PanelTypeBrowser';
import { getPanelDefinition } from '../../../Panels/registry';
import type { PanelKind } from '../../../Panels/types/panelKind';
+import { JS_DRIVEN_SLIDE } from '../../../utils/drawerSlide';
import ConfigField from '../controls/ConfigField/ConfigField';
import styles from './PanelTypeSwitcher.module.scss';
@@ -102,6 +103,7 @@ function PanelTypeSwitcher({
direction="right"
width="wide"
testId="panel-type-switcher-drawer"
+ drawerContentProps={JS_DRIVEN_SLIDE}
drawerDescriptionProps={{ className: styles.drawerBody }}
>
<PanelTypeBrowser
diff --git a/frontend/src/pages/DashboardPage/DashboardContainer/PanelsAndSectionsLayout/Panel/PanelTypeSelectionModal/PanelTypeSelectionModal.tsx b/frontend/src/pages/DashboardPage/DashboardContainer/PanelsAndSectionsLayout/Panel/PanelTypeSelectionModal/PanelTypeSelectionModal.tsx
index 999b6c518b..31fa3038ef 100644
--- a/frontend/src/pages/DashboardPage/DashboardContainer/PanelsAndSectionsLayout/Panel/PanelTypeSelectionModal/PanelTypeSelectionModal.tsx
+++ b/frontend/src/pages/DashboardPage/DashboardContainer/PanelsAndSectionsLayout/Panel/PanelTypeSelectionModal/PanelTypeSelectionModal.tsx
@@ -6,6 +6,7 @@ import { useDashboardSections } from '../../../hooks/useDashboardSections';
import { releasePanelPickerTarget } from '../../../store/usePanelPickerTargetStore';
import type { NewPanelTarget } from '../../../patchOps';
import type { PanelKind } from '../../../Panels/types/panelKind';
+import { JS_DRIVEN_SLIDE } from '../../../utils/drawerSlide';
import AddPanelSplitButton from './AddPanelSplitButton';
import NewSectionNameInput from './NewSectionNameInput';
import PanelTypeBrowser from './PanelTypeBrowser';
@@ -106,6 +107,7 @@ function PanelTypeSelectionModal({
direction="right"
width="wide"
testId="panel-type-drawer"
+ drawerContentProps={JS_DRIVEN_SLIDE}
drawerDescriptionProps={{ className: styles.body }}
footer={
<div className={styles.footer}>
diff --git a/frontend/src/pages/DashboardPage/DashboardContainer/utils/drawerSlide.ts b/frontend/src/pages/DashboardPage/DashboardContainer/utils/drawerSlide.ts
new file mode 100644
index 0000000000..3b342bb936
--- /dev/null
+++ b/frontend/src/pages/DashboardPage/DashboardContainer/utils/drawerSlide.ts
@@ -0,0 +1,10 @@
+import type { DrawerWrapperProps } from '@signozhq/ui/drawer';
+import { noop } from 'lodash-es';
+
+/**
+ * `DrawerWrapper`'s motion@11 runs its slide on WAAPI and paints one stale frame
+ * when it finishes; an `onUpdate` (untyped, forwarded to motion) keeps it JS-driven.
+ */
+export const JS_DRIVEN_SLIDE = {
+ onUpdate: noop,
+} as DrawerWrapperProps['drawerContentProps'];