feat(mindspace): 悬浮聊天勾选资料联动、UI 与交互优化
勾选单个文件时 Agent 获知上下文并主动问候;打开悬浮窗使用新会话。 统一弹窗浅色主题、固定高度与输入区布局,支持点击外部收起。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -667,6 +667,14 @@ export function MindSpaceView({
|
||||
return () => document.removeEventListener('pointerdown', handlePointerDown);
|
||||
}, [openAssetMenuId]);
|
||||
|
||||
const selectedAssetsForChat = useMemo(
|
||||
() =>
|
||||
selectedAssetIds
|
||||
.map((id) => assets.find((asset) => asset.id === id))
|
||||
.filter((asset): asset is MindSpaceAsset => Boolean(asset)),
|
||||
[selectedAssetIds, assets],
|
||||
);
|
||||
|
||||
const mindspaceChatContext = useMemo(() => {
|
||||
if (!space) return null;
|
||||
return buildMindSpaceChatContext({
|
||||
@@ -677,7 +685,7 @@ export function MindSpaceView({
|
||||
pages,
|
||||
pageLive: pageLiveContext,
|
||||
assets,
|
||||
focusedAsset: agentAsset,
|
||||
selectedAssets: selectedAssetsForChat,
|
||||
route: `${location.pathname}${location.search}`,
|
||||
agentSessionId: session?.id ?? null,
|
||||
h5ApiBase,
|
||||
@@ -690,7 +698,7 @@ export function MindSpaceView({
|
||||
pages,
|
||||
pageLiveContext,
|
||||
assets,
|
||||
agentAsset,
|
||||
selectedAssetsForChat,
|
||||
location.pathname,
|
||||
location.search,
|
||||
session?.id,
|
||||
|
||||
Reference in New Issue
Block a user