接入桌面壳窗口标题同步路径

H5 主站按当前平台阶段同步 document.title

native_app 中通过 app.setTitle 请求 Tauri 窗口标题同步

补充标题同步测试和宿主壳能力文档
This commit is contained in:
2026-06-18 00:07:21 +08:00
parent 78afd81269
commit d64e576e3f
9 changed files with 307 additions and 2 deletions

View File

@@ -23,6 +23,10 @@ import {
resolveSelectionStageFromPath,
} from './routing/appPageRoutes';
import type { RpgRuntimeAppIntent } from './RpgRuntimeApp';
import {
resolveAppTitleForSelectionStage,
syncAppTitle,
} from './services/appTitle';
import type { CustomWorldProfile } from './types';
const RpgRuntimeApp = lazy(async () => {
@@ -134,6 +138,14 @@ export default function App() {
? 'platform-theme--dark'
: 'platform-theme--light';
useEffect(() => {
syncAppTitle(
isRuntimeActive
? 'RPG 运行中 - 陶泥儿'
: resolveAppTitleForSelectionStage(selectionStage),
);
}, [isRuntimeActive, selectionStage]);
if (isRuntimeActive) {
return (
<Suspense fallback={<RuntimeLoadingFallback />}>