refactor: close the file upload port (#769)

This commit is contained in:
ayangweb
2025-07-18 10:45:05 +08:00
committed by GitHub
parent 941cf96a07
commit e56d6b1b60
2 changed files with 21 additions and 21 deletions

View File

@@ -3,12 +3,12 @@ import { useTranslation } from "react-i18next";
import { ChatMessage } from "@/components/ChatMessage";
import { Greetings } from "./Greetings";
import FileList from "@/components/Assistant/FileList";
// import FileList from "@/components/Assistant/FileList";
import { useChatScroll } from "@/hooks/useChatScroll";
import { useChatStore } from "@/stores/chatStore";
// import { useChatStore } from "@/stores/chatStore";
import type { Chat, IChunkData } from "@/types/chat";
import { useConnectStore } from "@/stores/connectStore";
import SessionFile from "./SessionFile";
// import SessionFile from "./SessionFile";
import ScrollToBottom from "@/components/Common/ScrollToBottom";
interface ChatContentProps {
@@ -43,14 +43,14 @@ export const ChatContent = ({
Question,
handleSendMessage,
}: ChatContentProps) => {
const sessionId = useConnectStore((state) => state.currentSessionId);
// const sessionId = useConnectStore((state) => state.currentSessionId);
const setCurrentSessionId = useConnectStore((state) => {
return state.setCurrentSessionId;
});
const { t } = useTranslation();
const uploadFiles = useChatStore((state) => state.uploadFiles);
// const uploadFiles = useChatStore((state) => state.uploadFiles);
const messagesEndRef = useRef<HTMLDivElement>(null);
const { scrollToBottom } = useChatScroll(messagesEndRef);
@@ -164,13 +164,13 @@ export const ChatContent = ({
<div ref={messagesEndRef} />
</div>
{uploadFiles.length > 0 && (
{/* {uploadFiles.length > 0 && (
<div key={sessionId} className="max-h-[120px] overflow-auto p-2">
<FileList />
</div>
)}
)} */}
{sessionId && <SessionFile sessionId={sessionId} />}
{/* {sessionId && <SessionFile sessionId={sessionId} />} */}
<ScrollToBottom scrollRef={scrollRef} isAtBottom={isAtBottom} />
</div>

View File

@@ -16,7 +16,7 @@ import { useAppStore } from "@/stores/appStore";
import { useSearchStore } from "@/stores/searchStore";
import { useExtensionsStore } from "@/stores/extensionsStore";
import { parseSearchQuery, SearchQuery } from "@/utils";
import InputUpload from "./InputUpload";
// import InputUpload from "./InputUpload";
// import AiSummaryIcon from "@/components/Common/Icons/AiSummaryIcon";
interface InputControlsProps {
@@ -56,16 +56,16 @@ const InputControls = ({
isChatPage,
hasModules,
changeMode,
checkScreenPermission,
requestScreenPermission,
getScreenMonitors,
getScreenWindows,
captureWindowScreenshot,
captureMonitorScreenshot,
openFileDialog,
getFileMetadata,
getFileIcon,
}: InputControlsProps) => {
}: // checkScreenPermission,
// requestScreenPermission,
// getScreenMonitors,
// getScreenWindows,
// captureWindowScreenshot,
// captureMonitorScreenshot,
// openFileDialog,
// getFileMetadata,
// getFileIcon,
InputControlsProps) => {
const { t } = useTranslation();
const isTauri = useAppStore((state) => state.isTauri);
@@ -171,7 +171,7 @@ const InputControls = ({
>
{isChatMode ? (
<div className="flex gap-2 text-[12px] leading-3 text-[#333] dark:text-[#d8d8d8]">
<InputUpload
{/* <InputUpload
checkScreenPermission={checkScreenPermission}
requestScreenPermission={requestScreenPermission}
getScreenMonitors={getScreenMonitors}
@@ -181,7 +181,7 @@ const InputControls = ({
openFileDialog={openFileDialog}
getFileMetadata={getFileMetadata}
getFileIcon={getFileIcon}
/>
/> */}
{source?.type === "deep_think" && source?.config?.visible && (
<button