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.

## 2026-07-18 - Async Loading States with aria-busy
**Learning:** 비동기 μž‘μ—… 쀑 μ‚¬μš©μžμ—κ²Œ λͺ…ν™•ν•œ λ‘œλ”© ν”Όλ“œλ°±μ„ μ œκ³΅ν•˜λ €λ©΄ λ²„νŠΌμ˜ ν…μŠ€νŠΈμ™€ disabled μ†μ„±λ§Œ λ³€κ²½ν•˜λŠ” 것보닀 \`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 @@ -148,9 +148,11 @@ function renderHistory(history = loadHistory()) {
const btn = e.currentTarget;
const initialChildren = Array.from(btn.childNodes);
btn.disabled = true;
btn.setAttribute("aria-busy", "true");
btn.textContent = "Loading...";
openJobDetail(job).finally(() => {
btn.replaceChildren(...initialChildren);
btn.removeAttribute("aria-busy");
btn.disabled = false;
});
}));
Expand Down Expand Up @@ -299,6 +301,7 @@ async function retryActiveJob() {
const jobId = activeJobDetail.jobId;
const initialChildren = Array.from(el.retryJobBtn.childNodes);
el.retryJobBtn.disabled = true;
el.retryJobBtn.setAttribute("aria-busy", "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 @@ -414,6 +418,7 @@ async function refreshKpis() {
async function refreshKpiEvidence() {
const initialChildren = Array.from(el.refreshEvidenceBtn.childNodes);
el.refreshEvidenceBtn.disabled = true;
el.refreshEvidenceBtn.setAttribute("aria-busy", "true");
el.refreshEvidenceBtn.textContent = "Refreshing...";

try {
Expand All @@ -428,13 +433,15 @@ 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.disabled = true;
el.loadDemoDataBtn.setAttribute("aria-busy", "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 @@ -507,6 +515,7 @@ async function submitDocument(event) {

const initialChildren = Array.from(el.submitBtn.childNodes);
el.submitBtn.disabled = true;
el.submitBtn.setAttribute("aria-busy", "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
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ void demoScriptUsesExistingApiAndSessionHistory() throws Exception {
assertTrue(script.contains("X-Clearfolio-Tenant-Id"));
assertTrue(script.contains("X-Clearfolio-Permissions"));
assertTrue(script.contains("deadLettered"));
assertTrue(script.contains("aria-busy"));
}
}

Expand Down
Loading