# To AI Agent: Restructure Mobile Photo Viewer Layout with Fixed Viewport, Overlay Metadata, and Scrollable Comments ## 1. Context & Architectural UI Refactor We are redesigning the full-screen mobile photo inspector interface based on the visual layout annotated in `image.png`. The current structure is fragmented, causing layout instability when switching between images. ### Key Refactor Requirements: 1. **Fixed Image Viewport (Blue Zone):** Secure the photo viewport inside a strict, unyielding aspect-locked square container. Regardless of whether the active image is Landscape or Portrait, the container dimension must NOT snap, resize, or cause screen layout jumps. 2. **Geospatial Overlay (Red Arrow Destination):** Completely remove the static location metadata box from the bottom white panel. Relocate and render this location string as a clean, translucent text overlay pinned directly to the **bottom-left corner inside the image viewport**. 3. **Title Transformation (Green Arrow Destination):** Remove the text header segment "Lịch sử ảnh tại vị trí này (...)". In its place, dynamically render the active **Title of the Photo** (Tiêu đề của ảnh), serving as the primary text separator. 4. **Isolated Scrollable Comment Feed:** The entire lower comment zone must be configured to scroll dynamically. When users swipe up to read multiple comments, the layout thread must slide seamlessly underneath the fixed sticky image frame container (`z-20`). --- ## 2. Structural Layer Elevation (`z-index`) Matrix ┌────────────────────────────────────────────────────────┐ │ Tier 4: System Action Row & Closes (z-50) │ ➔ Native buttons (X, Close) ├────────────────────────────────────────────────────────┤ │ Tier 3: Fixed Photo Frame Viewport (z-20 / sticky) │ ➔ Aspect-Square Image Box │ └─► Sub-Layer: Location & Time Overlay (z-30) │ ➔ Pinned Bottom-Left on Image ├────────────────────────────────────────────────────────┤ │ Tier 2: Scrollable Comments Panel (z-10) │ ➔ Slides BEHIND Tier 3 when swiped └────────────────────────────────────────────────────────┘ --- ## 3. Code Refactoring Blueprint ### Step 1: Overhaul Layout Architecture (`MobilePhotoViewerModal.tsx`) Update or create the mobile component layout to enforce the absolute layer boundaries and fixed dimensions: ```typescript import React, { useState } from 'react'; import { X, MapPin, Calendar, Heart, Send } from 'lucide-react'; interface PhotoDetail { id: string; url: string; title: string; description?: string; latitude: number; longitude: number; locationName: string; capturedAt: string; likesCount: number; } export const MobilePhotoViewerModal: React.FC<{ photo: PhotoDetail; onClose: () => void }> = ({ photo, onClose }) => { const [commentInput, setCommentInput] = useState(''); return (
{photo.description}
)}Góc chụp đẹp quá, bối cảnh nhìn rất thoáng và đầy đủ ánh sáng tự nhiên!