Skip to content

🐛 Bugfix: Resolve rotation reverse issue and replace scrollbar with drag interaction for image preview#2898

Open
Stockton11 wants to merge 3 commits intodevelopfrom
zwb/file_preview
Open

🐛 Bugfix: Resolve rotation reverse issue and replace scrollbar with drag interaction for image preview#2898
Stockton11 wants to merge 3 commits intodevelopfrom
zwb/file_preview

Conversation

@Stockton11
Copy link
Copy Markdown
Contributor

@Stockton11 Stockton11 commented Apr 28, 2026

  1. 修复旋转反向的问题
  2. 修复旋转后显示不全的问题
  3. 优化图片预览:使用拖拽替代滚动条,支持滚轮放缩、双击切换
  4. 迁移工具函数

@Stockton11 Stockton11 requested a review from WMC001 as a code owner April 28, 2026 15:46
Copilot AI review requested due to automatic review settings April 28, 2026 15:46
@Stockton11 Stockton11 requested a review from Dallas98 as a code owner April 28, 2026 15:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes image preview interaction issues by correcting rotation behavior and replacing scrollbar-based navigation with drag-to-pan plus wheel zoom and double-click reset in the file preview drawer.

Changes:

  • Added “Fit to page / Actual size” i18n strings for the image preview toolbar.
  • Implemented image viewport measurement (ResizeObserver), fit/actual base scaling, drag-to-pan, wheel zoom, and double-click reset behaviors.
  • Updated the image preview toolbar to include a fit/actual toggle and adjusted zoom/rotate handlers.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
frontend/public/locales/zh/common.json Adds zh translations for image “fit page” / “actual size” actions.
frontend/public/locales/en/common.json Adds en translations for image “fit page” / “actual size” actions.
frontend/components/ui/filePreviewDrawer.tsx Reworks image preview to support drag pan, wheel zoom, fit/actual sizing, and rotation adjustments.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/components/ui/filePreviewDrawer.tsx Outdated
Comment thread frontend/components/ui/filePreviewDrawer.tsx
Comment thread frontend/components/ui/filePreviewDrawer.tsx
Comment thread frontend/components/ui/filePreviewDrawer.tsx Outdated
Stockton11 and others added 2 commits April 29, 2026 00:37
…ction for image preview

Co-authored-by: Copilot <copilot@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants