Skip to content

fix: restore PDF viewer data-page after reload - #13559

Merged
tiensonqin merged 2 commits into
masterfrom
logseq/fix-pdf-reload-data-page-1bd8
Nov 18, 2026
Merged

tiensonqin merged 2 commits into
masterfrom
logseq/fix-pdf-reload-data-page-1bd8

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Fixes logseq/db-test#1384

Summary

Initial routing can request a page title before db-worker exists, leaving body[data-page] unset. PDF positioning CSS depends on that attribute, so reopening a PDF after reload can leave a blank pane and a misplaced toolbar.

Reapply both the document title and body page label after graph restore finishes and db-worker is ready. Keep the recovery logic in the existing theme effect, with worker readiness included in its dependencies.

Validation

  • Isolated hidden Electron comparison: master reproduced the zero-sized PDF container after reload; the restore retry recovered fixed positioning and visible PDF text. This UI comparison preceded the behavior-preserving helper inlining.
  • Final inline implementation: theme and route tests passed (8 tests, 22 assertions); changed-file clj-kondo passed with 0 errors and 0 warnings.
  • App, Electron, browser worker, and Node worker builds passed.
  • Rebased onto master d6082682125a4d528afc377927a1cf18f14e7d18.

Notes

Initial fail-fast route lookup errors remain; the post-restore effect repairs the title and body label once their prerequisites are ready.

@devin-ai-integration
devin-ai-integration Bot force-pushed the logseq/fix-pdf-reload-data-page-1bd8 branch from 9d4d5e0 to c5c1a51 Compare October 2, 2026 11:59
@devin-ai-integration
devin-ai-integration Bot marked this pull request as ready for review October 2, 2026 12:19

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Devin Review: 1 flag

Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

@megayu
megayu force-pushed the logseq/fix-pdf-reload-data-page-1bd8 branch from c5c1a51 to 13b1e6c Compare November 17, 2026 07:31
cursoragent and others added 2 commits November 18, 2026 21:28
Retry document title and body data-page once the graph is restored and
db-worker is ready. Initial routing can run before the worker exists,
leaving data-page unset and breaking PDF viewer geometry.

Co-authored-by: Tienson Qin <[email protected]>
@tiensonqin
tiensonqin force-pushed the logseq/fix-pdf-reload-data-page-1bd8 branch from 13b1e6c to a886dd6 Compare November 18, 2026 13:28
@tiensonqin
tiensonqin merged commit 5b876dc into master Nov 18, 2026
10 checks passed
@tiensonqin
tiensonqin deleted the logseq/fix-pdf-reload-data-page-1bd8 branch November 18, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DB: Opening a PDF after reload leaves a blank viewer and overlapping toolbar

3 participants