Skip to content

fix(pdf): the toolbar wraps in a narrow pane instead of squeezing its buttons - #13878

Merged
tiensonqin merged 3 commits into
logseq:masterfrom
yuxi-liu-wired:fix/pdf-toolbar-narrow
Nov 17, 2026
Merged

tiensonqin merged 3 commits into
logseq:masterfrom
yuxi-liu-wired:fix/pdf-toolbar-narrow

Conversation

@yuxi-liu-wired

@yuxi-liu-wired yuxi-liu-wired commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #13519.

In a half-width window the PDF pane's toolbar (10 icon buttons, the pager and Close) is wider than the pane. The buttons could shrink and the row could not wrap, so the Close label ("关闭" in Chinese) stacked one character per line and the leftmost buttons were pushed outside the header, where they could not be clicked.

pdf.css: the toolbar buttons get whitespace-nowrap shrink-0, and the button row gets flex-wrap justify-end, so in a narrow pane the row wraps onto a second line, right-aligned, with every button whole and clickable. A wide pane is unchanged (one row).

Checked by rendering the toolbar's markup with the built static/css/style.css in a 410 px and a 290 px header:

header Close width buttons outside the header
410 px, master 20 px (stacked) 4
410 px, this PR 36 px (one line) 0
290 px, master 20 px (stacked) 7
290 px, this PR 36 px (one line) 0

Devin Review

@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 found 1 potential issue.

Devin Review


> .r {
/* In a narrow pane the buttons go to a second row instead of squeezing their labels */
@apply flex-wrap justify-end;

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.

🟡 Open popups block wrapped toolbar controls

When a narrow pane wraps the toolbar, opening a popup blocks clicks on Close and other lower-row controls. The later popup overlay starts 40px below the header top and covers that row.

Learn more

The toolbar lives inside a positioned header. Its popup overlays are later siblings in pdf-toolbar. The overlay rule places each visible overlay 40px below that header. Once the toolbar wraps below 40px, an open settings or finder overlay occupies the same area as the lower-row buttons and receives their clicks instead.

Example: At a 290px pane width, open settings, then click Close on the toolbar's lower row. The click lands on the transparent settings overlay and dismisses settings instead of closing the PDF.

Recommended fix: Keep popup overlays from intercepting toolbar rows, such as by placing them below the full wrapped toolbar or restricting their hit area outside the header. Check settings, finder, and outline with a wrapped toolbar.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@yuxi-liu-wired

Copy link
Copy Markdown
Contributor Author

Agreed, fixed in the latest commit: .hls-popup-overlay now starts at top: 100% of the header instead of a fixed 40px, so it begins below a wrapped second row. Checked with the toolbar markup and an open overlay in a 290px header: with the first commit the overlay took the click on Close; now Close receives it.

@yuxi-liu-wired
yuxi-liu-wired force-pushed the fix/pdf-toolbar-narrow branch 3 times, most recently from b9d77a0 to e96a016 Compare November 3, 2026 12:01
@yuxi-liu-wired
yuxi-liu-wired force-pushed the fix/pdf-toolbar-narrow branch 2 times, most recently from 7aeea65 to c24e3ff Compare November 12, 2026 12:01
…of squeezing its buttons

In a half-width window the PDF pane's toolbar is wider than the pane: the buttons shrank until the Close label ("关闭" in Chinese) stacked one character per line, and the leftmost buttons were pushed out of the header where they could not be clicked. The buttons now keep their size and label on one line, and the row wraps onto a second line when it does not fit.

Fixes logseq#13519
…oolbar row stays clickable

The settings, finder and outline overlays were placed 40px below the header's top, the height of a one-row toolbar. With the toolbar wrapped onto a second row, an open overlay covered that row and took its clicks. They now start at the bottom of the header (`top: 100%`).
@tiensonqin
tiensonqin merged commit 389b715 into logseq:master Nov 17, 2026
10 checks passed
@yuxi-liu-wired
yuxi-liu-wired deleted the fix/pdf-toolbar-narrow branch November 17, 2026 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PDF toolbar layout breaks in half-width split view (Close button wraps vertically)

3 participants