implementation
Implement in your agent
# Implement Modal dialog in your agent ## Objective Implement Modal dialog for this verified behavior: A focused surface for a contained task that makes the rest of the page temporarily inactive. ## Prerequisites - Inspect the repository, design system, and existing tests first. - Preserve unrelated changes and keep the file scope bounded. - Confirm that Modal dialog matches the need before writing code. ## Required behavior - While modal, keyboard focus stays inside the surface until it closes. - Escape closes the temporary surface and returns focus to a sensible control. ## States to cover - Dialog closed — Dialog closed - Dialog open — Dialog open ## Accessibility - The primary control or named region for Modal dialog has a stable accessible name from visible text or an explicit programmatic label; placeholder text and tooltips are not names. - Opening moves focus inside, Tab cannot reach the inert page, and closing restores focus to the logical opener. - Cancel, the named close control, and Escape close without saving; outside press is enabled only when accidental loss is harmless. - Tab and Shift+Tab cycle inside the dialog - Escape closes when cancellation is safe - Enter submits only from the intended control ## Non-goals - The workflow is long enough to deserve its own page - The information can remain nonmodal and contextual ## Acceptance criteria - The page behind the dialog is inert - The dialog has an accessible title and description - Focus is contained and then restored - Every dismissal path handles unsaved work safely
sha256:954b214e917f39f83e7fa9396527e51b871f44708883c2adb64a29789dba5d30