From 706d5b982115906d0a74b195087fca82070d3ade Mon Sep 17 00:00:00 2001
From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com>
Date: Thu, 16 Apr 2026 22:53:17 +0530
Subject: [PATCH] feat: enhance PDF viewer and report panel with public access
handling and UI updates
---
.../components/report-panel/pdf-viewer.tsx | 9 +++--
.../components/report-panel/report-panel.tsx | 37 ++++++++++++-------
.../components/tool-ui/generate-report.tsx | 6 ++-
.../components/tool-ui/generate-resume.tsx | 8 ++--
4 files changed, 37 insertions(+), 23 deletions(-)
diff --git a/surfsense_web/components/report-panel/pdf-viewer.tsx b/surfsense_web/components/report-panel/pdf-viewer.tsx
index 75e56cb37..48fab89cb 100644
--- a/surfsense_web/components/report-panel/pdf-viewer.tsx
+++ b/surfsense_web/components/report-panel/pdf-viewer.tsx
@@ -15,6 +15,7 @@ pdfjsLib.GlobalWorkerOptions.workerSrc = new URL(
interface PdfViewerProps {
pdfUrl: string;
+ isPublic?: boolean;
}
const ZOOM_STEP = 0.15;
@@ -22,7 +23,7 @@ const MIN_ZOOM = 0.5;
const MAX_ZOOM = 3;
const PAGE_GAP = 12;
-export function PdfViewer({ pdfUrl }: PdfViewerProps) {
+export function PdfViewer({ pdfUrl, isPublic = false }: PdfViewerProps) {
const [numPages, setNumPages] = useState(0);
const [scale, setScale] = useState(1);
const [loading, setLoading] = useState(true);
@@ -192,7 +193,7 @@ export function PdfViewer({ pdfUrl }: PdfViewerProps) {
return (
{numPages > 0 && (
-
+
{numPages > 1 && (
<>
@@ -215,10 +216,10 @@ export function PdfViewer({ pdfUrl }: PdfViewerProps) {
{loading ? (
-
+
) : (
diff --git a/surfsense_web/components/report-panel/report-panel.tsx b/surfsense_web/components/report-panel/report-panel.tsx
index 80f4ea759..3115378b8 100644
--- a/surfsense_web/components/report-panel/report-panel.tsx
+++ b/surfsense_web/components/report-panel/report-panel.tsx
@@ -286,22 +286,26 @@ export function ReportPanelContent({
}, [activeReportId, currentMarkdown]);
const activeVersionIndex = versions.findIndex((v) => v.id === activeReportId);
+ const isPublic = !!shareToken;
+ const btnBg = isPublic ? "bg-main-panel" : "bg-sidebar";
return (
<>
{/* Action bar — always visible; buttons are disabled while loading */}
- {/* Copy button */}
-
+ {/* Copy button — hidden for Typst (resume) */}
+ {reportContent?.content_type !== "typst" && (
+
+ )}
{/* Export dropdown */}
@@ -310,7 +314,7 @@ export function ReportPanelContent({
variant="outline"
size="sm"
disabled={isLoading || !reportContent?.content}
- className="h-8 px-3.5 py-4 text-[15px] gap-1.5 bg-sidebar select-none"
+ className={`h-8 px-3.5 py-4 text-[15px] gap-1.5 ${btnBg} select-none`}
>
Export
@@ -336,7 +340,7 @@ export function ReportPanelContent({
);
diff --git a/surfsense_web/components/tool-ui/generate-resume.tsx b/surfsense_web/components/tool-ui/generate-resume.tsx
index 8718ef9fa..b6501f183 100644
--- a/surfsense_web/components/tool-ui/generate-resume.tsx
+++ b/surfsense_web/components/tool-ui/generate-resume.tsx
@@ -67,8 +67,10 @@ function ResumeErrorState({ title, error }: { title: string; error: string }) {
-
{title}
-
{error}
+ {title && title !== "Resume" && (
+
{title}
+ )}
+
{error}
);
@@ -231,7 +233,7 @@ function ResumeCard({
{thumbState === "loading" &&
}
{thumbState === "error" && (
-
Preview unavailable
+
Preview unavailable
)}
{pdfUrl && (