diff --git a/core/frontend/src/App.tsx b/core/frontend/src/App.tsx index 635376e..58a81f5 100644 --- a/core/frontend/src/App.tsx +++ b/core/frontend/src/App.tsx @@ -326,6 +326,7 @@ export function App() { async function refreshProjectDetail() { if (!activeProjectId) return; const detail = await api.project(activeProjectId).catch(() => null); + // 写进 projectDetail;渲染处 pipelineProject 会校验 id 是否仍是当前激活项目,故后台旧请求写回也不会串台 if (detail) setProjectDetail(detail); } @@ -658,7 +659,9 @@ export function App() { const here = crumbLabels[page] || routeLabels[page] || "工作台"; // 生产管线 · 全屏 bespoke 布局(自带顶栏 + 步进器),脱离常规 shell - const pipelineProject = projectDetail || activeProject; + // projectDetail 只有在确实是当前激活项目时才用;否则回退 activeProject。 + // 否则后台 refreshProjectDetail 拿旧 id 的结果会把刚进入的新项目串成上一个项目(实测发现)。 + const pipelineProject = projectDetail && projectDetail.id === activeProjectId ? projectDetail : activeProject; if (page === "pipeline" && pipelineProject) { const textModel = modelConfigs.find((m) => m.capability === "text" && m.status === "active") || modelConfigs.find((m) => m.capability === "text"); return (