report streaming update

This commit is contained in:
Nate Kelley 2025-08-19 16:05:54 -06:00
parent f265bf51db
commit d2780a8f41
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
5 changed files with 9 additions and 4 deletions

View File

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

View File

@ -12,7 +12,7 @@ export const reportShape = ({
}): ElectricShapeOptions<BusterReportShape> => {
return {
params: {
table: 'reports',
table: 'report_files',
where: `id='${reportId}'`,
columns: REPORT_DEFAULT_COLUMNS,
replica: 'default'

View File

@ -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: <ASSET_ICONS.reports />,
route: createBusterRoute({ route: BusterRoutes.APP_REPORTS }),

View File

@ -52,7 +52,8 @@ export function ReportEditorSkeleton({
elements = DEFAULT_ELEMENTS
}: ReportEditorSkeletonProps) {
return (
<div className={cn('mx-auto w-full space-y-6 sm:px-[max(64px,calc(50%-350px))]', className)}>
<div
className={cn('mx-auto mt-8 w-full space-y-6 sm:px-[max(64px,calc(50%-350px))]', className)}>
{/* Toolbar skeleton */}
{elements.includes('toolbar') && (
<div className="border-border flex h-11 w-full animate-pulse items-center justify-between border-b bg-transparent px-3">
@ -73,7 +74,7 @@ export function ReportEditorSkeleton({
)}
{/* Content area */}
<div className="px-8 pb-12">
<div className="px-0 pb-12">
<div className="border-border animate-pulse space-y-6 rounded-lg bg-transparent">
{/* Header skeleton */}
{elements.includes('header') && (

View File

@ -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 (
<div className={cn('h-full space-y-1.5 overflow-y-auto pt-9', className)}>
{report ? (