@@ -16,15 +16,21 @@ import { MarketplaceView } from "./views/MarketplaceView";
1616import { ChangePasswordView } from "./views/ChangePasswordView" ;
1717import { ForgotPasswordView } from "./views/ForgotPasswordView" ;
1818import { SetupWizardView } from "./views/SetupWizardView" ;
19+ import { LedgerView } from "../../../modules/ledger/frontend/LedgerView" ;
1920
2021// ─── Helpers ──────────────────────────────────────────────────
21- const WEB_BOOTSTRAP_MESSAGE = "Fieldstack Web bootstrap initialized" ;
22+
23+ // 코어 라우트 목록 (앱 shell 없이 전체 화면으로 렌더되는 것 제외)
24+ const CORE_ROUTES = [ "login" , "forgot-password" , "home" , "marketplace" , "admin" , "change-password" ] as const ;
25+ // 모듈 라우트 — module.json name 기준 (서버 레지스트리와 일치)
26+ const MODULE_ROUTES : string [ ] = [ "ledger" ] ;
2227
2328function getRouteFromHash ( rawHash : string ) : RouteKey {
2429 const hash = rawHash . replace ( "#" , "" ) ;
2530 if ( hash === "settings" ) return "home" ;
26- const valid : RouteKey [ ] = [ "login" , "forgot-password" , "home" , "marketplace" , "admin" , "change-password" ] ;
27- return ( valid as string [ ] ) . includes ( hash ) ? ( hash as RouteKey ) : "login" ;
31+ if ( ( CORE_ROUTES as readonly string [ ] ) . includes ( hash ) ) return hash as RouteKey ;
32+ if ( MODULE_ROUTES . includes ( hash ) ) return hash as RouteKey ;
33+ return "login" ;
2834}
2935
3036// ─── Theme ────────────────────────────────────────────────────
@@ -63,16 +69,15 @@ const SS = {
6369} as const ;
6470
6571const LS = {
66- theme : "fs_theme" ,
6772 firstVisitShown : "fs_first_visit_shown" ,
6873 startupRoute : "fs_startup_route" ,
6974} as const ;
7075
71- // 딥 링크: 비인증 상태에서 진입한 app route 반환
76+ // 딥 링크: 비인증 상태에서 진입한 app route 반환 (모듈 라우트 포함)
7277function getDeepLinkTarget ( ) : RouteKey | null {
7378 const hash = window . location . hash . replace ( "#" , "" ) ;
74- const appRoutes : RouteKey [ ] = [ "home" , "marketplace" , "admin" ] ;
75- return ( appRoutes as string [ ] ) . includes ( hash ) ? ( hash as RouteKey ) : null ;
79+ const appRoutes : string [ ] = [ "home" , "marketplace" , "admin" , ... MODULE_ROUTES ] ;
80+ return appRoutes . includes ( hash ) ? ( hash as RouteKey ) : null ;
7681}
7782
7883// 개인화: 로그인 후 첫 화면 설정
@@ -469,6 +474,8 @@ function App() {
469474 onRequestPin = { ( ) => setIsPinModalOpen ( true ) }
470475 />
471476 ) }
477+ { /* ── 모듈 뷰 ────────────────────────────────────── */ }
478+ { effectiveRoute === "ledger" && < LedgerView /> }
472479 { isSettingsOpen && (
473480 < SettingsView
474481 theme = { theme }
@@ -533,7 +540,7 @@ function AppRoot() {
533540}
534541
535542// ─── Bootstrap ────────────────────────────────────────────────
536- console . log ( WEB_BOOTSTRAP_MESSAGE ) ;
543+ console . log ( "Fieldstack Web bootstrap initialized" ) ;
537544
538545const appRootElement = document . querySelector < HTMLDivElement > ( "#app" ) ;
539546if ( appRootElement === null ) {
0 commit comments