Fix PDF-parsing progress pill drifting toward the bottom (v1.14.1)

It used position:sticky with a top:40vh offset - sticky's containing
block grows with the document, so on a long PDF the pill drifted
toward the bottom instead of staying a fixed distance from the
viewport's actual visible top. Switched to position:fixed.

Also investigated a "characters all gone" report: verified directly
in the SQLite database that all 47 records for the book are intact,
and a fresh browser session renders them correctly with no errors -
this was a transient/stale-page display issue, not data loss.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
mARTin-B78 2026-07-06 16:14:54 +02:00
parent 960389ef5b
commit 6905219567
4 changed files with 16 additions and 5 deletions

View File

@ -9,6 +9,13 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · versioned wi
---
## [1.14.1] — 2026-07-06
### Fixed
- **"Reading PDF… page N" indicator drifted toward the bottom of the screen on long documents** — it used `position: sticky` with a `top: 40vh` offset, whose containing block grew with every page appended during parsing, so the pill drifted downward instead of staying a fixed distance from the actual visible top of the viewport. Switched to `position: fixed`, anchored near the top regardless of document length.
---
## [1.14.0] — 2026-07-06
### Added

View File

@ -1 +1 @@
1.14.0
1.14.1

View File

@ -10,7 +10,7 @@
<meta name="format-detection" content="telephone=no">
<meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#2563EB">
<meta name="app-version" content="1.14.0">
<meta name="app-version" content="1.14.1">
<link rel="manifest" href="/manifest.webmanifest">
<link rel="icon" href="/static/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/static/icon.svg">
@ -27,7 +27,7 @@
<!-- ── Core styles (local — no CDN dependency for first paint) ────────── -->
<link rel="stylesheet" href="/static/vendor/mdi/materialdesignicons.min.css">
<link rel="stylesheet" href="/static/style.css?v=1.14.0">
<link rel="stylesheet" href="/static/style.css?v=1.14.1">
<!-- ── Flag icons — non-blocking (loaded async, icons appear after JS) ── -->
@ -365,7 +365,7 @@ window.toggleNavTree = function(treeId, chevronId) {
</script>
<!-- loader.js: fetches sections → loads JS modules → removes skeleton -->
<script src="/static/loader.js?v=1.14.0"></script>
<script src="/static/loader.js?v=1.14.1"></script>
</body>
</html>

View File

@ -609,7 +609,11 @@ function readerShowParseProgress(total) {
const el = document.createElement('div');
el.className = 'reader-parsing';
el.innerHTML = '<span class="mdi mdi-loading mdi-spin" style="font-size:26px;"></span> <span>Reading PDF… page 0 / ' + total + '</span>';
el.style.cssText = 'position:sticky; top:40vh; z-index:100; margin:0 auto -64px; background:var(--accent); color:#fff; padding:14px 28px; border-radius:32px; font-size:18px; display:inline-flex; align-items:center; gap:12px; box-shadow:0 6px 24px rgba(0,0,0,.35); font-weight:700;';
// Fixed to the viewport (not sticky within the doc pane) — sticky's
// top:40vh drifted toward the bottom on long documents since its
// containing block grew with every page appended, instead of staying
// anchored a fixed distance from the actual visible top of the screen.
el.style.cssText = 'position:fixed; top:80px; left:50%; transform:translateX(-50%); z-index:100; background:var(--accent); color:#fff; padding:14px 28px; border-radius:32px; font-size:18px; display:inline-flex; align-items:center; gap:12px; box-shadow:0 6px 24px rgba(0,0,0,.35); font-weight:700;';
doc.insertBefore(el, doc.firstChild);
const label = el.querySelector('span:last-child');
return {