Repository navigation
fix(page-views): keep reading-view block outside .markdown-preview-sizer - #793
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #791
Obsidian rebuilds
.markdown-preview-sizer's children withsetChildrenInPlace()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-marginsis now two values (32px 32px), socalc(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.