Merge pull request #725 from buster-so/nate/hot-fix-report-streaming

Nate/hot fix report streaming
This commit is contained in:
Nate Kelley 2025-08-20 10:42:45 -06:00 committed by GitHub
commit a4c093a130
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 2 additions and 10 deletions

View File

@ -24,7 +24,6 @@ export const useTrackAndUpdateReportChanges = ({
DEFAULT_UPDATE_OPERATIONS, DEFAULT_UPDATE_OPERATIONS,
(report) => { (report) => {
if (report.value) { if (report.value) {
console.log('report', report.value);
const queryKey = reportsQueryKeys.reportsGetReport(reportId).queryKey; const queryKey = reportsQueryKeys.reportsGetReport(reportId).queryKey;
queryClient.setQueryData(queryKey, (v) => { queryClient.setQueryData(queryKey, (v) => {
if (!v) return v; if (!v) return v;

View File

@ -48,7 +48,7 @@ export const useReportEditor = ({
const editor = usePlateEditor({ const editor = usePlateEditor({
plugins, plugins,
value: [], value,
readOnly: disabled || isStreaming readOnly: disabled || isStreaming
}); });

View File

@ -25,6 +25,7 @@ export const ReportPageController: React.FC<{
const isStreamingMessage = useChatIndividualContextSelector((x) => x.isStreamingMessage); const isStreamingMessage = useChatIndividualContextSelector((x) => x.isStreamingMessage);
const content: ReportElementsWithIds = report?.content || []; const content: ReportElementsWithIds = report?.content || [];
const commonClassName = 'sm:px-[max(64px,calc(50%-350px))]';
const { mutate: updateReport } = useUpdateReport(); const { mutate: updateReport } = useUpdateReport();
@ -46,18 +47,10 @@ export const ReportPageController: React.FC<{
debouncedUpdateReport({ reportId, content }); debouncedUpdateReport({ reportId, content });
}); });
const commonClassName = 'sm:px-[max(64px,calc(50%-350px))]';
useTrackAndUpdateReportChanges({ reportId, subscribe: isStreamingMessage }); useTrackAndUpdateReportChanges({ reportId, subscribe: isStreamingMessage });
return ( return (
<div className={cn('h-full space-y-1.5 overflow-y-auto pt-9', className)}> <div className={cn('h-full space-y-1.5 overflow-y-auto pt-9', className)}>
<div
className={cn(
'absolute right-5 bottom-5 h-15 w-15 animate-bounce rounded-full',
isStreamingMessage ? 'bg-purple-400' : 'bg-green-400'
)}
/>
{report ? ( {report ? (
<> <>
<ReportPageHeader <ReportPageHeader