fix: PC layout regression and silent PDF download failure
Build and Deploy Verso / deploy (push) Successful in 13m21s

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 <noreply@anthropic.com>
This commit is contained in:
claude
2026-06-16 20:42:22 +00:00
parent 762d3e75cf
commit c10a13f605
2 changed files with 7 additions and 3 deletions
@@ -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,
@@ -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')}`