feat: drive public domain vestibules from validated manifests

This commit is contained in:
冰朔 2026-08-10 05:28:30 +08:00
commit 2c50b28557
7 changed files with 297 additions and 40 deletions

View file

@ -1,6 +1,7 @@
import { useEffect, useState } from 'react';
import { getPublicDomainVestibule, type DomainRouteId } from '../public-domain-directory';
type DomainId = 'main' | 'sub' | 'zero' | 'zero-sense';
type DomainId = Exclude<DomainRouteId, 'fifth'>;
interface DomainEntry {
id: DomainId;
@ -92,15 +93,15 @@ export function DomainSurface({ activeDomain, educationSelected = false, onOpenS
const entry = registry?.domains.find(domain => domain.id === activeDomain);
const liveReadOnly = entry?.live?.access_state === 'ONLINE_READ_ONLY';
const fallbackName = activeDomain === 'main' ? '光湖主域' : activeDomain === 'sub' ? '光湖分域' : activeDomain === 'zero' ? '光湖零域' : '光湖零感域';
const publicVestibule = getPublicDomainVestibule(activeDomain);
return (
<main className="domain-surface">
<header className="domain-surface-header">
<div>
<small>{entry?.number || '企业四域公共入口'}</small>
<h1>{educationSelected ? '教育行业' : entry?.name || fallbackName}</h1>
<p>{educationSelected ? '光湖分域中的首个行业原型。模块进入个人频道后仍由个人服务器承载数据。' : entry?.responsibility || '读取企业灯塔后显示当前域职责与入口状态。'}</p>
<small>{entry?.number || publicVestibule.hldpNumber}</small>
<h1>{educationSelected ? '教育行业' : entry?.name || publicVestibule.displayName}</h1>
<p>{educationSelected ? '光湖分域中的首个行业原型。模块进入个人频道后仍由个人服务器承载数据。' : entry?.responsibility || publicVestibule.responsibility}</p>
</div>
<div className={`domain-connection ${registry?.verified ? 'online' : ''}`}>
<span aria-hidden="true" />

View file

@ -1,7 +1,6 @@
import { useState } from 'react';
import { Crosshair, DoorOpen, Landmark, Link2, LogIn, ShieldCheck } from 'lucide-react';
type DomainId = 'main' | 'sub' | 'zero' | 'zero-sense' | 'fifth';
import { getPublicDomainVestibule, publicDomainDirectory, type DomainRouteId } from '../public-domain-directory';
interface Props {
access: { blockers: string[]; runtimeReady: boolean; stage: 'checking' | 'login-required' | 'identity-verified' | 'runtime-ready' };
@ -10,19 +9,12 @@ interface Props {
onOpenConnection: () => void;
}
const domains: Array<{ id: DomainId; number: string; name: string; summary: string }> = [
{ id: 'main', number: '01', name: '光湖主域', summary: '公共产品事实、发布与公告入口' },
{ id: 'sub', number: '02', name: '光湖分域', summary: '行业入口与初始化频道目录' },
{ id: 'zero', number: '03', name: '光湖零域', summary: '实验、模块试装与质量验证入口' },
{ id: 'zero-sense', number: '04', name: '光湖零感域', summary: '治理、审批、回滚与审计入口' },
{ id: 'fifth', number: '05', name: '第五域 · 光湖本源域', summary: '零点原核的工程本体 · 语言架构层' },
];
export function WorldEntry({ access, onEnterFifthRuntime, onEnterLocalWorkspace, onOpenConnection }: Props) {
const [stage, setStage] = useState<'lighthouse' | 'directory' | 'fifth'>('lighthouse');
const [selectedDomain, setSelectedDomain] = useState<DomainId | null>(null);
const [selectedDomain, setSelectedDomain] = useState<DomainRouteId | null>(null);
const selectedVestibule = selectedDomain ? getPublicDomainVestibule(selectedDomain) : null;
const selectDomain = (id: DomainId) => {
const selectDomain = (id: DomainRouteId) => {
setSelectedDomain(id);
if (id === 'fifth') setStage('fifth');
};
@ -40,15 +32,15 @@ export function WorldEntry({ access, onEnterFifthRuntime, onEnterLocalWorkspace,
</header>
<nav className="fifth-domain-rail" aria-label="五域公开导航">
{domains.map(domain => (
{publicDomainDirectory.map(domain => (
<button
key={domain.id}
key={domain.routeId}
type="button"
className={domain.id === 'fifth' ? 'selected' : ''}
onClick={() => domain.id === 'fifth' ? undefined : (setStage('directory'), setSelectedDomain(domain.id))}
className={domain.routeId === 'fifth' ? 'selected' : ''}
onClick={() => domain.routeId === 'fifth' ? undefined : (setStage('directory'), setSelectedDomain(domain.routeId))}
>
<span>{domain.number}</span>
<strong>{domain.name}</strong>
<span>{domain.directoryNumber}</span>
<strong>{domain.displayName}</strong>
</button>
))}
</nav>
@ -95,20 +87,28 @@ export function WorldEntry({ access, onEnterFifthRuntime, onEnterLocalWorkspace,
</section>
<nav className="public-domain-strip" aria-label="五域公开门厅">
{domains.map(domain => (
{publicDomainDirectory.map(domain => (
<button
key={domain.id}
key={domain.routeId}
type="button"
className={selectedDomain === domain.id ? 'selected' : ''}
onClick={() => selectDomain(domain.id)}
className={selectedDomain === domain.routeId ? 'selected' : ''}
onClick={() => selectDomain(domain.routeId)}
>
<span>{domain.number}</span>
<strong>{domain.name}</strong>
{stage === 'directory' && <small>{domain.summary}</small>}
<span>{domain.directoryNumber}</span>
<strong>{domain.displayName}</strong>
{stage === 'directory' && <small>{domain.publicSummary}</small>}
</button>
))}
</nav>
{stage === 'directory' && selectedVestibule && (
<aside className="public-vestibule-fact" aria-live="polite">
<strong>{selectedVestibule.stableDomainId}</strong>
<span>{selectedVestibule.themeLabel}</span>
<small> · </small>
</aside>
)}
<footer className="public-entry-footer"></footer>
</main>
);