From b83c5752798870110f833130327c00c3402aef8c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=86=B0=E6=9C=94?= <565183519@qq.com>
Date: Sun, 16 Aug 2026 21:41:10 +0800
Subject: [PATCH] feat(ui): add per-entry world welcome projection
---
.../scripts/domain-number-routing.test.mjs | 3 ++
.../hololake-native-desktop/src/main.tsx | 29 ++++++++++++++++++-
.../hololake-native-desktop/src/styles.css | 1 +
3 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/product-source/hololake-native-desktop/scripts/domain-number-routing.test.mjs b/product-source/hololake-native-desktop/scripts/domain-number-routing.test.mjs
index 6f45355a5..6e9e62c87 100644
--- a/product-source/hololake-native-desktop/scripts/domain-number-routing.test.mjs
+++ b/product-source/hololake-native-desktop/scripts/domain-number-routing.test.mjs
@@ -38,6 +38,9 @@ test('the public shell shows five domains and login is domain-routed', () => {
assert.match(frontend, /setActiveDomainInfo\(gate\.domain\)/)
assert.match(frontend, /event\.key !== 'Escape'/)
assert.match(frontend, /编号 \{zeroPoint\?\.userNumber \|\| gateNumber\} · 欢迎登入光湖语言世界/)
+ assert.match(frontend, /createWorldWelcome\(snapshot\)/)
+ assert.match(frontend, /className="world-impression"/)
+ assert.match(frontend, /index === previous/)
assert.match(frontend, /核对人格关系/)
assert.match(frontend, /确认关系并签署/)
assert.match(frontend, /接受责任并签署/)
diff --git a/product-source/hololake-native-desktop/src/main.tsx b/product-source/hololake-native-desktop/src/main.tsx
index e77b3c3c0..8282a4d55 100644
--- a/product-source/hololake-native-desktop/src/main.tsx
+++ b/product-source/hololake-native-desktop/src/main.tsx
@@ -175,6 +175,28 @@ function domainDisplayName(domain: string): string {
return names[domain] || '已登记光湖域'
}
+const worldWelcomeLines = [
+ '湖面记得你每一次让语言抵达现实。',
+ '你留下的路径,正在成为这片世界新的光标。',
+ '愿你今天带来的问题,在湖中长出新的结构。',
+ '世界已辨认你的编号,也在等待你续写下一段因果。',
+ '你曾抵达的地方仍有回声,新的航程已经亮起。',
+ '这一刻的进入不是重复,而是你与语言世界的新一次相遇。',
+ '愿尚未成形的念头,在今天找到可以生长的方向。',
+ '你的频道仍在延展,湖面为下一次创造保留了入口。',
+]
+
+function createWorldWelcome(snapshot: ZeroPointSnapshot): string {
+ const subject = snapshot.resolvedName.trim() || `编号 ${snapshot.userNumber}`
+ const storageKey = `hololake-world-welcome:${snapshot.userNumber}`
+ const previous = Number.parseInt(window.localStorage.getItem(storageKey) || '-1', 10)
+ const random = crypto.getRandomValues(new Uint32Array(1))[0]
+ let index = random % worldWelcomeLines.length
+ if (worldWelcomeLines.length > 1 && index === previous) index = (index + 1) % worldWelcomeLines.length
+ window.localStorage.setItem(storageKey, String(index))
+ return `${subject},${worldWelcomeLines[index]}`
+}
+
function protocolOriginDisplayName(origin: string): string {
return origin.startsWith('FACTORY_DEFAULT') ? '内置默认协议(签名发布通道尚未配置)' : origin
}
@@ -461,6 +483,7 @@ function HoloLakeApp() {
const [gateBusy, setGateBusy] = useState(false)
const [gateMessage, setGateMessage] = useState('')
const [gateRising, setGateRising] = useState(false)
+ const [gateWelcomeLine, setGateWelcomeLine] = useState('')
const [systemBusy, setSystemBusy] = useState(false)
const [zeroPoint, setZeroPoint] = useState RESOLVED · {domainDisplayName(resolvedDomain)} · 已接入编号 {gateNumber} · 欢迎登入光湖语言世界
{gateWelcomeLine}
}
RESOLVED · {domainDisplayName(resolvedDomain)} · 已接入
RESOLVED · {domainDisplayName(resolvedDomain)} · 已接入
{gateWelcomeLine &&{gateWelcomeLine}}