Skip to content

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

Closed

Description

@tiensonqin

Summary

After reloading an ordinary page containing a PDF, opening that PDF leaves an empty pane on the left and places the PDF toolbar over the application's header/window controls on the right. The toolbar still reports 1 / 1, but the PDF page is invisible.

Navigating to another page and back, then reopening the same PDF, restores both layout and PDF text without modifying the asset. This also reproduces on an untouched imported PDF, so asset copy/cut/undo is not required.

Reproduction

Use a disposable local DB graph and a simple one-page PDF containing visible text.

  1. Add the PDF to a normal page, or import a file graph containing a PDF link. In the isolated imported fixture, the Markdown block was [QA-ALT-PDF-COPPER-OTTER-20261001](../assets/qa-document-20261001.pdf), with that file present under assets/.
  2. Open the resulting page and click the PDF. Confirm that its page and text are visible in the left-hand viewer.
  3. Close the PDF viewer with Alt+X.
  4. While still on the ordinary page containing the PDF link, reload the Electron window with Ctrl+R.
  5. Wait for the page and graph to finish restoring. Do not navigate to another page.
  6. Click the same PDF link.

Actual: the page content shifts right, leaving a large blank area on the left. The PDF toolbar appears across the upper-right app header and overlaps the normal controls. The PDF page itself is invisible, even though the page counter says 1 / 1.

Expected: the same PDF should render in the normal left-hand viewer, with its toolbar contained within that viewer.

Recovery and controls

  1. Close the broken viewer with Alt+X.
  2. Navigate to another ordinary page, then return to the PDF's page.
  3. Open the unchanged PDF again.

Result: normal left-hand viewer and visible PDF text return.

  • Closing and reopening the PDF without navigating did not repair the broken state in the first graph.
  • The correct graph and page remained selected in the isolated imported-graph trials. This is not the graph-selection problem in #1361.
  • The untouched imported PDF had no copy/cut/undo history. This is separate from the Asset-node paste omission in #1155.
  • Imported PDF bytes matched the source, and the same file rendered before reload and after navigation recovery. No file-loss claim is made.
  • No source changes or DOM/style patches were applied.

Frequency and fixture

Reproduced after all three reloads checked:

  • Native-uploaded PDF in one local DB graph on 3c27f1e875d524cfd76e0dc32687cb1f06a0f82e.
  • Untouched imported PDF in a separate local DB graph on that same revision.
  • The untouched imported PDF again after rebuilding current master e9fd02c8beb7c63858df5d5cb8667aff24ddd50e.

The synthetic PDF was a single page, 21,339 bytes, containing QA-PDF-TEXT-COPPER-OTTER-20261001; it had no scripts, forms, or external links. SHA-256: 8c11059645f9b2d6889dca8c67126585d38e385a0bc3042e5d03634509e7d244.

Read-only renderer evidence

On current master, while the viewer was visibly broken at 12:10:17 UTC on 2026-10-01:

{:title "QA-20261001-Asset-Import"
 :body-data-page nil
 :pdf-active true
 :container? true
 :css {:position "static" :left "auto" :width "0px" :height "0px"}
 :rect {:x 1188 :y 0 :width 0 :height 0}}

The prior-revision recovery comparison in the native-upload graph showed:

{:title "QA-E-PDF-Source"
 :body-data-page "QA-E-PDF-Source"
 :pdf-active true
 :css {:position "fixed" :left "0px"
       :width "498.953px" :height "848px"}
 :rect {:x 0 :y 0 :width 498.953125 :height 848}}

On current master the PDF was visibly normal before reload at 12:08:51, broken after reload at 12:09:46, and normal again after navigation at 12:11:35 UTC.

The current-master reload log emitted :<invoke-db-worker-error :thread-api/get-route-title twice just before the worker-ready and graph-restore messages. Worker readiness was logged at 12:09:20.093 and graph restoration at 12:09:20.370 UTC.

Source hypothesis

The observed geometry is consistent with the missing body label:

This suggests a startup route-label timing problem; it is a hypothesis, not a verified fix.

Environment

  • Logseq 2.0.1 Electron development build
  • Current tested master SHA: e9fd02c8beb7c63858df5d5cb8667aff24ddd50e
  • Both live renderer and Node worker report revision e9fd02c; build time 2026-10-01T12:05:40Z
  • Electron 42.3.0 / Chromium 148.0.7778.180
  • Debian GNU/Linux 13, Linux x86_64 cloud desktop
  • App window 1188 × 848, native keyboard/mouse interaction
  • Disposable local DB graphs with synthetic content, no sync
  • Web app not tested: the available cloud browser blocks the local development server, so this report makes no Web claim

Related reports checked

No exact DB reload/zero-sized-viewer issue or targeted active PR was found in the fresh search. These older/main-repository reports have related visual symptoms but different recorded triggers:

  • #13519: narrow-width toolbar overflow
  • #12518: oversized/clipped PDF pages
  • #9949, #11265: overlapping window controls
  • #10060: blank PDF after resize/zoom

This report is specifically scoped to the current DB reload → open PDF reproduction and navigation-only recovery.

Activity

  1. yuxi-liu-wired commented on Oct 28, 2026

    @yuxi-liu-wired

    Fixed in logseq/logseq#13897 (fix: file:// image paths, #alias of a tag, Validate graph report, PDF viewer after reload). Its description has the cause and the test that pins it; it fails on current master and passes with the fix.

  2. added 9 commits that reference this issue on Oct 28, 2026
    05d8514
    89d4444
    930b0f3
    bb4c978
    1e22291
    8e18d88
    a430603
    3edfe79
    f8f88ad
  3. added 5 commits that reference this issue on Nov 11, 2026
    cb6c702
    3996be5
    61ae6da
    53b302d
    09cd81b
  4. 19 remaining items

  5. added 14 commits that reference this issue on Nov 18, 2026
    a6a4e0a
    7bf96cb
    70a93f9
    3ff6940
    a805c71
    eb95e41
    4680863
    900be86
    ab8b604
    28ac612
    865d3c8
    709df0b
    9f1bbcb
    282dbc2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions