diff --git a/surfsense_web/components/report-panel/report-panel.tsx b/surfsense_web/components/report-panel/report-panel.tsx index 5b91b4e69..595facf24 100644 --- a/surfsense_web/components/report-panel/report-panel.tsx +++ b/surfsense_web/components/report-panel/report-panel.tsx @@ -249,20 +249,29 @@ function ReportPanelContent({ ); - if (isLoading) { - return ; - } + // Show full-page skeleton only on initial load (no data loaded yet). + // Once we have versions/content from a prior fetch, keep the action bar visible. + const hasLoadedBefore = versions.length > 0 || reportContent !== null; - if (error || !reportContent) { + if (isLoading && !hasLoadedBefore) { return ( -
-
-

Failed to load report

-

- {error || "An unknown error occurred"} -

+ <> + {/* Minimal top bar with close button even during initial load */} +
+ {onClose && ( + + )}
-
+ + ); } @@ -270,7 +279,7 @@ function ReportPanelContent({ return ( <> - {/* Action bar */} + {/* Action bar — always visible after initial load */}
{/* Copy button */} @@ -278,6 +287,7 @@ function ReportPanelContent({ variant="outline" size="sm" onClick={handleCopy} + disabled={isLoading || !reportContent?.content} className="h-8 min-w-[80px] px-3.5 py-4 text-[15px]" > {copied ? "Copied" : "Copy"} @@ -289,6 +299,7 @@ function ReportPanelContent({
- {/* Report content */} + {/* Report content — skeleton/error/content shown only in this area */}
-
- {reportContent.content ? ( - - ) : ( -

- No content available. -

- )} -
+ {isLoading ? ( + + ) : error || !reportContent ? ( +
+
+

Failed to load report

+

+ {error || "An unknown error occurred"} +

+
+
+ ) : ( +
+ {reportContent.content ? ( + + ) : ( +

+ No content available. +

+ )} +
+ )}
); diff --git a/surfsense_web/components/tool-ui/generate-report.tsx b/surfsense_web/components/tool-ui/generate-report.tsx index 35cfdd019..5edc7e091 100644 --- a/surfsense_web/components/tool-ui/generate-report.tsx +++ b/surfsense_web/components/tool-ui/generate-report.tsx @@ -200,7 +200,7 @@ function ReportCard({ return (