Repository navigation
Conversation
图片预览和流程图放大面板只能点工具栏的放大、缩小按钮缩放,滚动滚轮没有反应。 新增 usePreviewWheelZoom:在预览浮层内滚动滚轮时触发对应的缩放按钮,多个预览共用一个监听,最后一个卸载时释放。 横向滚动、按住 Shift 和增量为 0 的滚动不处理;触控板的小增量会累积,并限制连续触发的频率。 流程图内联视图仍关闭自带的滚轮缩放,避免干扰页面滚动。 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Contributor
|
其实目前这个图片、流程图预览的控件做的不好,例如大部分时候箭头应该在左右方便切换,支持滚轮,要不整个替换掉? |
Contributor
Author
不是很理解这个意思,不过我觉得图片预览优化做好,咱们可以用成熟的组件 |
Contributor
那我这个暂时保留,等后续切换成熟的组件替换了再关闭 |
This branch has not been deployed
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.
背景与关联 / Context and related issue
主要改动 / Changes
usePreviewWheelZoom:在图片预览(.n-image-preview-container)和流程图放大面板(.mermaid-modal-panel)内滚动滚轮时,触发对应的放大或缩小按钮,沿用组件自己的缩放状态,不另存一份缩放值。多个预览共用一个监听,最后一个卸载时释放。BuddyImagePreview.vue:给放大、缩小按钮加上data-preview-zoom,作为滚轮缩放的查找依据;其余行为不变。DesktopMermaidBlock.vue:启用usePreviewWheelZoom,同时把内联视图的enable-wheel-zoom保持为关闭,避免干扰页面滚动,只在放大面板里用滚轮缩放。markstream-vue2.0.19 工具栏的固定顺序(放大、缩小、重置、关闭)取按钮,不按翻译文字匹配;升级该依赖时需要重新确认,新增的测试里有用真实组件覆盖这一点。验证 / Verification
usePreviewWheelZoom.spec.ts(10 个用例):只缩放当前打开的预览并阻止背景滚动;鼠标滚轮的行、页单位换算;内联图和无关内容不受影响;横向、Shift、零增量滚动被忽略;触控板增量累积、连发限频、反向与过期动作丢弃;共享监听及最后一个使用者卸载后释放;用真实的图片预览工具栏和现有缩放状态;用真实的 Mermaid 放大面板工具栏且不启用内联滚轮缩放。本地未单独运行,以 CI 为准。兼容与风险 / Compatibility and risks
markstream-vue版本敏感。界面变更 / UI changes
没有新增控件,行为变化是预览内滚轮可缩放。暂未附录屏。
🤖 Generated with Claude Code