refactor: simplify primary workflows

This commit is contained in:
Codex
2026-08-28 18:33:20 +09:00
parent 6e5bd512b9
commit 35c33e360e
5 changed files with 756 additions and 126 deletions
+68
View File
@@ -36,6 +36,33 @@ async function digestHex(blob) {
return [...new Uint8Array(digest)].map((value) => value.toString(16).padStart(2, "0")).join("");
}
test("시작 화면과 Dataset Builder가 작업 우선순위 및 390px 레이아웃을 유지한다", async () => {
const landingFrame = document.createElement("iframe");
landingFrame.src = "/";
landingFrame.style.cssText = "position:fixed;left:-20000px;top:0;width:390px;height:900px;border:0";
document.body.append(landingFrame);
await new Promise((resolve, reject) => {
landingFrame.addEventListener("load", resolve, { once: true });
landingFrame.addEventListener("error", () => reject(new Error("Landing iframe load failed")), { once: true });
});
try {
const landingDocument = landingFrame.contentDocument;
const launchers = [...landingDocument.querySelectorAll(".launcher-card")];
assertEqual(launchers.length, 2, "landing exposes only two primary tasks");
assert(launchers[0].textContent.includes("Acoustic Camera"), "analysis is the first landing task");
assert(launchers[1].textContent.includes("Dataset Builder"), "scene authoring is the second landing task");
assert(!landingDocument.querySelector(".workflow-disclosure").open, "file workflow starts collapsed");
assert(!landingDocument.querySelector('a[href="/docs/execution-plan.md"]'), "developer plan is absent from landing");
assert(
landingDocument.documentElement.scrollWidth <= landingDocument.documentElement.clientWidth + 1,
"landing has no horizontal overflow at 390px",
);
} finally {
landingFrame.remove();
}
});
test("Dataset Builder 전체 저장·재연결 흐름이 동일한 scene과 preview WAV를 재현한다", async () => {
const frame = document.createElement("iframe");
frame.src = "/apps/dataset-builder/?integration-test=1";
@@ -61,6 +88,47 @@ test("Dataset Builder 전체 저장·재연결 흐름이 동일한 scene과 prev
await waitFor(() => documentObject.documentElement.dataset.appReady === "true", "Builder 초기화");
await waitFor(() => documentObject.documentElement.dataset.sceneValid === "true", "기본 scene 검증");
assert(documentObject.querySelector("#scene-id").value !== "single-tone", "new default scene gets a unique id");
const workflowSteps = [...documentObject.querySelectorAll("#builder-workflow [data-workflow-step]")];
assertEqual(workflowSteps.length, 4, "four Builder workflow steps are discoverable");
assertEqual(
workflowSteps.map((step) => step.dataset.workflowStep).join(","),
"input,edit,validate,save",
"Builder workflow order",
);
assert(!documentObject.querySelector(".header-more").open, "secondary export actions start collapsed");
assert(!documentObject.querySelector(".inline-disclosure").open, "advanced scene settings start collapsed");
assert(
[...documentObject.querySelectorAll(".disclosure-section")].every((section) => !section.open),
"optional plane and ambient settings start collapsed",
);
assert(
documentObject.querySelector("#source-editor-section").compareDocumentPosition(
documentObject.querySelector("#scene-name").closest(".control-section"),
) & windowObject.Node.DOCUMENT_POSITION_FOLLOWING,
"selected source editor precedes scene metadata",
);
assert(
documentObject.querySelector("#scene-canvas").getBoundingClientRect().height >= 500,
"canvas remains the dominant Builder workspace",
);
frame.style.width = "390px";
await new Promise((resolve) => windowObject.requestAnimationFrame(() => windowObject.requestAnimationFrame(resolve)));
assert(
documentObject.documentElement.scrollWidth <= documentObject.documentElement.clientWidth + 1,
"Builder has no horizontal overflow at 390px",
);
const finalWorkflowStep = workflowSteps.at(-1).getBoundingClientRect();
assert(
finalWorkflowStep.right <= documentObject.documentElement.clientWidth + 1,
"all Builder workflow steps remain visible at 390px",
);
assert(
documentObject.querySelector("#scene-canvas").getBoundingClientRect().height >= 350,
"Builder canvas remains usable at 390px",
);
frame.style.width = "1400px";
await new Promise((resolve) => windowObject.requestAnimationFrame(() => windowObject.requestAnimationFrame(resolve)));
const previewSamples = new Float32Array(2000);
for (let index = 0; index < previewSamples.length; index += 1) {