Skip to content
Open
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 @@ -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.

## 2024-07-20 - 비동기 μž‘μ—… 쀑 `aria-busy` 속성 ν™œμš©
**Learning:** 비동기 μž‘μ—… 쀑에 λ‘œλ”© μƒνƒœλ₯Ό μ‹œκ°μ μœΌλ‘œλ§Œ ν‘œμ‹œν•˜λŠ” 것을 λ„˜μ–΄μ„œ `aria-busy="true"` 속성을 λ™μ μœΌλ‘œ μΆ”κ°€ν•˜λ©΄ 슀크린 리더 및 보쑰 κΈ°μˆ μ— μƒνƒœλ₯Ό μ •ν™•νžˆ 전달할 수 μžˆμ–΄ μ›Ή 접근성이 크게 ν–₯μƒλ©λ‹ˆλ‹€.
**Action:** λ²„νŠΌμ΄λ‚˜ μš”μ†Œκ°€ 비동기 톡신을 λŒ€κΈ°ν•˜λŠ” λ™μ•ˆ μƒνƒœ 변경이 일어날 λ•Œ 항상 `aria-busy` 속성을 μ„€μ •ν•˜κ³  μž‘μ—…μ΄ μ™„λ£Œλ˜λŠ” `finally` λΈ”λ‘μ—μ„œ μ•ˆμ „ν•˜κ²Œ μ œκ±°ν•˜λ„λ‘ ν•©λ‹ˆλ‹€.
10 changes: 10 additions & 0 deletions src/main/resources/static/assets/viewer/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,12 @@ function renderHistory(history = loadHistory()) {
actionsCell.appendChild(createActionButton("Details", (e) => {
const btn = e.currentTarget;
const initialChildren = Array.from(btn.childNodes);
btn.setAttribute("aria-busy", "true");
btn.disabled = true;
btn.textContent = "Loading...";
openJobDetail(job).finally(() => {
btn.replaceChildren(...initialChildren);
btn.removeAttribute("aria-busy");
btn.disabled = false;
});
}));
Expand Down Expand Up @@ -298,6 +300,7 @@ async function retryActiveJob() {

const jobId = activeJobDetail.jobId;
const initialChildren = Array.from(el.retryJobBtn.childNodes);
el.retryJobBtn.setAttribute("aria-busy", "true");
el.retryJobBtn.disabled = true;
el.retryJobBtn.textContent = "Retrying...";
setStatus("Requesting operator retry...");
Expand Down Expand Up @@ -339,6 +342,7 @@ async function retryActiveJob() {
setError("Network error while requesting retry. Retry when the service is reachable.");
} finally {
el.retryJobBtn.replaceChildren(...initialChildren);
el.retryJobBtn.removeAttribute("aria-busy");
el.retryJobBtn.disabled = false;
}
}
Expand Down Expand Up @@ -413,6 +417,7 @@ async function refreshKpis() {

async function refreshKpiEvidence() {
const initialChildren = Array.from(el.refreshEvidenceBtn.childNodes);
el.refreshEvidenceBtn.setAttribute("aria-busy", "true");
el.refreshEvidenceBtn.disabled = true;
el.refreshEvidenceBtn.textContent = "Refreshing...";

Expand All @@ -428,12 +433,14 @@ async function refreshKpiEvidence() {
el.kpiExportStatus.textContent = "Snapshot evidence is unavailable while the service is unreachable.";
} finally {
el.refreshEvidenceBtn.replaceChildren(...initialChildren);
el.refreshEvidenceBtn.removeAttribute("aria-busy");
el.refreshEvidenceBtn.disabled = false;
}
}

async function loadDemoData() {
const initialChildren = Array.from(el.loadDemoDataBtn.childNodes);
el.loadDemoDataBtn.setAttribute("aria-busy", "true");
el.loadDemoDataBtn.disabled = true;
el.loadDemoDataBtn.textContent = "Loading...";
setStatus("Loading seeded buyer-demo story...");
Expand All @@ -459,6 +466,7 @@ async function loadDemoData() {
setError("Unable to load seeded demo story.");
} finally {
el.loadDemoDataBtn.replaceChildren(...initialChildren);
el.loadDemoDataBtn.removeAttribute("aria-busy");
el.loadDemoDataBtn.disabled = false;
}
}
Expand Down Expand Up @@ -506,6 +514,7 @@ async function submitDocument(event) {
}

const initialChildren = Array.from(el.submitBtn.childNodes);
el.submitBtn.setAttribute("aria-busy", "true");
el.submitBtn.disabled = true;
el.submitBtn.textContent = "Submitting...";
setStatus("Submitting document...");
Expand Down Expand Up @@ -551,6 +560,7 @@ async function submitDocument(event) {
setError("Network error while submitting. Retry when the service is reachable.");
} finally {
el.submitBtn.replaceChildren(...initialChildren);
el.submitBtn.removeAttribute("aria-busy");
el.submitBtn.disabled = false;
}
}
Expand Down
Loading