Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .jules/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

## 2026-08-15 - ํŒŒ์ผ ์ž…๋ ฅ(File Input)์„ ์œ„ํ•œ ์ ‘๊ทผ์„ฑ ํ”„๋ก์‹œ ํŒจํ„ด (Accessibility Proxy for File Input)
**Learning:** ๋„ค์ดํ‹ฐ๋ธŒ `<input type="file">` ์š”์†Œ๋Š” ์‹œ๊ฐ์ ์œผ๋กœ ์Šคํƒ€์ผ๋งํ•˜๊ธฐ ๋งค์šฐ ๊นŒ๋‹ค๋กญ๊ณ  ์ข…์ข… ๋””์ž์ธ ์‹œ์Šคํ…œ์˜ ์ผ๊ด€์„ฑ์„ ๊นฌ๋‹ค. ๋‹จ์ˆœํžˆ `display: none`์„ ์‚ฌ์šฉํ•˜๋ฉด ์ ‘๊ทผ์„ฑ ํŠธ๋ฆฌ์—์„œ ์ œ๊ฑฐ๋˜์–ด ์Šคํฌ๋ฆฐ ๋ฆฌ๋”์™€ ํ‚ค๋ณด๋“œ ์‚ฌ์šฉ์ž๊ฐ€ ์ ‘๊ทผํ•  ์ˆ˜ ์—†๋‹ค. `aria-hidden="true"`๋Š” ํŒŒ์ผ ์ž…๋ ฅ ์š”์†Œ๋ฅผ ์ ‘๊ทผ์„ฑ ํŠธ๋ฆฌ์—์„œ ์ œ๊ฑฐํ•œ๋‹ค.
**Action:** ๋„ค์ดํ‹ฐ๋ธŒ ์ž…๋ ฅ์„ ์‹œ๊ฐ์ ์œผ๋กœ ์ˆจ๊ธธ ๋•Œ(์˜ˆ: `class="sr-only" tabindex="-1" aria-hidden="true"`), ํ•ญ์ƒ ํด๋ฆญ์„ ์ˆจ๊ฒจ์ง„ ์ž…๋ ฅ์— ์ „๋‹ฌํ•˜๋Š” ์™„์ „ํžˆ ์ ‘๊ทผ ๊ฐ€๋Šฅํ•œ ํ”„๋ก์‹œ `<button>`(์ ์ ˆํ•œ ํ…์ŠคํŠธ๋‚˜ `aria-label` ํฌํ•จ)์„ ์ œ๊ณตํ•˜๋ผ.
11 changes: 10 additions & 1 deletion scanner/dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@
<span class="logo"></span><span class="brand">AppGuardrail</span>
<span class="spacer"></span>
<span class="meta" id="src">no findings loaded</span>
<input type="file" id="file" accept="application/json,.json" aria-label="Upload findings file" style="margin-left:12px">
<button type="button" id="upload-proxy" class="primary-action">Upload findings</button>
<input type="file" id="file" accept="application/json,.json" class="sr-only" tabindex="-1" aria-hidden="true">
</header>
<p id="findings-summary" class="sr-only" role="status" aria-live="polite" aria-atomic="true"></p>
<main id="app" tabindex="-1"></main>
Expand Down Expand Up @@ -388,6 +389,14 @@ <h1>Dashboard</h1>
if(isDeployBlocking(f)!==expect) console.error('selftest FAIL', f, 'expected', expect);
}
})();

(function() {
const btn = document.getElementById('upload-proxy');
const inp = document.getElementById('file');
if (btn && inp) {
btn.addEventListener('click', () => inp.click());
}
})();
</script>
</body>
</html>
69 changes: 67 additions & 2 deletions tests/test_dashboard_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ def test_dashboard_rows_are_keyboard_accessible():
assert 'tabindex="0" role="button"' in html
assert 'title="View details for finding"' in html
assert "tbody tr:focus-visible" in html
assert "aria-label=\"Upload findings file\"" in html
assert "aria-label=\"Search findings\"" in html
assert "aria-label=\"Filter by severity\"" in html
assert "tr.addEventListener('keydown'" in html
assert "e.key === 'Enter' || e.key === ' '" in html
Expand Down Expand Up @@ -302,3 +300,70 @@ def test_dashboard_search_escape_clears_input():
assert "e.key === 'Escape'" in html
assert "query = '';" in html
assert "render();" in html


