Fix OA workspace cover thumbnails and add space chat new session.
Resolve mindspace-cover images from workspace directories when generating feed thumbnails, refresh stale SVGs missing embedded photos, and disable thumbnail API caching so fixes take effect immediately. Also add a new session control to the space chat panel, including on mobile. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -48,6 +48,16 @@ export function SpaceChatPanel({
|
||||
openRecharge,
|
||||
retryConnect,
|
||||
} = chat;
|
||||
const busy = chatState === 'streaming' || chatState === 'loading' || chatState === 'connecting';
|
||||
const memoryLoading = chatBridge ? false : mainChat.memoryLoading;
|
||||
|
||||
const handleNewSession = () => {
|
||||
if (chatBridge) {
|
||||
void chatBridge.newSession();
|
||||
return;
|
||||
}
|
||||
void mainChat.newSession();
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!open) return;
|
||||
@@ -75,6 +85,14 @@ export function SpaceChatPanel({
|
||||
</div>
|
||||
</div>
|
||||
<div className="space-chat-panel-actions">
|
||||
<button
|
||||
type="button"
|
||||
className="ghost-btn space-chat-panel-new-session"
|
||||
disabled={busy || memoryLoading}
|
||||
onClick={handleNewSession}
|
||||
>
|
||||
新会话
|
||||
</button>
|
||||
{!hideOpenFullChat ? (
|
||||
<button type="button" className="ghost-btn" onClick={onOpenFullChat}>
|
||||
打开完整聊天
|
||||
|
||||
@@ -306,6 +306,12 @@ export function usePageEditSubChat({
|
||||
}
|
||||
}, [connectSubSession, start]);
|
||||
|
||||
const newSession = useCallback(async () => {
|
||||
if (chatState === 'streaming' || chatState === 'loading' || chatState === 'connecting') return;
|
||||
await close({ merge: false });
|
||||
await start();
|
||||
}, [chatState, close, start]);
|
||||
|
||||
const startedRef = useRef(false);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -335,6 +341,7 @@ export function usePageEditSubChat({
|
||||
dismissNotice,
|
||||
retryConnect,
|
||||
openRecharge: () => setNotice('余额不足,请充值后继续使用'),
|
||||
newSession,
|
||||
close,
|
||||
};
|
||||
}
|
||||
|
||||
+1
-1
@@ -6045,7 +6045,7 @@ body,
|
||||
border-radius: 24px 24px 0 0;
|
||||
}
|
||||
|
||||
.space-chat-panel-actions .ghost-btn {
|
||||
.space-chat-panel-actions .ghost-btn:not(.space-chat-panel-new-session) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user