Skip to content

Conversation

@keykbd
Copy link
Contributor

@keykbd keykbd commented Oct 20, 2025

まとめ / Summary

生成画像を拡大表示できるモーダルを追加しました。
全ての画像表示画面(Model Generation、Virtual Try-On、Background Replacement)で利用可能です。
image

新機能 / New Features

  • フルスクリーンモーダル: 画像右上の拡大ボタンまたは画像クリックで全画面表示
  • ズーム: 0.5x~5x(マウスホイール、ボタン、キーボード +/-/0
  • パン: ズーム時にドラッグで移動
  • キーボードショートカット: Escで閉じる、その他上記参照
  • 画像操作: モーダル内でコピー・ダウンロード可能

テスト

  • 手動でテストを実施しています。

Add fullscreen image modal with zoom and navigation features to improve
user experience when viewing generated images across all features
(Model Generation, Virtual Try-On, Background Replacement).

Features:
- New ImageModal component with zoom controls (0.5x-5x)
- Mouse wheel zoom and drag to pan
- Keyboard shortcuts (arrows, +/-, 0, Esc)
- Navigation between multiple images
- Zoom button added to image controls (alongside copy/download)
- Copy and download functions in modal
- Smooth transitions and intuitive UI

Changes:
- Add ImageModal.tsx with zoom, pan, and navigation
- Update Base64Image.tsx to support expand button
- Update ImageDisplay.tsx to integrate modal

The zoom button is now visible in the top-right corner of images,
making the expand feature discoverable without requiring hover.
This enhancement applies to all screens using ImageDisplay component.
Fix two critical issues in ImageModal component:

1. Auto-dismiss snackbar messages
   - Add useEffect to clear snackbar message after 3 seconds
   - Prevents message from staying visible indefinitely

2. Fix keyboard shortcut dependencies
   - Move useCallback definitions before useEffect
   - Add all required dependencies to useEffect dependency array
   - Ensures keyboard shortcuts reference latest callbacks
   - Fixes potential stale closure issues in React Strict Mode

Dependencies added: onClose, onIndexChange, handleZoomIn,
handleZoomOut, handleResetZoom
@keykbd keykbd self-assigned this Oct 20, 2025
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.

1 participant