fix(media): 詳細画面の遷移後に古いメディアが残る問題を修正 - #609
Conversation
Track active route params reactively, remount detail content for new media, and disable stale media response caching. Add browser regressions for source and search navigation.
📝 WalkthroughWalkthroughメディア詳細ルートの識別子解決をloaderデータと現在のルート状態に変更し、Accessor対応の表示・クエリ更新を追加した。メディア取得には Changesメディア詳細ルートと表示状態
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/server/src/tests/e2e/media-detail-manager-config.responsive.spec.ts (1)
46-46: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueテストの安定性向上:画像の中央からピクセルをサンプリングする
現在の
(128, 64)という固定座標でのサンプリングは、将来的にテスト用の画像サイズがそれより小さいものに変更された場合、キャンバスの範囲外(透明な黒)を取得してしまい、比較テストが常に一致して成功してしまうなどのリスクがあります。画像のサイズに依存せず確実にピクセル情報を取得するため、画像の中央座標を動的に計算してサンプリングすることを推奨します。
💡 推奨されるリファクタリング
- return [...context.getImageData(128, 64, 1, 1).data]; + const x = Math.floor(element.naturalWidth / 2); + const y = Math.floor(element.naturalHeight / 2); + return [...context.getImageData(x, y, 1, 1).data];🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/server/src/tests/e2e/media-detail-manager-config.responsive.spec.ts` at line 46, Update the pixel sampling logic around context.getImageData to derive the sample coordinates from the canvas dimensions, using its center rather than fixed coordinates (128, 64). Keep the existing returned pixel-data format unchanged and ensure the computed coordinates remain within the canvas bounds.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@apps/server/src/tests/e2e/media-detail-manager-config.responsive.spec.ts`:
- Line 46: Update the pixel sampling logic around context.getImageData to derive
the sample coordinates from the canvas dimensions, using its center rather than
fixed coordinates (128, 64). Keep the existing returned pixel-data format
unchanged and ensure the computed coordinates remain within the canvas bounds.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: a3f672e2-22f2-4f0f-986e-1ced49a81549
📒 Files selected for processing (8)
apps/server/src/components/media/media-viewer.tsxapps/server/src/routes/api/sources.$mediaSourceId.$mediaId.tsapps/server/src/routes/sources/$mediaSourceId/$mediaId/index.tsxapps/server/src/tests/e2e/media-detail-manager-config.responsive.spec.tsapps/tauri/src/components/media/media-viewer.tsxapps/tauri/src/routes/sources/$mediaSourceId/$mediaId/index.tsxpackages/ui/src/media-viewer.tsxpackages/ui/src/screens/media-detail-screen.tsx
概要
メディア詳細から一覧へ戻り、別のメディアを開いた際に最初の詳細が表示され続ける問題を修正します。
変更内容
検証
Summary by CodeRabbit