Files
Genarrative/src/services/activeAppTitle.ts
T
kdletters 7ea463ed08 退役旧创作模板业务并保留数据壳
保留 SpacetimeDB 历史表、迁移白名单与最小兼容读取定义
移除旧创作前后端、worker、业务过程及纯业务 crate 的编译依赖
恢复现役创作、项目、我的入口及桌面移动导航
收紧 Vite、TypeScript、ESLint、Vitest 与静态资源退役边界
补齐开发栈、网关、原生壳和文档退役约束
2026-07-18 22:02:22 +08:00

27 lines
902 B
TypeScript

import type { SelectionStage } from '../components/platform-entry/platformEntryActiveTypes';
import { setHostAppTitle } from './host-bridge/hostBridge';
const APP_TITLE_BRAND = '陶泥儿';
export const APP_HOME_TITLE = '陶泥儿 Genarrative|美术编辑器与项目工作台';
const APP_TITLE_BY_SELECTION_STAGE: Record<SelectionStage, string> = {
platform: APP_HOME_TITLE,
'creation-home': APP_HOME_TITLE,
project: '项目 - 陶泥儿',
profile: '我的 - 陶泥儿',
'image-editor': '美术编辑器 - 陶泥儿',
};
export function resolveAppTitleForSelectionStage(stage: SelectionStage) {
return APP_TITLE_BY_SELECTION_STAGE[stage];
}
export function syncAppTitle(title: string) {
const normalizedTitle = title.trim() || APP_TITLE_BRAND;
if (typeof document !== 'undefined') {
document.title = normalizedTitle;
}
void setHostAppTitle({ title: normalizedTitle });
}