fix: prevent notebook writing redirect to agent chat
This commit is contained in:
1 parent
4bfaeb728b
commit
f3e5a3bb35
1 file changed
+4
-2
@@ -414,6 +414,8 @@ function AIWritingBody({
|
|||||||
const routeBase = useAIWritingRouteBase();
|
const routeBase = useAIWritingRouteBase();
|
||||||
const agentRoute = useAIWritingAgentRouteState(routeBase);
|
const agentRoute = useAIWritingAgentRouteState(routeBase);
|
||||||
const isAdmin = getStoredAuth()?.system_role === 'admin';
|
const isAdmin = getStoredAuth()?.system_role === 'admin';
|
||||||
|
const externalNotebookMode =
|
||||||
|
studioToken != null || initialNotebookId != null || initialDocumentIds != null;
|
||||||
|
|
||||||
// 需求 0616 #5:左栏点「笔记本 / 所有空间」→ 在右侧内嵌打开对应页,替换右侧内容
|
// 需求 0616 #5:左栏点「笔记本 / 所有空间」→ 在右侧内嵌打开对应页,替换右侧内容
|
||||||
// (写作布局不卸载,仅 display:none 隐藏,避免 WritingSetupChat 重挂丢线程)。
|
// (写作布局不卸载,仅 display:none 隐藏,避免 WritingSetupChat 重挂丢线程)。
|
||||||
@@ -432,12 +434,12 @@ function AIWritingBody({
|
|||||||
}
|
}
|
||||||
}, [agentRoute.active]);
|
}, [agentRoute.active]);
|
||||||
|
|
||||||
const agentsActive = sidebarTab === 'agents';
|
const agentsActive = !externalNotebookMode && sidebarTab === 'agents';
|
||||||
|
|
||||||
// 研究模板侧栏在「写作配置(idle)」与「历史回看」两态都展示(点历史记录后保留侧栏、
|
// 研究模板侧栏在「写作配置(idle)」与「历史回看」两态都展示(点历史记录后保留侧栏、
|
||||||
// 历史内容显示到右侧区域);写作进行中收起;嵌入态(studioToken)始终不展示。
|
// 历史内容显示到右侧区域);写作进行中收起;嵌入态(studioToken)始终不展示。
|
||||||
const showSidebar =
|
const showSidebar =
|
||||||
!studioToken && (state.status === 'idle' || isHistoryMode || agentsActive);
|
!externalNotebookMode && (state.status === 'idle' || isHistoryMode || agentsActive);
|
||||||
const compactAppearanceActions = compactChrome ? (
|
const compactAppearanceActions = compactChrome ? (
|
||||||
<AIWritingCompactAppearanceActions />
|
<AIWritingCompactAppearanceActions />
|
||||||
) : null;
|
) : null;
|
||||||
|
|||||||
Reference in new issue
Block a user