Fix broken reasoning message clicking

This commit is contained in:
Nate Kelley 2025-05-09 16:10:08 -06:00
parent dccb535535
commit 147b84947e
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
3 changed files with 6 additions and 4 deletions

View File

@ -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';

View File

@ -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>
) : (

View File

@ -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);