From c10a13f605468ceabd077fcc4b5de1b952521c39 Mon Sep 17 00:00:00 2001 From: claude Date: Tue, 16 Jun 2026 20:42:22 +0000 Subject: [PATCH] fix: PC layout regression and silent PDF download failure layout-context: getInitialLayout() was returning verticalSplit for any stored 'vertical' preference, including on desktop. Now checks isMobile first so stored mobile preference doesn't bleed into PC. compile-and-download-pdf: when compile succeeds but output.pdf is absent from outputFiles, the code crashed silently at outputFile.build leaving the user with no feedback. Now shows the error modal instead. Co-Authored-By: Claude Sonnet 4.6 --- .../compile-and-download-project-pdf-button.tsx | 4 ++++ services/web/frontend/js/shared/context/layout-context.tsx | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/services/web/frontend/js/features/project-list/components/table/cells/action-buttons/compile-and-download-project-pdf-button.tsx b/services/web/frontend/js/features/project-list/components/table/cells/action-buttons/compile-and-download-project-pdf-button.tsx index 47ff920860..57e189908f 100644 --- a/services/web/frontend/js/features/project-list/components/table/cells/action-buttons/compile-and-download-project-pdf-button.tsx +++ b/services/web/frontend/js/features/project-list/components/table/cells/action-buttons/compile-and-download-project-pdf-button.tsx @@ -98,6 +98,10 @@ function CompileAndDownloadProjectPDFButton({ const outputFile = data.outputFiles .filter((file: { path: string }) => file.path === 'output.pdf') .pop() + if (!outputFile) { + setShowErrorModal(true) + return + } const params = new URLSearchParams({ compileGroup: data.compileGroup, diff --git a/services/web/frontend/js/shared/context/layout-context.tsx b/services/web/frontend/js/shared/context/layout-context.tsx index 7441e158ad..f81257a6c5 100644 --- a/services/web/frontend/js/shared/context/layout-context.tsx +++ b/services/web/frontend/js/shared/context/layout-context.tsx @@ -89,11 +89,11 @@ const MOBILE_MQ = '(max-width: 767px)' function getInitialLayout(): IdeLayout { const stored = localStorage.getItem('pdf.layout') - if (stored === 'vertical') return 'verticalSplit' + const isMobile = window.matchMedia(MOBILE_MQ).matches if (stored === 'flat') return 'flat' if (stored === 'split') return 'sideBySide' - // No stored preference — default to vertical split on mobile - return window.matchMedia(MOBILE_MQ).matches ? 'verticalSplit' : 'sideBySide' + if (stored === 'vertical') return isMobile ? 'verticalSplit' : 'sideBySide' + return isMobile ? 'verticalSplit' : 'sideBySide' } const reviewPanelStorageKey = `ui.reviewPanelOpen.${getMeta('ol-project_id')}`