diff --git a/apps/ai-game-creator-shell/src/components/windowChromeContext.ts b/apps/ai-game-creator-shell/src/components/windowChromeContext.ts index c2af570b6..1c2dcf911 100644 --- a/apps/ai-game-creator-shell/src/components/windowChromeContext.ts +++ b/apps/ai-game-creator-shell/src/components/windowChromeContext.ts @@ -20,7 +20,8 @@ export type WindowChromeActiveProjectRuns = { currentProjectPath?: string | null; /** * 当前工作台打开的项目名(清单项目名)。标题栏标签的主文案认这一个:正在运行的项目只在 - * 徽标和展开菜单里表达,否则「我在哪个项目」会被后台别的项目顶掉。 + * 徽标和展开菜单里表达,否则「我在哪个项目」会被后台别的项目顶掉。只在项目视图发布: + * 离开工作台后置空,标签回落到最近启动的在跑项目。 */ currentProjectName?: string | null; readFailed?: boolean; diff --git a/apps/ai-game-creator-shell/src/features/app-shell/ActiveProjectRunsPanel.tsx b/apps/ai-game-creator-shell/src/features/app-shell/ActiveProjectRunsPanel.tsx index 66318de4d..9d17d308b 100644 --- a/apps/ai-game-creator-shell/src/features/app-shell/ActiveProjectRunsPanel.tsx +++ b/apps/ai-game-creator-shell/src/features/app-shell/ActiveProjectRunsPanel.tsx @@ -120,14 +120,18 @@ export function ActiveProjectRunsPanel({ ); } - const runningLabel = readFailed + /** + * 标签提示 = 作用域 + 运行状态,分成两段是为了不在一句话里重复「正在运行」: + * 回落态的主文案本身就是「最近启动的在跑项目」,状态位再写一遍会读成「正在运行的项目:X; + * 正在运行 N 个项目」。 + */ + const scopeLabel = currentName + ? `当前项目:${primaryName}` + : `最近运行的项目:${primaryName}`; + const runStateLabel = readFailed ? '正在运行的项目读取失败' - : `正在运行 ${runningCount} 个项目`; - const triggerLabel = `${ - currentName - ? `当前项目:${primaryName}` - : `正在运行的项目:${primaryName}` - };${runningLabel}`; + : `共 ${runningCount} 个项目在运行`; + const triggerLabel = `${scopeLabel};${runStateLabel}`; const openProject = (projectPath: string) => { setOpen(false); onOpenProject?.(projectPath); @@ -155,7 +159,12 @@ export function ActiveProjectRunsPanel({ {primaryName} {runningCount > 0 ? ( - {runningCount} + + {runningCount} + ) : null}
正在运行的项目 - {runningLabel} + {/* 头部只报数量:读取失败的结论由下面那行 role=status 独占,避免同一句连排两遍。 */} + {runningCount > 0 ? `${runningCount} 个` : null}
{readFailed ? (

@@ -229,6 +239,10 @@ export function ActiveProjectRunsPanel({ } if (runningCount === 0) { + // 快照读到了、只是没有在跑回合:整块不渲染,不能报成读取失败。 + if (!readFailed) { + return null; + } // 三次都没读到快照:只说"没读到",不改写成业务、权限或审批结论。 return (