RECENT WORK
{pages.length > 0 ? '最近页面' : '这里会出现你的 AI 成果'}
- {pages.length > 0 &&
{pages.length} 个页面}
+ {pages.length > 0 && (
+
+ )}
{pages.length > 0 ? (
-
- {pages.slice(0, 6).map((page) => (
- showPage(page.id)}
- actions={buildPageCardActions(page)}
- />
- ))}
-
+ <>
+
+ {pagedRecentPages.map((page) => (
+ showPage(page.id)}
+ />
+ ))}
+
+ {pages.length > RECENT_PAGES_PAGE_SIZE ? (
+
+
+
+ 第 {safeRecentPagesPage + 1} / {recentPagesTotal} 页
+
+
+
+ ) : null}
+ >
) : (
上传资料或从聊天保存页面后,报告、图片和作品会以卡片形式出现在这里。
@@ -1672,13 +2184,14 @@ export function MindSpaceView({
- 支持 Word、Excel、PDF、PPT、图片、Markdown、CSV 和 TXT,单文件最大 2 MB。
+ 支持 {UPLOAD_FILE_TYPE_LABEL},单文件最大 {formatBytes(MAX_UPLOAD_FILE_BYTES)}。
setSelectedFile(event.target.files?.[0] ?? null)}
+ accept={UPLOAD_ACCEPT}
+ onChange={handleUploadFileChange}
/>
+ {uploadError && {uploadError}
}
{selectedFile && (
{selectedFile.name}
diff --git a/src/components/SpaceChatPanel.tsx b/src/components/SpaceChatPanel.tsx
index 914cca1..8cd71d1 100644
--- a/src/components/SpaceChatPanel.tsx
+++ b/src/components/SpaceChatPanel.tsx
@@ -46,6 +46,7 @@ export function SpaceChatPanel({
notice,
dismissNotice,
openRecharge,
+ uploadChatImage,
retryConnect,
} = chat;
@@ -122,11 +123,12 @@ export function SpaceChatPanel({
chatState={chatState}
pendingTool={pendingTool}
session={session}
- onSubmit={(text) =>
+ onSubmit={(text, imageUrls) =>
chatBridge
- ? void submit(text, context)
- : void submit(text, { mindspaceContext: context })
+ ? void submit(text, context, imageUrls)
+ : void submit(text, { mindspaceContext: context }, imageUrls)
}
+ onUploadImage={uploadChatImage}
onStop={stop}
onApproveTool={approveTool}
onPageSaved={onPageSaved}
diff --git a/src/components/VoiceInputButton.tsx b/src/components/VoiceInputButton.tsx
index dfc07b7..69963bb 100644
--- a/src/components/VoiceInputButton.tsx
+++ b/src/components/VoiceInputButton.tsx
@@ -1,66 +1,324 @@
-import { useEffect, useState } from 'react';
+import { useCallback, useEffect, useRef, useState } from 'react';
+import { useVoiceSession } from '../hooks/useVoiceSession';
import { shouldShowVoiceInputControl, isVoiceInputAvailable } from '../voice/capabilities';
-import { VoiceInputDialog } from './VoiceInputDialog';
+import { isWechatBrowser } from '../utils/wechat';
+import {
+ checkWechatVoiceApis,
+ isWechatVoiceReady,
+ prepareWechatVoiceSdk,
+ startWechatVoiceRecord,
+ stopWechatVoiceRecord,
+ translateWechatVoice,
+} from '../voice/wechatVoice';
function MicIcon() {
return (
-