diff --git a/.jules/palette.md b/.jules/palette.md index ea004e2d2..e2b3c25f2 100644 --- a/.jules/palette.md +++ b/.jules/palette.md @@ -81,3 +81,7 @@ ## 2026-08-12 - Skip to Content Accessibility **Learning:** Screen reader and keyboard-only users experience significant friction when forced to navigate through repetitive header controls on every page load. **Action:** Keep a visible-on-focus skip link as the first interactive element, target a programmatically focusable main container, and give the focused link a high-contrast outline. + +## 2024-10-07 - File Upload Proxy Accessibility +**Learning:** `aria-hidden="true"`는 파일 입력 요소를 접근성 트리에서 제거 +**Action:** 기본 파일 입력 요소(input[type="file"])를 프록시 버튼으로 대체할 때 접근성 트리를 올바르게 관리해야 합니다. diff --git a/scanner/dashboard/index.html b/scanner/dashboard/index.html index 132bc31b2..34fd4407c 100644 --- a/scanner/dashboard/index.html +++ b/scanner/dashboard/index.html @@ -93,7 +93,8 @@ AppGuardrail no findings loaded - + +

@@ -325,6 +326,10 @@

Dashboard

} const fileInput = document.getElementById('file'); +const headerBrowseFindings = document.getElementById('header-browse-findings'); +if (headerBrowseFindings) { + headerBrowseFindings.addEventListener('click', () => fileInput.click()); +} fileInput.addEventListener('change', () => { const selectedFile = fileInput.files?.[0]; fileInput.value = ''; diff --git a/tests/test_dashboard_core.py b/tests/test_dashboard_core.py index 75a5809f8..fcc98912a 100644 --- a/tests/test_dashboard_core.py +++ b/tests/test_dashboard_core.py @@ -302,3 +302,23 @@ def test_dashboard_search_escape_clears_input(): assert "e.key === 'Escape'" in html assert "query = '';" in html assert "render();" in html + +def test_file_upload_proxy_accessibility_contract_is_documented_accurately() -> None: + """Ensure the learning about aria-hidden is accurately documented in the journal.""" + from pathlib import Path + import pytest + journal_path = Path('.jules/palette.md') + if not journal_path.exists(): + pytest.skip("Journal file not found.") + content = journal_path.read_text(encoding='utf-8') + assert '`aria-hidden="true"`는 파일 입력 요소를 접근성 트리에서 제거' in content + +def test_file_upload_proxy_structure_meets_accessibility_constraints() -> None: + """Ensure the proxy button and hidden file input meet structural a11y constraints.""" + html = dashboard_index_path().read_text(encoding="utf-8") + + assert 'aria-hidden="true"' in html + assert 'class="sr-only"' in html + assert 'tabindex="-1"' in html + assert 'id="header-browse-findings"' in html + assert "headerBrowseFindings.addEventListener('click', () => fileInput.click())" in html