Skip to content

Commit c66ab33

Browse files
cursoragentarmenzg
andcommitted
Fix TOP_N display type in widget LLM context
Co-authored-by: Armen Zambrano G. <armenzg@users.noreply.github.com>
1 parent 1bbe4ed commit c66ab33

File tree

1 file changed

+7
-3
lines changed
  • static/app/views/dashboards/widgetCard

1 file changed

+7
-3
lines changed

static/app/views/dashboards/widgetCard/index.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,21 +177,25 @@ function WidgetCard(props: Props) {
177177
const navigate = useNavigate();
178178
const {dashboardId: currentDashboardId} = useParams<{dashboardId: string}>();
179179
const timeoutRef = useRef<NodeJS.Timeout | null>(null);
180+
const llmDisplayType =
181+
props.widget.displayType === DisplayType.TOP_N
182+
? DisplayType.AREA
183+
: props.widget.displayType;
180184

181185
// Push widget metadata into the LLM context tree for Seer Explorer.
182186
useLLMContext({
183187
title: props.widget.title,
184-
displayType: props.widget.displayType,
188+
displayType: llmDisplayType,
185189
widgetType: props.widget.widgetType,
186-
queryHint: getQueryHint(props.widget.displayType),
190+
queryHint: getQueryHint(llmDisplayType),
187191
queries: props.widget.queries.map(q => ({
188192
name: q.name,
189193
conditions: q.conditions,
190194
aggregates: q.aggregates,
191195
columns: q.columns,
192196
orderby: q.orderby,
193197
})),
194-
...getWidgetData(props.widget.displayType, data),
198+
...getWidgetData(llmDisplayType, data),
195199
});
196200

197201
const onDataFetched = (newData: Data) => {

0 commit comments

Comments
 (0)