From f849d781d141859d9187842be2aeb8f3397491f5 Mon Sep 17 00:00:00 2001
From: DongHyeonka
Date: Thu, 5 Nov 2026 22:31:39 +0900
Subject: [PATCH] =?UTF-8?q?fix(home):=20=ED=99=88=20=EC=8B=9C=EC=9E=91=20?=
=?UTF-8?q?=EB=A7=81=ED=81=AC=EA=B0=80=20=EB=9F=B0=ED=83=80=EC=9E=84?=
=?UTF-8?q?=EC=97=90=20=EA=BA=BC=EC=A7=84=20=EA=B8=B0=EB=8A=A5=EC=9D=84=20?=
=?UTF-8?q?=EA=B3=A0=EB=A5=B4=EC=A7=80=20=EC=95=8A=EB=8A=94=EB=8B=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
문제
home-page.tsx의 STARTER_ROUTES는 모듈을 불러올 때 NAVIGATION_ROUTES에서
APP_HOME을 빼고 앞 3개를 고른다. 기능이 켜져 있는지는 보지 않는다. 셸 탐색은
같은 목록을 runtime.isFeatureActive(owner)로 거르고, 라우터는 꺼진 기능의
라우트에 사용 중지 화면을 그린다. 그래서 운영자가 런타임 설정으로
platform-examples-feature를 끄면 홈의 주요 버튼 셋 중 둘(/examples/ui,
/examples/states)이 사용 중지 화면으로 간다(리뷰 08-R1 C, 1103/09-04 수정
b96d61d8이 만듦).
고른 방법
셸과 홈이 같은 함수를 쓴다. navigation-policy.ts에 activeNavigationRoutes
(isFeatureActive)를 두고(설치된 레지스트리를 읽어도 되는 기존 예외 파일이다),
셸 탐색과 홈 시작 링크가 렌더 때 그 목록을 읽는다. 홈은 그 뒤에 APP_HOME을 빼고
앞 3개를 고른다. 홈은 여전히 기능 라우트를 이름으로 부르지 않는다(1103/09-04의
보존 조건). 테스트는 platform-examples-feature 테스트 폴더에 두어 기능을 지울 때
함께 지워진다.
버린 대안
홈에서만 같은 filter를 한 번 더 쓴다: 셸과 홈의 조건이 다시 갈라질 수 있다.
위험·한계
빌드에서 뺀 기능은 처음부터 목록에 없으므로 해당 없다. 시작 링크가 셋보다 적을
수 있다(템플릿에서 예제를 끄면 둘).
검증
desktop batch에서 확인:
node scripts/run-vitest.ts run tests/features/platform-examples-feature/example-pages.test.tsx
tests/component/product-feature-switch.test.tsx tests/component/starter-pages.test.tsx
tests/unit/navigation-policy.test.ts
Refs: 1105/08-03
---
src/presentation/layouts/app-shell.tsx | 14 +++----
src/presentation/pages/home-page.tsx | 28 ++++++-------
src/presentation/routes/navigation-policy.ts | 21 +++++++++-
.../example-pages.test.tsx | 39 ++++++++++++++++++-
4 files changed, 78 insertions(+), 24 deletions(-)
diff --git a/src/presentation/layouts/app-shell.tsx b/src/presentation/layouts/app-shell.tsx
index 1c698e2e..bf59bebe 100644
--- a/src/presentation/layouts/app-shell.tsx
+++ b/src/presentation/layouts/app-shell.tsx
@@ -3,11 +3,7 @@ import { NavLink, Outlet, useLocation } from "react-router-dom";
import type { SessionState } from "../../application/ports/in/application-api.ts";
import { normalizeColorSchemePreference } from "../../application/policies/color-scheme.ts";
-import {
- NAVIGATION_ROUTES,
- ROUTE_FEATURE_OWNER,
- routePath,
-} from "../../features/installed-feature-contracts.ts";
+import { routePath } from "../../features/installed-feature-contracts.ts";
import {
Button,
Drawer,
@@ -26,6 +22,7 @@ import {
useSessionAction,
} from "../providers/session-provider.tsx";
import { useTheme } from "../providers/theme-provider.tsx";
+import { activeNavigationRoutes } from "../routes/navigation-policy.ts";
const SESSION_MESSAGE_KEYS = Object.freeze({
authenticated: "shell.session.authenticated",
@@ -196,10 +193,9 @@ function PrimaryNavigation({
const runtime = useApplicationRuntime();
// §3.5. A feature the runtime document disabled does not advertise itself.
// The router refuses its routes too, so this is presentation, not the switch.
- const routes = NAVIGATION_ROUTES.filter((definition) => {
- const owner = ROUTE_FEATURE_OWNER[definition.routeId];
- return owner === undefined || runtime.isFeatureActive(owner);
- });
+ const routes = activeNavigationRoutes((featureId) =>
+ runtime.isFeatureActive(featureId),
+ );
return (