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.

chore: updated drilldown popup ui to match tooltip (#11113)

Abhi kumarf4e5534e53e1
diff --git a/frontend/src/container/DashboardContainer/visualization/hooks/usePanelContextMenu.ts b/frontend/src/container/DashboardContainer/visualization/hooks/usePanelContextMenu.ts
index aa8dbe9299..1c6d8d6670 100644
--- a/frontend/src/container/DashboardContainer/visualization/hooks/usePanelContextMenu.ts
+++ b/frontend/src/container/DashboardContainer/visualization/hooks/usePanelContextMenu.ts
@@ -104,7 +104,12 @@ export const usePanelContextMenu = ({
}
if (data && data?.record?.queryName) {
- onClick(data.coord, { ...data.record, label: data.label, timeRange });
+ onClick(data.coord, {
+ ...data.record,
+ label: data.label,
+ seriesColor: data.seriesColor,
+ timeRange,
+ });
}
},
[onClick, queryResponse],
diff --git a/frontend/src/container/QueryTable/Drilldown/drilldownUtils.tsx b/frontend/src/container/QueryTable/Drilldown/drilldownUtils.tsx
index 7e150ba318..60ad9b19f2 100644
--- a/frontend/src/container/QueryTable/Drilldown/drilldownUtils.tsx
+++ b/frontend/src/container/QueryTable/Drilldown/drilldownUtils.tsx
@@ -196,6 +196,7 @@ export const getUplotClickData = ({
coord: { x: number; y: number };
record: { queryName: string; filters: FilterData[] };
label: string | React.ReactNode;
+ seriesColor?: string;
} | null => {
if (!queryData?.queryName || !metric) {
return null;
@@ -208,6 +209,8 @@ export const getUplotClickData = ({
// Generate label from focusedSeries data
let label: string | React.ReactNode = '';
+ const seriesColor = focusedSeries?.color;
+
if (focusedSeries && focusedSeries.seriesName) {
label = (
<span style={{ color: focusedSeries.color }}>
@@ -223,6 +226,7 @@ export const getUplotClickData = ({
},
record,
label,
+ seriesColor,
};
};
@@ -237,6 +241,7 @@ export const getPieChartClickData = (
queryName: string;
filters: FilterData[];
label: string | React.ReactNode;
+ seriesColor?: string;
} | null => {
const { metric, queryName } = arc.data.record;
if (!queryName || !metric) {
@@ -248,6 +253,7 @@ export const getPieChartClickData = (
queryName,
filters: getFiltersFromMetric(metric), // TODO: add where clause query as well.
label,
+ seriesColor: arc.data.color,
};
};
diff --git a/frontend/src/container/QueryTable/Drilldown/useAggregateDrilldown.tsx b/frontend/src/container/QueryTable/Drilldown/useAggregateDrilldown.tsx
index f1720ae259..ab8acd8582 100644
--- a/frontend/src/container/QueryTable/Drilldown/useAggregateDrilldown.tsx
+++ b/frontend/src/container/QueryTable/Drilldown/useAggregateDrilldown.tsx
@@ -22,6 +22,7 @@ export interface AggregateData {
endTime: number;
};
label?: string | React.ReactNode;
+ seriesColor?: string;
}
const useAggregateDrilldown = ({
diff --git a/frontend/src/container/QueryTable/Drilldown/useBaseAggregateOptions.tsx b/frontend/src/container/QueryTable/Drilldown/useBaseAggregateOptions.tsx
index a9e851eb4f..604e821c5b 100644
--- a/frontend/src/container/QueryTable/Drilldown/useBaseAggregateOptions.tsx
+++ b/frontend/src/container/QueryTable/Drilldown/useBaseAggregateOptions.tsx
@@ -228,7 +228,13 @@ const useBaseAggregateOptions = ({
return (
<ContextMenu.Item
key={key}
- icon={isLoading ? <LoadingOutlined spin /> : icon}
+ icon={
+ isLoading ? (
+ <LoadingOutlined spin />
+ ) : (
+ <span style={{ color: aggregateData?.seriesColor }}>{icon}</span>
+ )
+ }
onClick={(): void => onClick()}
disabled={isLoading}
>
diff --git a/frontend/src/periscope/components/ContextMenu/styles.scss b/frontend/src/periscope/components/ContextMenu/styles.scss
index 40a7567932..503930ff71 100644
--- a/frontend/src/periscope/components/ContextMenu/styles.scss
+++ b/frontend/src/periscope/components/ContextMenu/styles.scss
@@ -4,7 +4,7 @@
gap: 8px;
padding: 8px;
cursor: pointer;
- color: var(--foreground);
+ color: var(--muted-foreground);
font-family: Inter;
font-size: var(--font-size-sm);
font-weight: 600;
@@ -20,13 +20,10 @@
overflow: hidden;
text-overflow: ellipsis;
- &:hover {
- background-color: var(--l1-background);
- }
-
+ &:hover,
&:focus {
outline: none;
- background-color: var(--l1-background);
+ background-color: var(--l2-background-hover);
}
&.disabled {
@@ -47,7 +44,8 @@
}
&:hover {
- background-color: var(--bg-cherry-100);
+ background-color: var(--danger-background);
+ color: var(--l1-foreground);
}
}
@@ -74,73 +72,24 @@
}
.context-menu-header {
- padding-bottom: 4px;
- border-bottom: 1px solid var(--l1-border);
+ padding: 8px 12px;
+ border-bottom: 1px solid var(--l2-border);
color: var(--muted-foreground);
}
-// Target the popover inner specifically for context menu
.context-menu .ant-popover-inner {
- padding: 12px 8px !important;
- // max-height: 254px !important;
- max-width: 300px !important;
-}
-
-// Dark mode support
-.darkMode {
- .context-menu-item {
- color: var(--muted-foreground);
-
- &:hover,
- &:focus {
- background-color: var(--l2-background);
- }
-
- &.danger {
- color: var(--bg-cherry-400);
-
- .icon {
- color: var(--bg-cherry-400);
- }
-
- &:hover {
- background-color: var(--danger-background);
- color: var(--l1-foreground);
- }
- }
-
- .icon {
- color: var(--bg-robin-400);
- }
- }
-
- .context-menu-header {
- border-bottom: 1px solid var(--l1-border);
- color: var(--muted-foreground);
- }
-
- // Set the menu popover background
- .context-menu .ant-popover-inner {
- background: var(--l1-background) !important;
- border: 1px solid var(--border) !important;
- }
+ padding: 0;
+ border-radius: 6px;
+ max-width: 300px;
+ background: var(--l2-background) !important;
+ border: 1px solid var(--l2-border) !important;
}
-// Context menu backdrop overlay
.context-menu-backdrop {
position: fixed;
- top: 0;
- left: 0;
- width: 100vw;
- height: 100vh;
+ inset: 0;
z-index: 9999;
background: transparent;
cursor: default;
-
- // Prevent any pointer events from reaching elements behind
pointer-events: auto;
-
- // Ensure it covers the entire viewport including any scrollable areas
- position: fixed !important;
- inset: 0;
}