def test_dashboard_file_upload_proxy_accessibility():
"""File upload proxy button must be accessible and correctly linked to the hidden native input."""
html = dashboard_index_path().read_text(encoding="utf-8")

assert '<button type="button" id="upload-proxy" class="primary-action">Upload findings</button>' in html
assert 'class="sr-only"' in html and 'tabindex="-1"' in html and 'aria-hidden="true"' in html
assert "btn.addEventListener('click', () => inp.click())" in html

def test_file_upload_proxy_accessibility_contract_is_documented_accurately():
"""The journal must accurately document the accessibility hiding technique."""
from pathlib import Path
journal_path = Path(".jules/palette.md")
assert journal_path.is_file()
content = journal_path.read_text(encoding="utf-8")
assert '`aria-hidden="true"`๋Š” ํŒŒ์ผ ์ž…๋ ฅ ์š”์†Œ๋ฅผ ์ ‘๊ทผ์„ฑ ํŠธ๋ฆฌ์—์„œ ์ œ๊ฑฐ' in content


def test_dashboard_file_upload_proxy_accessibility():
"""File upload proxy button must be accessible and correctly linked to the hidden native input."""
html = dashboard_index_path().read_text(encoding="utf-8")

assert '<button type="button" id="upload-proxy" class="primary-action">Upload findings</button>' in html
assert 'class="sr-only"' in html and 'tabindex="-1"' in html and 'aria-hidden="true"' in html
assert "btn.addEventListener('click', () => inp.click())" in html

def test_file_upload_proxy_accessibility_contract_is_documented_accurately():
"""The journal must accurately document the accessibility hiding technique."""
from pathlib import Path
journal_path = Path(".jules/palette.md")
assert journal_path.is_file()
content = journal_path.read_text(encoding="utf-8")
assert '`aria-hidden="true"`๋Š” ํŒŒ์ผ ์ž…๋ ฅ ์š”์†Œ๋ฅผ ์ ‘๊ทผ์„ฑ ํŠธ๋ฆฌ์—์„œ ์ œ๊ฑฐ' in content


def test_dashboard_file_upload_proxy_accessibility():
"""File upload proxy button must be accessible and correctly linked to the hidden native input."""
html = dashboard_index_path().read_text(encoding="utf-8")

assert '<button type="button" id="upload-proxy" class="primary-action">Upload findings</button>' in html
assert 'class="sr-only"' in html and 'tabindex="-1"' in html and 'aria-hidden="true"' in html
assert "btn.addEventListener('click', () => inp.click())" in html

def test_file_upload_proxy_accessibility_contract_is_documented_accurately():
"""The journal must accurately document the accessibility hiding technique."""
from pathlib import Path
journal_path = Path(".jules/palette.md")
assert journal_path.is_file()
content = journal_path.read_text(encoding="utf-8")
assert '`aria-hidden="true"`๋Š” ํŒŒ์ผ ์ž…๋ ฅ ์š”์†Œ๋ฅผ ์ ‘๊ทผ์„ฑ ํŠธ๋ฆฌ์—์„œ ์ œ๊ฑฐ' in content

def test_dashboard_file_upload_proxy_accessibility():
"""File upload proxy button must be accessible and correctly linked to the hidden native input."""
html = dashboard_index_path().read_text(encoding="utf-8")

assert '<button type="button" id="upload-proxy" class="primary-action">Upload findings</button>' in html
assert 'class="sr-only"' in html and 'tabindex="-1"' in html and 'aria-hidden="true"' in html
assert "btn.addEventListener('click', () => inp.click())" in html

def test_file_upload_proxy_accessibility_contract_is_documented_accurately():
"""The journal must accurately document the accessibility hiding technique."""
from pathlib import Path
journal_path = Path(".jules/palette.md")
assert journal_path.is_file()
content = journal_path.read_text(encoding="utf-8")
assert '`aria-hidden="true"`๋Š” ํŒŒ์ผ ์ž…๋ ฅ ์š”์†Œ๋ฅผ ์ ‘๊ทผ์„ฑ ํŠธ๋ฆฌ์—์„œ ์ œ๊ฑฐ' in content
Loading