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
3 changes: 3 additions & 0 deletions .jules/palette.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2024-05-18 - Disabled and Loading States for Async Actions
**Learning:** Adding explicit loading and disabled states to asynchronous action buttons (like "Refresh") provides immediate feedback, reducing user confusion and preventing double-submissions.
**Action:** Always ensure that buttons triggering network requests visually indicate the loading state and are disabled until the request completes.
## 2026-07-09 - λ²„νŠΌ λ‚΄ λ‘œλ”© ν…μŠ€νŠΈ
**Learning:** 비동기 μž‘μ—… μ‹œ λ²„νŠΌ HTML을 μž„μ‹œλ‘œ λ‘œλ”© ν…μŠ€νŠΈλ‘œ κ΅μ²΄ν•˜μ—¬ μ§„ν–‰ μƒνƒœλ₯Ό μ‹œκ°μ μœΌλ‘œ λ³΄μ—¬μ£ΌλŠ” 것은 μ‚¬μš©μž κ²½ν—˜(UX)을 크게 ν–₯μƒμ‹œν‚΅λ‹ˆλ‹€.
**Action:** 비동기 μž‘μ—…μ„ μ‹œμž‘ν•˜κΈ° 전에 λ²„νŠΌμ˜ μ›λž˜ innerHTML을 μ €μž₯ν•˜κ³ , μ§„ν–‰ μƒνƒœλ₯Ό λ‚˜νƒ€λ‚΄λ„λ‘ HTML을 μ—…λ°μ΄νŠΈν•œ λ’€, finally λΈ”λ‘μ—μ„œ μ›λž˜ HTML둜 λ³΅μ›ν•©λ‹ˆλ‹€.
6 changes: 6 additions & 0 deletions src/main/resources/static/assets/viewer/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ async function retryActiveJob() {
const jobId = activeJobDetail.jobId;
setStatus("Requesting operator retry...");
el.retryJobBtn.disabled = true;
const originalRetryHtml = el.retryJobBtn.innerHTML;
el.retryJobBtn.innerHTML = "Requesting retry...";
try {
const res = await fetch(`/api/v1/convert/jobs/${encodeURIComponent(jobId)}/retry`, {
method: "POST",
Expand Down Expand Up @@ -308,6 +310,7 @@ async function retryActiveJob() {
setError("Network error while requesting retry. Retry when the service is reachable.");
} finally {
el.retryJobBtn.disabled = false;
el.retryJobBtn.innerHTML = originalRetryHtml;
}
}

Expand Down Expand Up @@ -437,6 +440,8 @@ async function submitDocument(event) {

el.submitBtn.disabled = true;
setStatus("Submitting document...");
const originalBtnHtml = el.submitBtn.innerHTML;
el.submitBtn.innerHTML = "Submitting...";

try {
const body = new FormData();
Expand Down Expand Up @@ -479,6 +484,7 @@ async function submitDocument(event) {
setError("Network error while submitting. Retry when the service is reachable.");
} finally {
el.submitBtn.disabled = false;
el.submitBtn.innerHTML = originalBtnHtml;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ void demoScriptUsesExistingApiAndSessionHistory() throws Exception {
assertTrue(script.contains("lastInspectedAt"));
assertTrue(script.contains("openJobDetail"));
assertTrue(script.contains("retryActiveJob"));
assertTrue(script.contains("innerHTML"));
assertTrue(script.contains("/retry"));
assertTrue(script.contains("X-Clearfolio-Operator-Id"));
assertTrue(script.contains("X-Clearfolio-Tenant-Id"));
Expand Down
Loading