fix(home): 홈이 StandardPage와 LinkButton을 쓴다
홈(`src/presentation/pages/home-page.tsx`)이 페이지 템플릿 대신 자기 `section.ui-page`와 `PageHeader`를 쓰고, 시작 링크를 `<Link className="ui-button …">`으로 `LinkButton`을 손으로 다시 만든다. `PRODUCT.md`는 홈이 파생 서비스에 남는다고 적는다. 그래서 그대로 복제되고 개발자가 따라 하는 예가 된다. `LinkButton`의 variant·size가 바뀌면 홈만 어긋난다. 고른 방법: `StandardPage`(heading 슬롯에 eyebrow·제목·설명)와 `LinkButton variant="primary"/"secondary"`로 바꾼다. 준비 목록, 런타임 요약, 시작 링크는 템플릿의 본문 자리에 `home-page__sections`(블록 사이 `--space-6`)로 묶어 둔다. 템플릿 본문 자리에는 간격이 없어, 묶지 않으면 런타임 요약이 카드에 붙는다(첫 골든에서 보고 고쳤다). component 시험이 홈의 링크가 standard 템플릿 안의 `ui-button ui-button--primary`인지 본다. 위험·한계: 머리말과 본문 사이는 템플릿 간격(`--space-5`)이라 홈의 세로 간격이 조금 바뀐다. 시각 골든은 이 커밋에서 다시 찍고 이유를 PR 본문에 적는다. 홈이 템플릿과 `LinkButton`을 쓰면서 번들러가 청크 둘을 합쳤다. 초기 JS는 파일 17 → 15개, gzip 194,397 → 194,143 B, Service Worker precache 자산은 24 → 22개다. `config/scale/feature-shape-ceilings.json`은 측정 스크립트 (`node scripts/scale/measure-feature-shape-growth.ts --initial-baseline --write`, desktop)가 쓴 그대로다. 검증: `tests/component/starter-pages.test.tsx`와 시각 골든은 desktop에서 돌린다(PR 본문). Refs: 1112/04-06
This commit is contained in:
@@ -45,14 +45,14 @@
|
||||
}
|
||||
],
|
||||
"initialJavascript": {
|
||||
"gzipBytes": 194354,
|
||||
"files": 17,
|
||||
"firstFeatureGzipBytes": 6355,
|
||||
"perFeatureGzipBytes": 528,
|
||||
"perContextGzipBytes": 21
|
||||
"gzipBytes": 194143,
|
||||
"files": 15,
|
||||
"firstFeatureGzipBytes": 6192,
|
||||
"perFeatureGzipBytes": 521,
|
||||
"perContextGzipBytes": 28
|
||||
},
|
||||
"serviceWorkerPrecache": {
|
||||
"assets": 24,
|
||||
"assets": 22,
|
||||
"firstFeatureAssets": 14,
|
||||
"perFeatureAssets": 12,
|
||||
"perContextAssets": 0
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
import { PageHeader } from "../design-system/index.ts";
|
||||
import { LinkButton, StandardPage } from "../design-system/index.ts";
|
||||
import { useLocale } from "../i18n/index.ts";
|
||||
import { useApplicationRuntime } from "../providers/application-provider.tsx";
|
||||
import { activeNavigationRoutes } from "../routes/navigation-policy.ts";
|
||||
@@ -47,53 +46,54 @@ export default function HomePage() {
|
||||
}, [runtime]);
|
||||
|
||||
return (
|
||||
<section className="ui-page">
|
||||
<PageHeader
|
||||
eyebrow={message("home.eyebrow")}
|
||||
title={message("route.APP_HOME.title")}
|
||||
description={message("home.description")}
|
||||
/>
|
||||
<div className="readiness-grid" role="group" aria-label={message("home.readiness")}>
|
||||
{READINESS_ITEMS.map((item) => (
|
||||
<article className="ui-panel" key={item}>
|
||||
<h2>{message(`home.readiness.${item}.title`)}</h2>
|
||||
<p>{message(`home.readiness.${item}.description`)}</p>
|
||||
</article>
|
||||
))}
|
||||
<StandardPage
|
||||
heading={{
|
||||
eyebrow: message("home.eyebrow"),
|
||||
title: message("route.APP_HOME.title"),
|
||||
description: message("home.description"),
|
||||
}}
|
||||
>
|
||||
<div className="home-page__sections">
|
||||
<div className="readiness-grid" role="group" aria-label={message("home.readiness")}>
|
||||
{READINESS_ITEMS.map((item) => (
|
||||
<article className="ui-panel" key={item}>
|
||||
<h2>{message(`home.readiness.${item}.title`)}</h2>
|
||||
<p>{message(`home.readiness.${item}.description`)}</p>
|
||||
</article>
|
||||
))}
|
||||
</div>
|
||||
<p className="ui-runtime-summary" aria-live="polite">
|
||||
{release === "failed"
|
||||
? message("home.runtime.failed")
|
||||
: release
|
||||
? message("home.runtime.summary", {
|
||||
buildId: release.buildId,
|
||||
releaseId: release.releaseId,
|
||||
})
|
||||
: message("home.runtime.checking")}
|
||||
</p>
|
||||
{starterRoutes.length > 0 ? (
|
||||
<section className="ui-panel starter-actions" aria-labelledby="starter-title">
|
||||
<div>
|
||||
<h2 id="starter-title">{message("home.starter.title")}</h2>
|
||||
<p>{message("home.starter.description")}</p>
|
||||
</div>
|
||||
<div className="button-row">
|
||||
{starterRoutes.map((route, index) => (
|
||||
<LinkButton
|
||||
key={route.routeId}
|
||||
to={route.path}
|
||||
variant={index === 0 ? "primary" : "secondary"}
|
||||
>
|
||||
{message("home.starter.open", {
|
||||
title: resolve(`route.${route.routeId}.navigation`),
|
||||
})}
|
||||
</LinkButton>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
) : null}
|
||||
</div>
|
||||
<p className="ui-runtime-summary" aria-live="polite">
|
||||
{release === "failed"
|
||||
? message("home.runtime.failed")
|
||||
: release
|
||||
? message("home.runtime.summary", {
|
||||
buildId: release.buildId,
|
||||
releaseId: release.releaseId,
|
||||
})
|
||||
: message("home.runtime.checking")}
|
||||
</p>
|
||||
{starterRoutes.length > 0 ? (
|
||||
<section className="ui-panel starter-actions" aria-labelledby="starter-title">
|
||||
<div>
|
||||
<h2 id="starter-title">{message("home.starter.title")}</h2>
|
||||
<p>{message("home.starter.description")}</p>
|
||||
</div>
|
||||
<div className="button-row">
|
||||
{starterRoutes.map((route, index) => (
|
||||
<Link
|
||||
key={route.routeId}
|
||||
className={
|
||||
index === 0 ? "ui-button" : "ui-button ui-button--secondary"
|
||||
}
|
||||
to={route.path}
|
||||
>
|
||||
{message("home.starter.open", {
|
||||
title: resolve(`route.${route.routeId}.navigation`),
|
||||
})}
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
) : null}
|
||||
</section>
|
||||
</StandardPage>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
@layer components {
|
||||
/* The home page's blocks below the template heading, a page gap apart. */
|
||||
.home-page__sections {
|
||||
display: grid;
|
||||
min-width: 0;
|
||||
gap: var(--space-6);
|
||||
}
|
||||
|
||||
.readiness-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
|
||||
@@ -45,6 +45,17 @@ describe("starter home page", () => {
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
// 1112/04-06. The home page a product keeps is an example of the page
|
||||
// templates and primitives, not of hand-made copies of them.
|
||||
it("lays the home page out with the standard template and link buttons", async () => {
|
||||
const { container } = renderApp("/");
|
||||
|
||||
const action = await screen.findByRole("link", { name: "플랫폼 구성 보기" });
|
||||
expect(action.closest("article.page-template--standard")).not.toBeNull();
|
||||
expect(action).toHaveClass("ui-button", "ui-button--primary");
|
||||
expect(container.querySelectorAll("section.ui-page")).toHaveLength(0);
|
||||
});
|
||||
|
||||
it("reaches the platform overview from the starter actions", async () => {
|
||||
const user = userEvent.setup();
|
||||
renderApp("/");
|
||||
|
||||
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 71 KiB |
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 92 KiB |
Reference in New Issue
Block a user