implementation
Implement in your agent
# Implement Lightbox in your agent ## Objective Implement Lightbox for this verified behavior: A modal viewer that enlarges one media item and may let the user move through a related collection. ## Prerequisites - Inspect the repository, design system, and existing tests first. - Preserve unrelated changes and keep the file scope bounded. - Confirm that Lightbox matches the need before writing code. ## Required behavior - While modal, keyboard focus stays inside the surface until it closes. - Previous and next controls move through the collection without leaving the viewer. - Escape closes the temporary surface and returns focus to a sensible control. ## States to cover - Gallery view — Gallery view - Media expanded — Media expanded ## Accessibility - The primary control or named region for Lightbox has a stable accessible name from visible text or an explicit programmatic label; placeholder text and tooltips are not names. - Opening moves focus to the viewer or close control, contains it, and closing returns it to the originating thumbnail. - The named close control and Escape always dismiss; outside press is optional and never the only path. - Tab reaches viewer controls - Left and Right move between media when documented - Escape closes the viewer ## Non-goals - The media must be compared side by side - The content is a form or consequential decision ## Acceptance criteria - The selected media and its caption are clearly identified - Keyboard users can reach navigation and close controls - Focus returns to the originating thumbnail - Loading and media errors have a textual fallback
sha256:52e221d0810b166668d027d4015a97db7dc1476f16d3b982f8303a007351afd3