Fix thumbnail quality and mobile vertical split layout
Build and Deploy Verso / deploy (push) Successful in 10m23s
Build and Deploy Verso / deploy (push) Successful in 10m23s
Thumbnails: update the actual thumbnail endpoint (ConversionController.js thumbnailFromBuild) to quality=90 and width=794. The previous fix targeted ConversionManager.js which handles preview mode, not the thumbnail route called by ThumbnailManager.mjs. Mobile layout: move the isMobile guard before the stored-preference check in getInitialLayout(). The autoSave race fix (build 274) stopped future bad writes, but a stale 'flat' in localStorage was still being read on every load, blocking the mobile check. Mobile now always starts in verticalSplit regardless of any stored value. CI: add node --check on all server-side .mjs files in the Dockerfile, after source copy and before webpack compile, so syntax errors like the escaped-backtick incident fail the build immediately. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -54,6 +54,13 @@ RUN --mount=type=cache,target=/root/.cache \
|
|||||||
# Add the actual source files
|
# Add the actual source files
|
||||||
# ---------------------------
|
# ---------------------------
|
||||||
COPY --parents libraries/ services/ tools/migrations/ /overleaf/
|
COPY --parents libraries/ services/ tools/migrations/ /overleaf/
|
||||||
|
|
||||||
|
# Syntax-check all server-side ESM modules before the expensive webpack
|
||||||
|
# compile. node --check parses without executing, so it's fast and safe.
|
||||||
|
# Catches things like escaped backticks from sed substitutions that webpack
|
||||||
|
# never sees (it only bundles frontend code).
|
||||||
|
RUN find services/web/app/src services/web/modules -name '*.mjs' | xargs node --check
|
||||||
|
|
||||||
RUN --mount=type=cache,target=/root/.cache \
|
RUN --mount=type=cache,target=/root/.cache \
|
||||||
--mount=type=cache,target=/root/.yarn/berry/cache,id=server-ce-yarn-cache \
|
--mount=type=cache,target=/root/.yarn/berry/cache,id=server-ce-yarn-cache \
|
||||||
--mount=type=tmpfs,target=/usr/local/share/.cache/yarn \
|
--mount=type=tmpfs,target=/usr/local/share/.cache/yarn \
|
||||||
|
|||||||
@@ -336,9 +336,9 @@ async function thumbnailFromBuild(req, res) {
|
|||||||
'pdftocairo',
|
'pdftocairo',
|
||||||
[
|
[
|
||||||
'-jpeg',
|
'-jpeg',
|
||||||
'-jpegopt', 'quality=82',
|
'-jpegopt', 'quality=90',
|
||||||
'-singlefile',
|
'-singlefile',
|
||||||
'-scale-to-x', '380',
|
'-scale-to-x', '794',
|
||||||
'-scale-to-y', '-1',
|
'-scale-to-y', '-1',
|
||||||
'-f', '1',
|
'-f', '1',
|
||||||
'-l', '1',
|
'-l', '1',
|
||||||
|
|||||||
@@ -90,11 +90,13 @@ const MOBILE_MQ = '(max-width: 767px)'
|
|||||||
function getInitialLayout(): IdeLayout {
|
function getInitialLayout(): IdeLayout {
|
||||||
const stored = localStorage.getItem('pdf.layout')
|
const stored = localStorage.getItem('pdf.layout')
|
||||||
const isMobile = window.matchMedia(MOBILE_MQ).matches
|
const isMobile = window.matchMedia(MOBILE_MQ).matches
|
||||||
// flat is the only preference respected on mobile — both 'split' and
|
// On mobile, always start in verticalSplit (editor above, PDF below).
|
||||||
// 'vertical' (which may have been stored from a desktop session) map to
|
// We must check isMobile first: a stale 'flat' in localStorage (written by
|
||||||
// verticalSplit because side-by-side is unusable on a narrow screen.
|
// a previous autoSave race or a desktop session) would otherwise short-circuit
|
||||||
if (stored === 'flat') return 'flat'
|
// the mobile check and leave the user stuck in a flat/editor-only layout.
|
||||||
|
// The user can still collapse to flat during a session, but it does not persist.
|
||||||
if (isMobile) return 'verticalSplit'
|
if (isMobile) return 'verticalSplit'
|
||||||
|
if (stored === 'flat') return 'flat'
|
||||||
if (stored === 'split') return 'sideBySide'
|
if (stored === 'split') return 'sideBySide'
|
||||||
if (stored === 'vertical') return 'verticalSplit'
|
if (stored === 'vertical') return 'verticalSplit'
|
||||||
return 'sideBySide'
|
return 'sideBySide'
|
||||||
|
|||||||
Reference in New Issue
Block a user