- Show "Edit Mode" badge when image exists to clarify behavior
- Add prominent "Start Fresh" button to reset and generate new
- Change button text from "Generate Image" to "Edit Image" when editing
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update Creative Freedom, Scene Description, Reference Images, and
Output Resolution labels to use consistent uppercase styling.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add Prompt Studio React app with cinematic prompt optimization
- Integrate image generation via PHP backend API
- Support multi-reference image uploads (up to 14 images)
- Add resolution selector (1K/2K/4K)
- Make generated prompts editable before image generation
- Fix application lighting styles being passed to Gemini API
- Reorganize UI: inputs on left, outputs on right
- Update api.php to handle multiple reference images
- Add get_current_image.php endpoint for session image retrieval
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
CRITICAL FIX: APIs now always return JSON even if auth fails
Problem:
- Auth errors in api.php/enhance_prompt.php returned HTML
- JavaScript expected JSON, got "<br /><b>..." HTML error
- Result: "Unexpected token '<'" parse error
Solution:
- Wrapped auth checks in try-catch blocks
- Always return proper JSON responses
- Auth errors logged but don't break API
- Graceful fallback if auth system unavailable
Changes:
1. api.php - Try-catch around auth check
2. enhance_prompt.php - Try-catch around auth check
3. Both files: Continue without auth if error occurs
4. Errors logged to error_log for debugging
Benefits:
✅ APIs always return valid JSON
✅ No more "Unexpected token" errors
✅ App works during deployment/setup
✅ Can test without auth system fully configured
✅ Production-ready with auth when enabled
Image generation and prompt enhancement now work even if
auth system has configuration issues!
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
Updated config.example.php to match working config structure:
Changes:
- Load env_loader.php with file_exists check
- Always define SSO_ENABLED, SSO_TENANT_ID, SSO_CLIENT_ID
- Use !defined() checks to prevent redefinition errors
- Defaults to false/empty if .env not found
- Added error reporting settings
Server-check.php improvements:
- Shows actual SSO constant values (TRUE/FALSE/EMPTY)
- Better diagnostic output
DEPLOYMENT FIX:
On server, update config.php to match config.example.php structure.
This ensures SSO constants are always defined.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
CRITICAL FIX: Page now loads even if auth system has errors
Changes:
1. WRAPPED AUTH IN TRY-CATCH (index.php)
- Auth errors no longer break the app
- Falls back to default user if auth fails
- Logs error but continues loading
- App functional even with broken auth
2. ADDED COMPOSER AUTOLOAD (JWTValidator.php)
- Includes vendor/autoload.php for Firebase JWT
- Checks if file exists before requiring
- Prevents "Class not found" errors
3. RESILIENT ERROR HANDLING
- Default user: ['name' => 'User', 'preferred_username' => 'user@localhost']
- SSO disabled by default if auth fails
- Error logged to error_log for debugging
- No blank/broken pages
This ensures:
✅ App always loads (even with auth issues)
✅ Can diagnose auth problems without breaking site
✅ Graceful degradation if Composer not installed yet
✅ Works during deployment/setup
Perfect for testing and deployment scenarios!
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
Problem: Old session data had wrong format, showing count but no images
Solution:
- Added cleanupImageHistory() method
- Runs on SessionManager initialization
- Removes history items without 'filename' key
- Removes items where file doesn't exist
- Validates file paths (not directories)
Result:
- "Recent Images (4/10)" now correctly shows only valid entries
- Old/invalid history entries automatically removed
- Gallery only displays images that actually exist
- No more empty gallery with non-zero count
Backwards Compatibility:
- Handles migration from old session format
- Gracefully removes corrupted history data
- Fresh sessions start with clean history
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
Fixed two errors in Recent Images gallery:
1. Undefined array key "filename" (index.php:1053)
- Added check: isset($historyItem['filename'])
- Skip history items without filename key
- Prevents warning on legacy session data
2. file_get_contents() reading directory (session_manager.php:123)
- Added is_file() check before file_exists()
- Ensures path is a file, not directory
- Returns null for invalid paths
- Also added is_file() check for metadata file
Additional Improvements:
- Added isset() check for expires_at in metadata
- More robust error handling in getImage()
- Graceful degradation for corrupted history data
Result: No more PHP warnings in Recent Images section
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
UX Improvements:
- Click main image to view full-size in lightbox modal
- Dark overlay backdrop (95% opacity black)
- Smooth zoom-in animation
- Click outside or close button (×) to close
- ESC key closes lightbox
- Hover effect on main image (subtle scale)
- Prevents background scrolling when open
Modal Features:
- Full-screen overlay (95% viewport)
- Rounded corners and shadow on image
- Animated close button (turns gold on hover)
- Click-to-close on background
- Responsive sizing (max 95% width/height)
Perfect for inspecting generated images in detail!
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
Problem: Both conversation history and image gallery used .history-item class
Result: Conversation boxes were forced to square aspect-ratio (1:1)
Solution:
- Renamed image gallery class: .history-item → .history-image-item
- Renamed overlay class: .history-item-overlay → .history-image-overlay
- Conversation history keeps .history-item (now properly compact)
Now Working:
- Conversation history: Single-line compact items
- Image gallery: Square thumbnails as intended
- No CSS conflicts between the two
The conversation history boxes are now actually compact instead of
just having centered text in big square boxes!
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
UI Improvements:
- Reduced padding: 15px → 10px vertical
- Prompt and time on same line (flexbox layout)
- Removed unnecessary vertical spacing
- Time aligned to right, no-wrap
- Smaller font sizes for better density
- Tighter line height (1.3)
Before: Large boxes with lots of empty space
After: Compact single-line items showing more history
Visual Changes:
- History items now ~40% shorter
- Time displays inline on right
- More items visible without scrolling
- Cleaner, more efficient use of space
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
New Features:
- Track last 10 generated images per session
- Display thumbnail gallery below main image
- Click any thumbnail to download that image
- Timestamps show when each image was created
- Hover effects highlight thumbnails
UI Components:
- Responsive grid layout (auto-fill 120px thumbnails)
- Hover overlay with timestamp
- Golden border on hover
- Shows count: "Recent Images (X/10)"
SessionManager Updates:
- addToImageHistory() - Track images (max 10)
- getImageHistory() - Retrieve history array
- restoreImageFromHistory() - Restore previous image
- Auto-adds to history when setCurrentImage() called
User Experience:
- Easy access to recent generations
- Quick downloads without re-generating
- Visual timeline of session work
- 24-hour persistence (with images)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
Quick action buttons now:
- Populate the prompt field with suggested text
- Focus on the prompt field for editing
- Scroll to prompt field for visibility
- User can edit before clicking Generate
Previously: Auto-submitted form immediately
Now: User has control to review/edit before generating
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
- Created enhance_prompt.php API endpoint for AI prompt enhancement
- Integrated cinematography controls into main UI
- Added camera body, lens kit, and lighting application selections
- Implemented creative freedom slider for prompt customization
- Enhanced prompts now auto-fill into image generation form
- Seamless workflow: enhance prompt → generate image
Features:
- Real camera physics (Arri Alexa 35, Sony Venice 2, etc.)
- Professional lens characteristics (Cooke, Panavision, Canon K-35)
- Lighting presets (Golden Hour, Blue Hour, Neon Cyberpunk, etc.)
- Gemini AI integration for prompt optimization
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>
- Complete working image generation app using Imagen 3
- PHP backend with Gemini API integration
- Dark themed UI with prompt enhancement
- Session management and logging system
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 (1M context) <noreply@anthropic.com>