Add Escape key to close settings modal

This commit is contained in:
2026-06-28 17:39:59 +02:00
parent db13b39b2b
commit 5534191268
2 changed files with 8 additions and 17 deletions

View File

@@ -1,19 +1,3 @@
## Task 17: UI Settings Modal - Close Settings Modal Via Overlay
**Suite:** `Robot.Ui.Settings Modal`
**Test:** `Close Settings Modal Via Overlay`
**Result:** FAIL
**Error:** `TimeoutError: locator.click: Timeout 10000ms exceeded. waiting for locator('id=config-modal .modal-overlay')`
**Instructions:**
- The test tries to click a `.modal-overlay` element inside `#config-modal`, but the element is not found.
- Inspect the settings modal HTML structure in the frontend.
- The overlay element may have a different class name (e.g., `.modal-backdrop`, `.overlay`) or may not exist as a separate element.
- Update the locator in `tests/robot/ui/settings_modal.robot` to match the actual DOM structure.
- If the overlay click-to-close behavior is missing, implement it in the frontend.
---
## Task 18: UI Settings Modal - Close Settings Modal Via Escape ## Task 18: UI Settings Modal - Close Settings Modal Via Escape
**Suite:** `Robot.Ui.Settings Modal` **Suite:** `Robot.Ui.Settings Modal`

View File

@@ -442,7 +442,14 @@ class AniWorldApp {
this.hideConfigModal(); this.hideConfigModal();
}); });
// Scheduler configuration document.addEventListener('keydown', (e) => {
const modal = document.getElementById('config-modal');
if (e.key === 'Escape' && modal && !modal.classList.contains('hidden')) {
this.hideConfigModal();
}
});
// Scheduler configuration
document.getElementById('scheduled-rescan-enabled').addEventListener('change', () => { document.getElementById('scheduled-rescan-enabled').addEventListener('change', () => {
this.toggleSchedulerTimeInput(); this.toggleSchedulerTimeInput();
}); });