diff --git a/docs/styling/design-system-platform.md b/docs/styling/design-system-platform.md
index 48f16cfd..0f25b452 100644
--- a/docs/styling/design-system-platform.md
+++ b/docs/styling/design-system-platform.md
@@ -306,8 +306,8 @@ Pattern은 여러 primitive를 조합해 반복되는 사용자 문제를 해결
| Pattern | 필수 내용 |
| --- | --- |
-| `AsyncSurface` | loading, success, empty, terminal error, stale, refresh |
-| `AccessSurface` | auth required, forbidden, not found |
+| `AsyncSurface` | loading, success, empty, terminal error, stale, refresh. 조회 실패가 `AUTH_REQUIRED`·`FORBIDDEN`·`NOT_FOUND`이면 `AccessSurface`와 같은 화면(`state-surfaces.tsx`)을 그린다(`async-surface.tsx`의 `ACCESS_SURFACES`) |
+| `AccessSurface` | auth required, forbidden, not found. 조회 실패와 갤러리가 이 한 벌을 쓴다 |
| `Form` | submit, error summary, first-invalid focus, pending |
| `ConfirmationDialog` | destructive action 설명과 명시적 확인 |
| `ToastRegion` | queue, announcement, dismiss, focus policy |
diff --git a/src/presentation/components/async-surface.tsx b/src/presentation/components/async-surface.tsx
index 74ab5536..834fd8a9 100644
--- a/src/presentation/components/async-surface.tsx
+++ b/src/presentation/components/async-surface.tsx
@@ -4,6 +4,11 @@ import type { AsyncState } from "../../application/view-models/async-state.ts";
import type { AppFailure } from "../../contracts/errors.ts";
import { useLocale } from "../i18n/index.ts";
import { errorMessage } from "./error-copy.ts";
+import {
+ AuthRequiredSurface,
+ ForbiddenSurface,
+ NotFoundSurface,
+} from "./state-surfaces.tsx";
import { Button } from "./ui/button.ts";
export function LoadingSurface({
@@ -131,6 +136,23 @@ export function AsyncSurface({
if (state.base === "initial-loading") return
+ {message("template.supportReference", { + reference: state.failure.requestId, + })} +
+ ) : null} +{eyebrow}
{description}
- {actionLabel ? : null} + {actionLabel && onAction ? ( + + ) : null} ); } diff --git a/tests/component/async-surface.test.tsx b/tests/component/async-surface.test.tsx index 9bf6b36d..558cb74c 100644 --- a/tests/component/async-surface.test.tsx +++ b/tests/component/async-surface.test.tsx @@ -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([ @@ -233,6 +234,41 @@ describe("async UI state matrix", () => { 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( +