mirror of https://github.com/buster-so/buster.git
Fix broken reasoning message clicking
This commit is contained in:
parent
dccb535535
commit
147b84947e
|
@ -4,7 +4,7 @@ import React, { useMemo } from 'react';
|
|||
import { MetricViewChartContent } from './MetricViewChartContent';
|
||||
import { MetricViewChartHeader } from './MetricViewChartHeader';
|
||||
import { useGetMetric, useGetMetricData } from '@/api/buster_rest/metrics';
|
||||
import { useMemoizedFn, useMount } from '@/hooks';
|
||||
import { useMemoizedFn } from '@/hooks';
|
||||
import { inputHasText } from '@/lib/text';
|
||||
import { MetricChartEvaluation } from './MetricChartEvaluation';
|
||||
import { ChartType } from '@/api/asset_interfaces/metric/charts/enum';
|
||||
|
|
|
@ -27,6 +27,7 @@ export const ChatResponseReasoning: React.FC<{
|
|||
messageId: string;
|
||||
chatId: string;
|
||||
}> = React.memo(({ reasoningMessageId, isCompletedStream, messageId, chatId }) => {
|
||||
const urlMessageId = useChatLayoutContextSelector((x) => x.messageId);
|
||||
const { data: lastMessageTitle } = useGetChatMessage(messageId, {
|
||||
select: (x) => x?.reasoning_messages?.[reasoningMessageId ?? '']?.title
|
||||
});
|
||||
|
@ -34,7 +35,7 @@ export const ChatResponseReasoning: React.FC<{
|
|||
select: (x) => x?.final_reasoning_message
|
||||
});
|
||||
const selectedFileType = useChatLayoutContextSelector((x) => x.selectedFileType);
|
||||
const isReasonginFileSelected = selectedFileType === 'reasoning';
|
||||
const isReasonginFileSelected = selectedFileType === 'reasoning' && urlMessageId === messageId;
|
||||
const showShimmerText = isReasonginFileSelected ? false : !isCompletedStream;
|
||||
|
||||
const blackBoxMessage = useQuery({
|
||||
|
@ -74,7 +75,9 @@ export const ChatResponseReasoning: React.FC<{
|
|||
key={text}
|
||||
className="flex h-[14px] max-h-[14px] w-fit cursor-pointer items-center">
|
||||
{!showShimmerText ? (
|
||||
<Text variant={'secondary'} className="hover:text-text-default hover:underline">
|
||||
<Text
|
||||
variant={isReasonginFileSelected ? 'default' : 'secondary'}
|
||||
className="hover:text-text-default hover:underline">
|
||||
{text}
|
||||
</Text>
|
||||
) : (
|
||||
|
|
|
@ -25,7 +25,6 @@ export const useAutoChangeLayout = ({
|
|||
const messageId = useChatLayoutContextSelector((x) => x.messageId);
|
||||
const metricId = useChatLayoutContextSelector((x) => x.metricId);
|
||||
const dashboardId = useChatLayoutContextSelector((x) => x.dashboardId);
|
||||
const secondaryView = useChatLayoutContextSelector((x) => x.secondaryView);
|
||||
const dashboardVersionNumber = useChatLayoutContextSelector((x) => x.dashboardVersionNumber);
|
||||
const metricVersionNumber = useChatLayoutContextSelector((x) => x.metricVersionNumber);
|
||||
const currentRoute = useChatLayoutContextSelector((x) => x.currentRoute);
|
||||
|
|
Loading…
Reference in New Issue