Skip to content

fix(page-views): keep reading-view block outside .markdown-preview-sizer - #793

Merged
michaelpporter merged 1 commit into
mainfrom
fix/page-views-reading-view
Oct 12, 2026
Merged

michaelpporter merged 1 commit into
mainfrom
fix/page-views-reading-view

Conversation

@michaelpporter

Copy link
Copy Markdown
Owner

Refs #791

Obsidian rebuilds .markdown-preview-sizer's children with setChildrenInPlace() on every virtual-display update, which drops the page views block and makes the note jump (regression from 4.9.0 / #681). The block is now inserted before the sizer, and readable-line-width centering comes from CSS keyed on .is-readable-line-width, so #679 stays fixed. Approach as proposed in the issue.

Also fixes sticky page views in Reading view: --file-margins is now two values (32px 32px), so calc(var(--file-margins) * -1) was invalid and the strip never pinned. It now uses --file-margins-y, with a fallback.

Verified in the dev vault: with readable line width on and off, the block matches the sizer's left edge and width exactly, and is the same node, still connected, at full height after a forced onResize. Sticky pins flush at 0px when scrolled. Live Preview and source mode are unchanged. Build and 402 tests pass.

Obsidian rebuilds the sizer's children with setChildrenInPlace() on every
virtual-display update, dropping the page views block and making the note
jump (regression from 4.9.0, #681). Insert it before the sizer instead and
take readable-line-width centering from CSS so #679 stays fixed.

Also fix the sticky offset: --file-margins is now two values, so
calc(var(--file-margins) * -1) was invalid and sticky never pinned in
reading view. Use --file-margins-y with a fallback.

Refs #791
@michaelpporter
michaelpporter merged commit 2ea2f5a into main Oct 12, 2026
1 check passed
@michaelpporter
michaelpporter deleted the fix/page-views-reading-view branch October 12, 2026 01:02
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.

1 participant