Fix incorrect preview pane height on session start in horiz mode - #108
Merged
Merged
Conversation
ViewPort#_onResize() (horiz case) read pane_data.viewportOffset() before calling pane_data.show(). Since #previewPane starts as display:none in the mailbox template, viewportOffset() returns 0 for a hidden element, so the computed pane height (document.viewport.getHeight() - offset) equals the full window height instead of window height minus the space already used above the pane (toolbar, message list, etc). This wrong height is set as an inline style and is only ever recalculated on an explicit window resize or pane-mode toggle, so it silently affects every message previewed for the rest of the session until one of those events fires by chance (e.g. opening browser DevTools, which itself triggers a resize). Fix: show() the pane before measuring its offset."
Member
|
Thank you! |
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.
ViewPort#_onResize() (horiz case) read pane_data.viewportOffset()
before calling pane_data.show(). Since #previewPane starts as
display:none in the mailbox template, viewportOffset() returns 0
for a hidden element, so the computed pane height
(document.viewport.getHeight() - offset) equals the full window
height instead of window height minus the space already used above
the pane (toolbar, message list, etc).
This wrong height is set as an inline style and is only ever
recalculated on an explicit window resize or pane-mode toggle, so
it silently affects every message previewed for the rest of the
session until one of those events fires by chance (e.g. opening
browser DevTools, which itself triggers a resize).
Fix: show() the pane before measuring its offset.
To reproduce: load the dynamic view fresh (no prior resize or
pane-mode toggle this session), horiz layout, and preview any
message. The preview pane will be sized to the full window height,
pushing content below the visible area with no way to scroll to it.
While investigating, a second, unrelated possible issue was found in
the lazy image-loading code (js/imp.js, IMP_JS.iframeImgLazyLoadRun):
its visible-range calculation mixes coordinates from the IFRAME's
own document with mb.scrollTop from the parent document, which can
under-compute the range on very long messages. This was not
triggered after applying the fix in this commit, so it has not
been tested or fixed here.