From d2780a8f41cfe8c4fa1839acf6047c99cf0cc6e9 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Tue, 19 Aug 2025 16:05:54 -0600 Subject: [PATCH] report streaming update --- apps/web/src/api/buster-electric/reports/hooks.ts | 1 + apps/web/src/api/buster-electric/reports/shapes.ts | 2 +- apps/web/src/components/features/sidebars/SidebarPrimary.tsx | 2 +- apps/web/src/components/ui/report/ReportEditorSkeleton.tsx | 5 +++-- .../ReportPageControllers/ReportPageController.tsx | 3 +++ 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/web/src/api/buster-electric/reports/hooks.ts b/apps/web/src/api/buster-electric/reports/hooks.ts index 32ac0e7c0..3620d56a4 100644 --- a/apps/web/src/api/buster-electric/reports/hooks.ts +++ b/apps/web/src/api/buster-electric/reports/hooks.ts @@ -18,6 +18,7 @@ export const useTrackAndUpdateReportChanges = ({ reportId }: { reportId: string DEFAULT_UPDATE_OPERATIONS, (report) => { if (report.value) { + console.log('report', report.value); const queryKey = reportsQueryKeys.reportsGetReport(reportId).queryKey; queryClient.setQueryData(queryKey, (v) => { if (!v) return v; diff --git a/apps/web/src/api/buster-electric/reports/shapes.ts b/apps/web/src/api/buster-electric/reports/shapes.ts index 82050d50b..5ccb9b4f7 100644 --- a/apps/web/src/api/buster-electric/reports/shapes.ts +++ b/apps/web/src/api/buster-electric/reports/shapes.ts @@ -12,7 +12,7 @@ export const reportShape = ({ }): ElectricShapeOptions => { return { params: { - table: 'reports', + table: 'report_files', where: `id='${reportId}'`, columns: REPORT_DEFAULT_COLUMNS, replica: 'default' diff --git a/apps/web/src/components/features/sidebars/SidebarPrimary.tsx b/apps/web/src/components/features/sidebars/SidebarPrimary.tsx index 63faedfd0..71e2d7a86 100644 --- a/apps/web/src/components/features/sidebars/SidebarPrimary.tsx +++ b/apps/web/src/components/features/sidebars/SidebarPrimary.tsx @@ -91,7 +91,7 @@ const yourStuff = ( id: BusterRoutes.APP_COLLECTIONS, active: isActiveCheck('collection', BusterRoutes.APP_COLLECTIONS) }, - process.env.NEXT_PUBLIC_ENABLE_REPORTS === 'true' && { + { label: 'Reports', icon: , route: createBusterRoute({ route: BusterRoutes.APP_REPORTS }), diff --git a/apps/web/src/components/ui/report/ReportEditorSkeleton.tsx b/apps/web/src/components/ui/report/ReportEditorSkeleton.tsx index 8637b5963..4d86150b2 100644 --- a/apps/web/src/components/ui/report/ReportEditorSkeleton.tsx +++ b/apps/web/src/components/ui/report/ReportEditorSkeleton.tsx @@ -52,7 +52,8 @@ export function ReportEditorSkeleton({ elements = DEFAULT_ELEMENTS }: ReportEditorSkeletonProps) { return ( -
+
{/* Toolbar skeleton */} {elements.includes('toolbar') && (
@@ -73,7 +74,7 @@ export function ReportEditorSkeleton({ )} {/* Content area */} -
+
{/* Header skeleton */} {elements.includes('header') && ( diff --git a/apps/web/src/controllers/ReportPageControllers/ReportPageController.tsx b/apps/web/src/controllers/ReportPageControllers/ReportPageController.tsx index 503105250..f9cfeba57 100644 --- a/apps/web/src/controllers/ReportPageControllers/ReportPageController.tsx +++ b/apps/web/src/controllers/ReportPageControllers/ReportPageController.tsx @@ -11,6 +11,7 @@ import DynamicReportEditor from '@/components/ui/report/DynamicReportEditor'; import { type IReportEditor } from '@/components/ui/report/ReportEditor'; import { ReportEditorSkeleton } from '@/components/ui/report/ReportEditorSkeleton'; import { useChatIndividualContextSelector } from '@/layouts/ChatLayout/ChatContext'; +import { useTrackAndUpdateReportChanges } from '@/api/buster-electric/reports/hooks'; export const ReportPageController: React.FC<{ reportId: string; @@ -47,6 +48,8 @@ export const ReportPageController: React.FC<{ const commonClassName = 'sm:px-[max(64px,calc(50%-350px))]'; + useTrackAndUpdateReportChanges({ reportId }); + return (
{report ? (