Skip to content

Avoid page jump after folding a header block #7785

Activity

added this to the backlog milestone on Mar 27, 2023
changed the title [-]改进折叠标题块后页面大幅跳动[/-] [+]Improved page jump after folding heading block[/+] on Mar 29, 2023
HowcanoeWang

HowcanoeWang commented on Mar 30, 2023

@HowcanoeWang

The page jump also happens if the pages contains too many images, when redirected from the "cross-ref blocks"
当从块引用的链接跳转到一个有很多图片的文档时,图片加载完毕后也会触发页面跳动,等待图片加载完毕后,再从块引用链接跳转才不会出现

88250

88250 commented on Mar 30, 2023

@88250
MemberAuthor

@HowcanoeWang 图片的高度似乎无法计算。

HowcanoeWang

HowcanoeWang commented on Mar 30, 2023

@HowcanoeWang

@HowcanoeWang 图片的高度似乎无法计算。

可以参考打字机模式,强制从块引用跳转的块 (或聚焦的块) 在屏幕中间(或顶部)垂直居中?

PS:局部加载的大文档,从页面标题大纲中跳转,也会出现这个问题,需要等待加载完毕后,再点击才行

modified the milestones: backlog, 2.8.5 on Apr 11, 2023
modified the milestones: 2.8.5, 2.8.6, backlog on Apr 17, 2023
changed the title [-]Improved page jump after folding heading block[/-] [+]Avoid page jump after folding a header block[/+] on May 1, 2023
modified the milestones: backlog, 2.8.7 on May 1, 2023
88250

88250 commented on May 1, 2023

@88250
MemberAuthor

@HowcanoeWang 对于图片加载的情况目前没有好的解决方案,因为图片加载完以后会把高度撑高,导致定位不准。

HowcanoeWang

HowcanoeWang commented on May 1, 2023

@HowcanoeWang

@HowcanoeWang 对于图片加载的情况目前没有好的解决方案,因为图片加载完以后会把高度撑高,导致定位不准。

有没有可能通过给图片块记录高度信息,然后加载的时候先把高度计算好,用空白块先把图片“撑”起来,然后后续再把图片显示出来?

keep1

(添加图片的时候记录,以及对于已经添加的图片,后续成功加载的时候也记录一下)

88250

88250 commented on May 1, 2023

@88250
MemberAuthor

这个方案不行的,因为实际渲染大小是自适应界面大小的,高度会随着界面大小变化而变化,无法计算出绝对位置。

HowcanoeWang

HowcanoeWang commented on May 1, 2023

@HowcanoeWang

这个方案不行的,因为实际渲染大小是自适应界面大小的,高度会随着界面大小变化而变化,无法计算出绝对位置。

我的想法是,图片渲染的显示逻辑修改一下,在元信息中记录图片的高宽比之后(而不是高度的具体像素),根据页面大小,先计算出图片容器的大小,然后图片后续只能在这个容器里加载出来

(类似于准备好0.001kb的超小图片,可以瞬间加载完把界面撑起来,然后再进行跳转的定位,后续再实现对图片进行替换

added a commit that references this issue on May 3, 2023
Vanessa219

Vanessa219 commented on May 3, 2023

@Vanessa219
Member

只要是加载都会抖动

added a commit that references this issue on May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @88250@Vanessa219@HowcanoeWang

      Issue actions

        Avoid page jump after folding a header block · Issue #7785 · siyuan-note/siyuan