From e119eb667a7ef3399ab6217921c433dd039b342e Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 24 Sep 2026 13:32:46 +0900 Subject: [PATCH] fix(bootstrap): show a static boot shell until the first render (Q-6.9-8) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Boot awaits runtime config (5s budget), the release manifest (5s) and contract-set checks before its first render, and #root was empty the whole time with no busy state. index.html now ships a static loading status (role="status", aria-busy="true", the existing state-surface loading class) inside #root; createRoot's first render — the app or the BootErrorShell — replaces it. Verified: tests/component/bootstrap-shell.test.tsx reads index.html (RED before: no busy status) and checks the first React render removes the shell; `pnpm build` keeps the shell in dist/index.html with the render-blocking CSS link. All gates pass; test:reference-feature's production-vertical test timed out once on "로그인 시작" and passed on rerun (timing flake, unrelated file). Co-Authored-By: Claude Opus 5.5 --- index.html | 13 ++++++++- tests/component/bootstrap-shell.test.tsx | 37 +++++++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 047e363e..0ac9c9cc 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,18 @@ Clean Architecture Frontend -
+
+ +
+ 불러오는 중 +
+
diff --git a/tests/component/bootstrap-shell.test.tsx b/tests/component/bootstrap-shell.test.tsx index 2a6f7c29..4fd9d8e6 100644 --- a/tests/component/bootstrap-shell.test.tsx +++ b/tests/component/bootstrap-shell.test.tsx @@ -1,6 +1,9 @@ // @vitest-environment jsdom -import { render, screen } from "@testing-library/react"; +import { readFileSync } from "node:fs"; + +import { act, render, screen } from "@testing-library/react"; +import { createRoot } from "react-dom/client"; import { describe, expect, it } from "vitest"; function TestShell() { @@ -15,3 +18,35 @@ describe("component test level", () => { ); }); }); + +describe("static boot shell (Q-6.9-8)", () => { + function loadIndexBody(): HTMLElement { + const html = readFileSync("index.html", "utf8"); + document.body.innerHTML = new DOMParser() + .parseFromString(html, "text/html") + .body.innerHTML; + const root = document.getElementById("root"); + if (!root) throw new Error("index.html has no #root"); + return root; + } + + it("shows a busy loading status before boot renders anything", () => { + const root = loadIndexBody(); + const status = root.querySelector('[role="status"]'); + expect(status?.getAttribute("aria-busy")).toBe("true"); + expect(status?.textContent?.trim()).not.toBe(""); + }); + + it("is replaced by the first render of the real app", async () => { + const root = loadIndexBody(); + const reactRoot = createRoot(root); + await act(async () => { + reactRoot.render(); + }); + expect(root.querySelector('[aria-busy="true"]')).toBeNull(); + expect(screen.getByRole("main", { name: "application shell" })).toBeTruthy(); + await act(async () => { + reactRoot.unmount(); + }); + }); +});