diff --git a/src/renderer/index.css b/src/renderer/index.css index 3b0aa06..af6fbae 100644 --- a/src/renderer/index.css +++ b/src/renderer/index.css @@ -437,6 +437,14 @@ html, body { overflow: hidden; } +.full-book-view { + flex: 1; + display: flex; + flex-direction: column; + padding: 0; + overflow: hidden; +} + .chapter-header { display: flex; align-items: baseline; diff --git a/tests/selftest-scenario.js b/tests/selftest-scenario.js index 1a87ae5..7b73607 100644 --- a/tests/selftest-scenario.js +++ b/tests/selftest-scenario.js @@ -310,6 +310,22 @@ const BOOK2_DIR = __BOOKDIR2_VALUE__; await new Promise((r) => setTimeout(r, 300)); out.fbNoStale = fb.state.doc.toString() === assembledGAB; + // the Full Book pane must be a bounded flex column whose editor can be + // scrolled, so every chapter is actually reachable on screen (a block + // layout here clips the manuscript to the first screenful) + const fbViewEl = document.getElementById("fullBookView"); + const fbHost = document.getElementById("fullBookHost"); + const fbEditor = fbHost.querySelector(".cm-editor"); + const vs = getComputedStyle(fbViewEl); + out.fbViewDisplay = vs.display; + out.fbViewDir = vs.flexDirection; + out.fbEditorHeight = Math.round(fbEditor.getBoundingClientRect().height); + out.fbViewportHeight = window.innerHeight; + out.fbLayoutOk = + vs.display === "flex" && + vs.flexDirection === "column" && + fbEditor.getBoundingClientRect().height <= window.innerHeight; + // closing and reopening the book preserves the chapter order await window.folio.openBookPath(BOOK2_DIR); await new Promise((r) => setTimeout(r, 400)); @@ -384,6 +400,7 @@ const BOOK2_DIR = __BOOKDIR2_VALUE__; "fbAfterReorderOk", "fbHasAllContent", "fbNoStale", + "fbLayoutOk", "reopenPersists", "deleteOk", "fbAfterDeleteOk",