Repository navigation
feat(admin-editor): 分屏编辑与预览双向比例滚动同步 - #38
Merged
Merged
Conversation
- 新增 scrollSync 模块:可滚动比例映射 + 程序写入事件吞掉,避免双向回环 - 仅分屏态绑定:edit/preview 态短路,预览区条件挂载时随视图切换重绑 - ResizeObserver 跟随预览防抖重渲染 / mermaid / 图片加载的高度变化重算主动侧比例 - 单测覆盖比例计算、双向同步、事件抑制、高度重算与解绑 Fixes #37
- 程序滚动事件位置偏离期望时按用户滚动抢回主动侧
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.
关联 issue:#37
变更
editor/scrollSync.ts:可滚动比例(0..1)映射 + 1px 容差吞掉程序写入引发的 scroll 事件,双向绑定不回环AdminPostEditor仅在分屏态绑定编辑器 scroller 与预览 section;预览 section 条件挂载,切回分屏时随viewMode重新绑定ResizeObserver观察两侧滚动容器与预览内容容器:预览 300ms 防抖重渲染 / mermaid / 图片加载导致高度变化时,按主动侧重算跟随侧比例验证
scrollSync单测 13 例:比例计算、双向同步、程序事件抑制、偏离期望值判定、不可滚动跳过、高度重算、解绑npm test23 files / 139 tests;tsc -b、oxlint、prettier、npm run build全绿备注
Fixes #37自动关闭 issue