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-16 - ๋ฐ˜๋ณต๋˜๋Š” ๋™์  ํ…Œ์ด๋ธ” ์•ก์…˜ ๋ฒ„ํŠผ์˜ ์ ‘๊ทผ์„ฑ ํ–ฅ์ƒ
**Learning:** ๋ฐ์ดํ„ฐ ํ…Œ์ด๋ธ”์˜ ๊ฐ ํ–‰๋งˆ๋‹ค ๋ฐ˜๋ณต๋˜๋Š” ์•ก์…˜ ๋ฒ„ํŠผ(์˜ˆ: "์„ธ๋ถ€ ์ •๋ณด", "์ƒํƒœ JSON")์€ ์Šคํฌ๋ฆฐ ๋ฆฌ๋” ์‚ฌ์šฉ์ž์—๊ฒŒ ์ปจํ…์ŠคํŠธ ์—†๋Š” ๋ชจํ˜ธํ•œ ์ •๋ณด๋ฅผ ์ œ๊ณตํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
**Action:** ๋™์  ํ…Œ์ด๋ธ”์˜ ๋ฐ˜๋ณต๋˜๋Š” ์•ก์…˜ ์š”์†Œ์—๋Š” ๊ด€๋ จ๋œ ํ–‰์˜ ๋ฐ์ดํ„ฐ(์˜ˆ: ํŒŒ์ผ๋ช…)๋ฅผ ๊ฒฐํ•ฉํ•œ ์ปจํ…์ŠคํŠธ๊ฐ€ ํฌํ•จ๋œ ๋ช…ํ™•ํ•œ `aria-label`์„ ๋ถ€์—ฌํ•˜์—ฌ ์ ‘๊ทผ์„ฑ์„ ๋ณด์žฅํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
19 changes: 13 additions & 6 deletions src/main/resources/static/assets/viewer/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}
Expand All @@ -138,7 +144,8 @@ function renderHistory(history = loadHistory()) {
const submittedCell = document.createElement("td");
const actionsCell = document.createElement("td");

fileCell.textContent = job.fileName || "Document";
const fileName = job.fileName || "Document";
fileCell.textContent = fileName;
statusCell.textContent = job.status || "SUBMITTED";
submittedCell.textContent = job.submittedAt || "";
actionsCell.className = "table-actions";
Expand All @@ -153,13 +160,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);
Expand Down
Loading