From 46d14b356f19e147ff7570046e9f45ad46810cea Mon Sep 17 00:00:00 2001 From: seonghobae <8172694+seonghobae@users.noreply.github.com> Date: Fri, 17 Jul 2026 22:01:13 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=84=B8=EC=85=98=20=EA=B8=B0=EB=A1=9D?= =?UTF-8?q?=20=ED=85=8C=EC=9D=B4=EB=B8=94=EC=9D=98=20=EB=B0=98=EB=B3=B5?= =?UTF-8?q?=EC=A0=81=EC=9D=B8=20=EC=95=A1=EC=85=98=20=EB=B2=84=ED=8A=BC?= =?UTF-8?q?=EC=97=90=20=EB=8F=99=EC=A0=81=20aria-label=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 반복되는 테이블 액션 버튼('Details', 'Status JSON', 'Open viewer')은 스크린 리더 사용자에게 컨텍스트를 제공하지 않아 어떤 항목에 대한 액션인지 혼란을 줍니다. 이 변경 사항은 각 버튼에 문서의 파일 이름이 포함된 동적 `aria-label` 속성을 추가하여 접근성을 크게 향상시킵니다. 이를 위해 `createActionButton` 및 `createLink` 유틸리티 함수가 선택적 `ariaLabel` 인수를 수락하고 설정하도록 업데이트되었습니다. --- .jules/palette.md | 4 ++++ .../resources/static/assets/viewer/demo.js | 18 +++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.jules/palette.md b/.jules/palette.md index a34ea59..d86e122 100644 --- a/.jules/palette.md +++ b/.jules/palette.md @@ -13,3 +13,7 @@ ## 2026-07-13 - Async Table Actions UX **Learning:** Adding explicit loading and disabled states to table action buttons that invoke asynchronous processes helps prevent redundant API calls and visually assures the user that their request is being handled. **Action:** Consistently apply `disabled` state and `Loading...` text changes to inline table action buttons linked to async workflows, and carefully preserve underlying DOM structures with `Array.from(btn.childNodes)` during the loading cycle to avoid rendering regressions. + +## 2026-07-17 - Table Action Buttons Accessibility +**Learning:** Repetitive table action buttons or links (like 'Details' or 'Open') without context-specific labels are confusing for screen reader users, as multiple buttons have the exact same accessible name. +**Action:** Always provide dynamically generated, context-specific `aria-label` attributes that include row-specific identifiers (such as the filename) to these repetitive table actions. diff --git a/src/main/resources/static/assets/viewer/demo.js b/src/main/resources/static/assets/viewer/demo.js index 51466a8..843565e 100644 --- a/src/main/resources/static/assets/viewer/demo.js +++ b/src/main/resources/static/assets/viewer/demo.js @@ -81,13 +81,16 @@ function updateJob(jobId, patch, { refreshKpisAfterUpdate = true } = {}) { } } -function createLink(href, label) { +function createLink(href, label, ariaLabel) { const link = document.createElement("a"); link.href = href; link.textContent = label; link.className = "table-link"; link.target = "_blank"; link.rel = "noopener noreferrer"; + if (ariaLabel) { + link.setAttribute("aria-label", ariaLabel); + } return link; } @@ -110,11 +113,14 @@ async function openJsonDocument(url, title) { : "Unable to load JSON evidence with the current tenant claim."; } -function createActionButton(label, onClick) { +function createActionButton(label, onClick, ariaLabel) { const button = document.createElement("button"); button.type = "button"; button.textContent = label; button.className = "btn btn-secondary btn-compact"; + if (ariaLabel) { + button.setAttribute("aria-label", ariaLabel); + } button.addEventListener("click", onClick); return button; } @@ -143,6 +149,8 @@ function renderHistory(history = loadHistory()) { submittedCell.textContent = job.submittedAt || ""; actionsCell.className = "table-actions"; + const fileName = job.fileName || "Document"; + if (job.statusUrl) { actionsCell.appendChild(createActionButton("Details", (e) => { const btn = e.currentTarget; @@ -153,13 +161,13 @@ function renderHistory(history = loadHistory()) { btn.replaceChildren(...initialChildren); btn.disabled = false; }); - })); + }, `Details for ${fileName}`)); actionsCell.appendChild(createActionButton("Status JSON", () => { void openJsonDocument(job.statusUrl, "Clearfolio status JSON"); - })); + }, `Status JSON for ${fileName}`)); } if (job.jobId) { - actionsCell.appendChild(createLink(`/viewer/${encodeURIComponent(job.jobId)}`, "Open viewer")); + actionsCell.appendChild(createLink(`/viewer/${encodeURIComponent(job.jobId)}`, "Open viewer", `Open viewer for ${fileName}`)); } row.append(fileCell, statusCell, submittedCell, actionsCell);