Repository navigation
๐จ Palette: viewer.js ๋น๋๊ธฐ ๋ฒํผ ์ํ ํผ๋๋ฐฑ ๊ฐ์ #477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| sed -i 's/assertTrue(body.contains("\/assets\/viewer\/viewer.js"));/assertTrue(body.contains("type=\\"module\\" src=\\"\/assets\/viewer\/viewer.js\\""));/g' src/test/java/com/clearfolio/viewer/controller/ViewerUiControllerTest.java | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| sed -i 's/assertTrue(body.contains("\/assets\/viewer\/viewer.js"));/assertTrue(body.contains("type=\\"module\\" src=\\"\/assets\/viewer\/viewer.js\\""));/g' src/test/java/com/clearfolio/viewer/controller/ViewerUiControllerTest.java |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,8 @@ const DEMO_AUTH_HEADERS = { | |
| "X-Clearfolio-Permissions": "job:read,viewer:read", | ||
| }; | ||
|
|
||
| import { setBusyState } from "./dom-utils.js"; | ||
|
|
||
| const el = { | ||
| docMeta: document.getElementById("doc-meta"), | ||
| liveStatus: document.getElementById("live-status"), | ||
|
|
@@ -19,6 +21,7 @@ const el = { | |
| }; | ||
|
|
||
| let pdfJsModulePromise; | ||
| let restoreRetryBtn = null; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ๐ฉบ Stability & Availability | ๐ Major | โก Quick win
์์ ์์ function setLoading(message) {
el.error.hidden = true;
el.liveStatus.textContent = message;
el.preview.setAttribute("aria-busy", "true");
- restoreRetryBtn = setBusyState(el.retryBtn, "Refreshing...");
+ if (restoreRetryBtn === null) {
+ restoreRetryBtn = setBusyState(el.retryBtn, "Refreshing...");
+ }
}Also applies to: 56-60, 69-72, 280-283 ๐ค Prompt for AI Agents |
||
|
|
||
| function getMetaContent(name) { | ||
| const meta = document.querySelector(`meta[name="${name}"]`); | ||
|
|
@@ -54,8 +57,7 @@ function setLoading(message) { | |
| el.error.hidden = true; | ||
| el.liveStatus.textContent = message; | ||
| el.preview.setAttribute("aria-busy", "true"); | ||
| el.retryBtn.disabled = true; | ||
| el.retryBtn.textContent = "Refreshing..."; | ||
| restoreRetryBtn = setBusyState(el.retryBtn, "Refreshing..."); | ||
| } | ||
|
|
||
| function showError(message) { | ||
|
|
@@ -64,8 +66,10 @@ function showError(message) { | |
| el.liveStatus.textContent = ""; | ||
| el.preview.setAttribute("aria-busy", "false"); | ||
| el.errorTitle.focus(); | ||
| el.retryBtn.disabled = false; | ||
| el.retryBtn.textContent = "Refresh"; | ||
| if (restoreRetryBtn) { | ||
| restoreRetryBtn(); | ||
| restoreRetryBtn = null; | ||
| } | ||
| } | ||
|
|
||
| function clearPreview() { | ||
|
|
@@ -273,8 +277,10 @@ async function poll(docId, abortSignal) { | |
|
|
||
| el.preview.setAttribute("aria-busy", "false"); | ||
| el.liveStatus.textContent = "Ready."; | ||
| el.retryBtn.disabled = false; | ||
| el.retryBtn.textContent = "Refresh"; | ||
| if (restoreRetryBtn) { | ||
| restoreRetryBtn(); | ||
| restoreRetryBtn = null; | ||
| } | ||
| } catch (_error) { | ||
| if (abortSignal.aborted) { | ||
| return; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๐ฏ Functional Correctness | ๐ก Minor | โก Quick win
๋ ์นํ ์คํฌ๋ฆฝํธ์ ์ฌ์ ์กฐ๊ฑด ๊ฒ์ฌ๊ฐ ์์ต๋๋ค.
์นํ ๋์์ด 0๊ฑด์ด์ด๋ ๋ ์คํฌ๋ฆฝํธ๊ฐ ์ฑ๊ณต์ผ๋ก ์ข ๋ฃ๋์ด ํ ์คํธ ํ์ผ์ด ๊ฐฑ์ ๋์ง ์์ ์ ์์ต๋๋ค.
replace.sh#L1-L1: ๊ธฐ์กด assertion ์กด์ฌ ์ฌ๋ถ๋ฅผ ํ์ธํ ํ ์นํํ์ธ์.replace_viewer.sh#L1-L1: ๋์ผํ ์ฌ์ ์กฐ๊ฑด ๊ฒ์ฌ์ non-zero ์คํจ ์ฒ๋ฆฌ๋ฅผ ์ถ๊ฐํ์ธ์.๐ Affects 2 files
replace.sh#L1-L1(this comment)replace_viewer.sh#L1-L1๐ค Prompt for AI Agents