🎉 FIXED: Screenshot gallery preview and enlargement functionality
Major Issues Resolved: - Screenshot gallery images now load and display correctly - Click-to-enlarge modal functionality working - ESC key closes enlarged images (confirmed working) - Click-outside-to-close functionality added - Created new /api/image route to serve screenshots (bypasses Next.js 15 route issue) - Fixed screenshot URL formatting to use query parameter format - Added proper keyboard event handling for ESC key - Improved timeframe extraction from screenshot filenames - Enhanced trade execution error handling with detailed feedback - Fixed Next.js build cache issues causing route problems - Cleaned up debugging console logs - Restored normal conditional gallery rendering - Proper error handling for image loading failures The screenshot gallery now fully works: 1. Images display in grid layout ✅ 2. Click any image to enlarge ✅ 3. ESC key closes enlarged view ✅ 4. Click outside modal to close ✅ 5. Proper timeframe labeling ✅ 6. Trade execution shows detailed error messages ✅
This commit is contained in:
@@ -475,7 +475,6 @@ export default function AIAnalysisPanel() {
|
||||
|
||||
return (
|
||||
<div className="card card-gradient">
|
||||
{console.log('AIAnalysisPanel render - result:', result)}
|
||||
<div className="flex items-center justify-between mb-6">
|
||||
<h2 className="text-xl font-bold text-white flex items-center">
|
||||
<span className="w-8 h-8 bg-gradient-to-br from-cyan-400 to-blue-600 rounded-lg flex items-center justify-center mr-3">
|
||||
@@ -1371,23 +1370,14 @@ export default function AIAnalysisPanel() {
|
||||
|
||||
{/* Screenshot Gallery */}
|
||||
{result && result.screenshots && (
|
||||
<>
|
||||
{console.log('Rendering ScreenshotGallery with:', {
|
||||
screenshots: result.screenshots,
|
||||
screenshotsLength: result.screenshots.length,
|
||||
symbol,
|
||||
selectedTimeframes,
|
||||
enlargedScreenshot
|
||||
})}
|
||||
<ScreenshotGallery
|
||||
screenshots={result.screenshots}
|
||||
symbol={symbol}
|
||||
timeframes={selectedTimeframes.map(tf => timeframes.find(t => t.value === tf)?.label || tf)}
|
||||
enlargedImage={enlargedScreenshot}
|
||||
onImageClick={handleScreenshotClick}
|
||||
onClose={() => setEnlargedScreenshot(null)}
|
||||
/>
|
||||
</>
|
||||
<ScreenshotGallery
|
||||
screenshots={result.screenshots}
|
||||
symbol={symbol}
|
||||
timeframes={selectedTimeframes.map(tf => timeframes.find(t => t.value === tf)?.label || tf)}
|
||||
enlargedImage={enlargedScreenshot}
|
||||
onImageClick={handleScreenshotClick}
|
||||
onClose={() => setEnlargedScreenshot(null)}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Multi-timeframe Screenshot Gallery */}
|
||||
|
||||
Reference in New Issue
Block a user