chore: sync the frontend template from ebea300 to af3d8e6
Carries 359 template commits, tag v0.2.0 plus one documentation commit: the generator-built feature index with its app, bounded-context and feature declarations, the src/platform kernel and scale tooling, the 2026-09-24 src review fixes, and the 2026-09-25 maturity review round with its CHANGELOG [보안]/[계약] rows. 691 of the 824 template paths are applied, 85 of them merged with product changes; 127 are not carried. Product identity is unchanged: name, version 0.1.0, routes, design and the TechLog domain. Three decisions worth naming. TechLog stays composed directly, as the last two syncs recorded; its directory carries a NOT_INSTALLED marker that says so, and every installed-* composer takes the template's projection with TechLog added on top. The reference sample is no longer installed: the template now installs a feature only through feature-module.ts and context-routes.ts, which load the screens this product deleted, so its three operations, six schemas and one topic leave the registries, recorded as registry change evidence. And AppRouter mounts the platform and TechLog routes only; the template's bounded-context route gateway waits for a generator-installed feature. Required fixes: readSubject on the BFF session owner (without it every HTTP Studio session would close as integration-failed), zod through the facade in nine TechLog files, noUnusedLocals, and public/config.json written out to match the local profile. Derived baselines were recomputed after reproducing both sides' values: CI contract 101 commands / 106 references / 141 artifacts, gate shape c9adcf85; registry approval 2dc6c3a3; the runtime config schema baseline equals the schema at8210d48. Verified here: types, lint, architecture, adapter inventory, CI contract, i18n, design system, diagnostics, browser security, dev release manifest, TechLog contract and build pass; 220 component, 155 integration, 15 contract, 418 TechLog, 43 reference-feature, 18 recipe and 46 release-coherence tests pass, and 2381 of 2383 unit tests. Reproduced at8210d48first and unchanged: check:registries (byte-identical), test:runtime-schema, verify:documentation. Brought by the template and escalated rather than suppressed: check:request-fanout on TechLog's cursor pagination, check:remediation-ledger (fails upstream too), the shared-chunk hash test, and the registry-dependent sample removal and second-feature tests. Playwright suites were not run. Full record, the five open questions and the follow-ups in docs/operations/template-sync-2026-09-29.md. (cherry picked from commit b2170cf265dea45dc9cc05d3c61e627e97f31cdb)
This commit is contained in:
@@ -7,6 +7,7 @@ import { describe, expect, it, vi } from "vitest";
|
||||
import { deriveAsyncState } from "../../src/application/view-models/async-state.ts";
|
||||
import { AsyncSurface } from "../../src/presentation/components/async-surface.tsx";
|
||||
import { createFailure } from "../../src/contracts/errors.ts";
|
||||
import { AccessSurface } from "../../src/presentation/design-system/index.ts";
|
||||
|
||||
describe("async UI state matrix", () => {
|
||||
it.each([
|
||||
@@ -14,6 +15,7 @@ describe("async UI state matrix", () => {
|
||||
[{ data: [{ id: "1" }] }, "success"],
|
||||
[{ data: [] }, "empty"],
|
||||
[{ data: null }, "empty"],
|
||||
[{}, "idle"],
|
||||
[
|
||||
{ failure: createFailure("SERVER_FAILURE", "LIST", 0) },
|
||||
"terminal-error",
|
||||
@@ -52,10 +54,11 @@ describe("async UI state matrix", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("renders unknown mutation effects with reconciliation-only actions", async () => {
|
||||
it("renders unknown mutation effects with confirm-applied and resend only", async () => {
|
||||
const user = userEvent.setup();
|
||||
const retry = vi.fn();
|
||||
const reconcile = vi.fn();
|
||||
const resend = vi.fn();
|
||||
const state = deriveAsyncState({
|
||||
data: ["value"],
|
||||
hasMutationEffectUnknown: true,
|
||||
@@ -66,6 +69,7 @@ describe("async UI state matrix", () => {
|
||||
state={state}
|
||||
onRetry={retry}
|
||||
onReconcileUnknownEffect={reconcile}
|
||||
onResendUnknownEffect={resend}
|
||||
>
|
||||
existing content
|
||||
</AsyncSurface>,
|
||||
@@ -80,12 +84,15 @@ describe("async UI state matrix", () => {
|
||||
expect(
|
||||
screen.queryByRole("button", { name: "다시 시도" }),
|
||||
).not.toBeInTheDocument();
|
||||
expect(
|
||||
screen.queryByRole("button", { name: "변경되지 않음으로 확인" }),
|
||||
).not.toBeInTheDocument();
|
||||
await user.click(screen.getByRole("button", { name: "변경됨으로 확인" }));
|
||||
await user.click(
|
||||
screen.getByRole("button", { name: "변경되지 않음으로 확인" }),
|
||||
screen.getByRole("button", { name: "같은 요청으로 다시 보내기" }),
|
||||
);
|
||||
expect(reconcile).toHaveBeenNthCalledWith(1, "APPLIED");
|
||||
expect(reconcile).toHaveBeenNthCalledWith(2, "NOT_APPLIED");
|
||||
expect(reconcile).toHaveBeenCalledExactlyOnceWith("APPLIED");
|
||||
expect(resend).toHaveBeenCalledOnce();
|
||||
expect(retry).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -132,6 +139,17 @@ describe("async UI state matrix", () => {
|
||||
expect(resolveConflict).toHaveBeenCalledOnce();
|
||||
});
|
||||
|
||||
// 08-07. The id a user quotes when asking for help is the one the request
|
||||
// diagnostics carry as `correlation_id`.
|
||||
it("shows the failure's request id as its support reference", () => {
|
||||
const failure = {
|
||||
...createFailure("SERVER_FAILURE", "LIST", 1),
|
||||
requestId: "req-7f3a",
|
||||
};
|
||||
render(<AsyncSurface state={deriveAsyncState({ failure })} />);
|
||||
expect(screen.getByRole("alert")).toHaveTextContent("지원 참조: req-7f3a");
|
||||
});
|
||||
|
||||
it("renders only safe error vocabulary", () => {
|
||||
const failure = createFailure("SERVER_FAILURE", "LIST", 0, {
|
||||
code: "SERVER_FAILURE",
|
||||
@@ -186,6 +204,71 @@ describe("async UI state matrix", () => {
|
||||
expect(action).toHaveBeenCalledOnce();
|
||||
});
|
||||
|
||||
it("renders an idle query as neither loading nor empty", () => {
|
||||
const { container, rerender } = render(
|
||||
<AsyncSurface state={deriveAsyncState({})}>content</AsyncSurface>,
|
||||
);
|
||||
expect(container).toBeEmptyDOMElement();
|
||||
|
||||
rerender(
|
||||
<AsyncSurface
|
||||
state={deriveAsyncState({})}
|
||||
idle={<p>조건을 먼저 선택하세요.</p>}
|
||||
>
|
||||
content
|
||||
</AsyncSurface>,
|
||||
);
|
||||
expect(screen.getByText("조건을 먼저 선택하세요.")).toBeVisible();
|
||||
expect(container.querySelector("[aria-busy]")).toBeNull();
|
||||
expect(screen.queryByText("표시할 항목이 없습니다.")).toBeNull();
|
||||
expect(screen.queryByText("content")).toBeNull();
|
||||
});
|
||||
|
||||
it("still renders loading for a first load and the empty copy for an empty result", () => {
|
||||
const { container, rerender } = render(
|
||||
<AsyncSurface state={deriveAsyncState({ isInitialLoading: true })} />,
|
||||
);
|
||||
expect(container.querySelector('[aria-busy="true"]')).not.toBeNull();
|
||||
|
||||
rerender(<AsyncSurface state={deriveAsyncState({ data: [] })} />);
|
||||
expect(screen.getByText("표시할 항목이 없습니다.")).toBeVisible();
|
||||
});
|
||||
|
||||
// 08-11. A query failure and the gallery draw one access set, not two.
|
||||
it.each([
|
||||
["AUTH_REQUIRED", "auth-required"],
|
||||
["FORBIDDEN", "forbidden"],
|
||||
["NOT_FOUND", "not-found"],
|
||||
] as const)(
|
||||
"renders a %s query failure with the gallery's access surface",
|
||||
async (kind, accessKind) => {
|
||||
const user = userEvent.setup();
|
||||
const action = vi.fn();
|
||||
const failure = createFailure(kind, "LIST", 0);
|
||||
const gallery = render(
|
||||
<AccessSurface kind={accessKind} onAction={() => {}} />,
|
||||
);
|
||||
const expected = gallery.container.querySelector(".state-surface");
|
||||
expect(expected).not.toBeNull();
|
||||
const expectedText = expected?.textContent;
|
||||
gallery.unmount();
|
||||
|
||||
render(
|
||||
<AsyncSurface
|
||||
state={deriveAsyncState({ failure })}
|
||||
onAction={action}
|
||||
/>,
|
||||
);
|
||||
const alert = screen.getByRole("alert");
|
||||
expect(alert).toHaveAttribute("data-message-key", failure.userMessageKey);
|
||||
expect(alert.querySelector(".state-surface")?.textContent).toBe(
|
||||
expectedText,
|
||||
);
|
||||
await user.click(screen.getByRole("button"));
|
||||
expect(action).toHaveBeenCalledOnce();
|
||||
},
|
||||
);
|
||||
|
||||
it("does not retain a terminal error after usable data is restored", () => {
|
||||
const failed = deriveAsyncState({
|
||||
failure: createFailure("SERVER_FAILURE", "LIST", 0),
|
||||
|
||||
Reference in New Issue
Block a user