Merge pull request #907 from buster-so/big-nate-bus-1755-dashboard-click

click on dashboard opens chat
This commit is contained in:
Nate Kelley 2025-09-15 18:55:16 -06:00 committed by GitHub
commit 9fd2355e74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 18 additions and 21 deletions

View File

@ -409,6 +409,7 @@ const useDuplicateReportSelectMenu = ({ reportId }: { reportId: string }): IDrop
icon: <DuplicatePlus />,
onClick: () => {
console.log('Duplicate report');
alert('This feature is not available yet');
},
}),
[reportId]

View File

@ -14,7 +14,6 @@ export const AssetContainer: React.FC<{
const headerBorderVariant: AppPageLayoutProps['headerBorderVariant'] =
headerBorderVariantProp ?? (isChatMode ? 'ghost' : 'default');
console.log('isChatMode', isChatMode, headerBorderVariant);
return (
<AppPageLayout
header={header}

View File

@ -75,7 +75,12 @@ export const ChatResponseMessage_DashboardFile: React.FC<ResponseMessageFileProp
selected={isSelectedFile}
collapseDefaultIcon={<HeaderIcon isLoading={isLoading} isError={isError} />}
fileName={FileInfo}
headerWrapper={LinkHeaderWrapper({ linkProps: linkParams, metricId })}
headerWrapper={({ children }) => (
<Link {...linkParams}>
{/** biome-ignore lint/complexity/noUselessFragments: weird error */}
<>{children}</>
</Link>
)}
>
{!hasMetrics ? null : dashboardResponse ? (
<Content
@ -202,6 +207,7 @@ const Content = <
return (
<div
className="flex flex-col gap-y-2.5 px-3.5 py-2"
data-testid="dashboard-items"
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
@ -264,22 +270,3 @@ const SelectDashboardButtonAndText: React.FC<{
});
SelectDashboardButtonAndText.displayName = 'SelectDashboardButtonAndText';
const LinkHeaderWrapper = ({
linkProps,
metricId,
}: {
linkProps: ILinkProps;
metricId: string | undefined;
}): React.ComponentType<{ children: React.ReactNode }> => {
if (!metricId) {
return ({ children }: { children: React.ReactNode }) => children;
}
return ({ children }: { children: React.ReactNode }) => (
<Link {...linkProps}>
{/** biome-ignore lint/complexity/noUselessFragments: weird error */}
<>{children}</>
</Link>
);
};

View File

@ -28,6 +28,16 @@ export const ChatResponseMessage_File: React.FC<ChatResponseMessageProps> = Reac
if (file_type === 'dashboard') {
return ChatResponseMessage_DashboardFile;
}
if (file_type === 'report') {
return ChatResponseMessage_StandardFile;
}
if (file_type === 'metric') {
return ChatResponseMessage_StandardFile;
}
if (file_type === 'reasoning') {
return ChatResponseMessage_StandardFile;
}
const _exhaustiveCheck: never = file_type;
return ChatResponseMessage_StandardFile;
}, [file_type]);