fix: improve PDF viewer by hiding sidebar and removing padding (#689)

This commit is contained in:
Jinwoo Hong 2026-04-15 23:34:34 -04:00 committed by GitHub
parent 3466e552d0
commit 8c3501f8c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -96,15 +96,15 @@ export default function ImageViewer({
}
const previewPane = isPdf ? (
<div className="relative flex flex-1 flex-col overflow-auto bg-muted/20 p-4">
<div className="relative flex flex-1 flex-col overflow-auto">
{/* Why: Electron's Chromium PDF viewer can fail to initialize inside a
sandboxed iframe even when the Blob URL is valid. Using <embed> keeps
the preview isolated to the browser's native PDF surface without
depending on iframe document execution. */}
<embed
src={previewUrl}
src={`${previewUrl}#navpanes=0`}
type={mimeType}
className="flex-1 min-h-[24rem] w-full rounded-md border border-border/60 bg-background"
className="flex-1 min-h-[24rem] w-full bg-background"
/>
</div>
) : (