🐛 fix(copilot): pass correct scope when creating new session in PageEditor (#11714)

The switchTopic function was called without scope parameter, defaulting to 'main' scope while PageAgentProvider uses 'page' scope, causing new session creation to fail.

fix LOBE-3378
This commit is contained in:
Innei
2026-01-23 00:09:06 +08:00
committed by GitHub
parent 89750fcae9
commit 0259270871
2 changed files with 10 additions and 1 deletions

View File

@@ -189,7 +189,7 @@ const CopilotToolbar = memo<CopilotToolbarProps>(({ agentId, isHovered }) => {
<div className={cx(styles.fadeContainer, isHovered ? styles.fadeIn : styles.fadeOut)}>
<ActionIcon
icon={PlusIcon}
onClick={() => switchTopic()}
onClick={() => switchTopic(null, { scope: 'page' })}
size={DESKTOP_HEADER_ICON_SIZE}
title={t('actions.addNewTopic')}
/>

View File

@@ -1,3 +1,4 @@
import { isDesktop } from '@lobechat/const';
import { type Theme, css } from 'antd-style';
import { rgba } from 'polished';
@@ -16,4 +17,12 @@ export default ({ token }: { prefixCls: string; token: Theme }) => css`
background: ${rgba(token.colorBgLayout, 0.5)} !important;
backdrop-filter: blur(2px);
}
${isDesktop &&
css`
.${token.prefixCls}-modal-mask.${token.prefixCls}-modal-mask-blur {
background: ${rgba(token.colorBgLayout, 0.8)} !important;
backdrop-filter: none !important;
}
`}
`;