Skip to content
Draft
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
3 changes: 3 additions & 0 deletions .jules/palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,6 @@
## 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-14 - 비동기 ν…Œμ΄λΈ” ν–‰(row) μΈν„°λž™μ…˜ λ°©μ§€ (aria-disabled)
**Learning:** `pointer-events: none` CSS 속성은 마우슀 이벀트만 막을 뿐, `Enter` λ˜λŠ” `Space` λ“±μ˜ ν‚€λ³΄λ“œ μΈν„°λž™μ…˜μ€ λ°©μ§€ν•˜μ§€ λͺ»ν•©λ‹ˆλ‹€. λ˜ν•œ ν…Œμ΄λΈ” ν–‰(`<tr>`)μ—λŠ” `:disabled` 가상 μ„ νƒμžκ°€ λ™μž‘ν•˜μ§€ μ•ŠκΈ° λ•Œλ¬Έμ— 비동기 μž‘μ—… μ‹œ ν™”λ©΄ 낭독기가 λΉ„ν™œμ„± μƒνƒœλ₯Ό μΈμ§€ν•˜μ§€ λͺ»ν•©λ‹ˆλ‹€.
**Action:** ν΄λ¦­ν˜• ν…Œμ΄λΈ” ν–‰μ˜ 비동기 처리 μ‹œμ—λŠ” `aria-disabled="true"`λ₯Ό λΆ€μ—¬ν•˜κ³ , 이λ₯Ό CSS(`opacity: 0.6`, `pointer-events: none`)와 연동함은 λ¬Όλ‘  μžλ°”μŠ€ν¬λ¦½νŠΈ 이벀트 ν•Έλ“€λŸ¬(ν‚€λ³΄λ“œ/클릭 λͺ¨λ‘)μ—μ„œ λͺ…μ‹œμ μœΌλ‘œ `aria-disabled` 값을 κ²€μ‚¬ν•˜μ—¬ μ‘°κΈ° λ°˜ν™˜(`return`)ν•˜λ„λ‘ μ²˜λ¦¬ν•΄μ•Ό ν•©λ‹ˆλ‹€.
17 changes: 15 additions & 2 deletions scanner/dashboard/console.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
th{font-size:11px;color:var(--muted);text-transform:uppercase}
tr.scan{cursor:pointer}
tr.scan:hover{background:var(--bg)}
tr.scan[aria-disabled="true"]{pointer-events:none;opacity:0.6}
input:focus-visible, button:focus-visible, tr.scan:focus-visible, .bar:focus-visible, #detail:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.close-btn{float:right;border:0;background:transparent;font-size:16px;cursor:pointer;color:var(--muted);padding:0 4px;margin-top:-2px}
.close-btn:hover{color:var(--text)}
Expand Down Expand Up @@ -88,6 +89,7 @@ <h1>AppGuardrail Console</h1>
detail.innerHTML="";
if(lastDetailFocus instanceof HTMLElement && lastDetailFocus.isConnected){
lastDetailFocus.removeAttribute("aria-busy");
lastDetailFocus.removeAttribute("aria-disabled");
delete lastDetailFocus.dataset.detailRequest;
lastDetailFocus.focus();
}
Expand Down Expand Up @@ -135,8 +137,17 @@ <h1>AppGuardrail Console</h1>
<td>${esc(s.created_at)}</td><td>${esc(s.repo||"β€”")}</td><td><code>${esc((s.commit||"β€”").slice(0,10))}</code></td>
<td>${s.total}</td><td>${pill(s.deploy_blocking,"var(--crit)")}</td><td>${pill(s.new_blocking,"var(--high)")}</td></tr>`).join("")||'<tr><td colspan="6" class="muted">No scans. POST to /api/v1/scans from CI.</td></tr>';
document.querySelectorAll("tr.scan").forEach(tr=>{
tr.onclick=()=>detail(tr.dataset.id,tr);
tr.addEventListener('keydown', e => { if(e.key === 'Enter' || e.key === ' ') { e.preventDefault(); detail(tr.dataset.id,tr); } });
tr.onclick=()=>{
if(tr.getAttribute("aria-disabled")==="true") return;
detail(tr.dataset.id,tr);
};
tr.addEventListener('keydown', e => {
if(e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
if(tr.getAttribute("aria-disabled")==="true") return;
detail(tr.dataset.id,tr);
}
});
});
}catch(e){ $("#msg").classList.remove("hidden");$("#app").classList.add("hidden");
$("#msg").innerHTML=`<span class="err">${esc(e.message)}</span>`; }
Expand All @@ -149,6 +160,7 @@ <h1>AppGuardrail Console</h1>
if(tr){
tr.dataset.detailRequest=String(requestId);
tr.setAttribute("aria-busy","true");
tr.setAttribute("aria-disabled","true");
}
d.classList.remove("hidden");
d.innerHTML='<div aria-live="polite" class="muted">Loading scan details...</div>';
Expand All @@ -173,6 +185,7 @@ <h1>AppGuardrail Console</h1>
}finally{
if(tr&&tr.dataset.detailRequest===String(requestId)){
tr.removeAttribute("aria-busy");
tr.removeAttribute("aria-disabled");
delete tr.dataset.detailRequest;
}
}
Expand Down
11 changes: 11 additions & 0 deletions tests/test_console_detail_loading_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,14 @@ def test_console_detail_scrolling_respects_reduced_motion():
assert "element.scrollIntoView();" in html
assert 'element.scrollIntoView({behavior:"smooth"});' in html
assert html.count("scrollDetailIntoView(d);") == 2

def test_console_disables_pending_detail_rows_until_their_request_settles():
"""Pointer and keyboard activation stay blocked while one row request is pending."""
html = _console_html()

assert 'tr.scan[aria-disabled="true"]{pointer-events:none;opacity:0.6}' in html
assert html.count('if(tr.getAttribute("aria-disabled")==="true") return;') == 2
assert 'tr.setAttribute("aria-disabled","true");' in html
assert 'lastDetailFocus.removeAttribute("aria-disabled");' in html
assert 'tr.removeAttribute("aria-disabled");' in html
assert 'tr.dataset.detailRequest===String(requestId)' in html
Loading