mirror of
https://github.com/infinilabs/coco-app.git
synced 2025-12-16 11:37:47 +01:00
refactor: close the file upload port (#769)
This commit is contained in:
@@ -3,12 +3,12 @@ import { useTranslation } from "react-i18next";
|
|||||||
|
|
||||||
import { ChatMessage } from "@/components/ChatMessage";
|
import { ChatMessage } from "@/components/ChatMessage";
|
||||||
import { Greetings } from "./Greetings";
|
import { Greetings } from "./Greetings";
|
||||||
import FileList from "@/components/Assistant/FileList";
|
// import FileList from "@/components/Assistant/FileList";
|
||||||
import { useChatScroll } from "@/hooks/useChatScroll";
|
import { useChatScroll } from "@/hooks/useChatScroll";
|
||||||
import { useChatStore } from "@/stores/chatStore";
|
// import { useChatStore } from "@/stores/chatStore";
|
||||||
import type { Chat, IChunkData } from "@/types/chat";
|
import type { Chat, IChunkData } from "@/types/chat";
|
||||||
import { useConnectStore } from "@/stores/connectStore";
|
import { useConnectStore } from "@/stores/connectStore";
|
||||||
import SessionFile from "./SessionFile";
|
// import SessionFile from "./SessionFile";
|
||||||
import ScrollToBottom from "@/components/Common/ScrollToBottom";
|
import ScrollToBottom from "@/components/Common/ScrollToBottom";
|
||||||
|
|
||||||
interface ChatContentProps {
|
interface ChatContentProps {
|
||||||
@@ -43,14 +43,14 @@ export const ChatContent = ({
|
|||||||
Question,
|
Question,
|
||||||
handleSendMessage,
|
handleSendMessage,
|
||||||
}: ChatContentProps) => {
|
}: ChatContentProps) => {
|
||||||
const sessionId = useConnectStore((state) => state.currentSessionId);
|
// const sessionId = useConnectStore((state) => state.currentSessionId);
|
||||||
const setCurrentSessionId = useConnectStore((state) => {
|
const setCurrentSessionId = useConnectStore((state) => {
|
||||||
return state.setCurrentSessionId;
|
return state.setCurrentSessionId;
|
||||||
});
|
});
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const uploadFiles = useChatStore((state) => state.uploadFiles);
|
// const uploadFiles = useChatStore((state) => state.uploadFiles);
|
||||||
const messagesEndRef = useRef<HTMLDivElement>(null);
|
const messagesEndRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
const { scrollToBottom } = useChatScroll(messagesEndRef);
|
const { scrollToBottom } = useChatScroll(messagesEndRef);
|
||||||
@@ -164,13 +164,13 @@ export const ChatContent = ({
|
|||||||
<div ref={messagesEndRef} />
|
<div ref={messagesEndRef} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{uploadFiles.length > 0 && (
|
{/* {uploadFiles.length > 0 && (
|
||||||
<div key={sessionId} className="max-h-[120px] overflow-auto p-2">
|
<div key={sessionId} className="max-h-[120px] overflow-auto p-2">
|
||||||
<FileList />
|
<FileList />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)} */}
|
||||||
|
|
||||||
{sessionId && <SessionFile sessionId={sessionId} />}
|
{/* {sessionId && <SessionFile sessionId={sessionId} />} */}
|
||||||
|
|
||||||
<ScrollToBottom scrollRef={scrollRef} isAtBottom={isAtBottom} />
|
<ScrollToBottom scrollRef={scrollRef} isAtBottom={isAtBottom} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import { useAppStore } from "@/stores/appStore";
|
|||||||
import { useSearchStore } from "@/stores/searchStore";
|
import { useSearchStore } from "@/stores/searchStore";
|
||||||
import { useExtensionsStore } from "@/stores/extensionsStore";
|
import { useExtensionsStore } from "@/stores/extensionsStore";
|
||||||
import { parseSearchQuery, SearchQuery } from "@/utils";
|
import { parseSearchQuery, SearchQuery } from "@/utils";
|
||||||
import InputUpload from "./InputUpload";
|
// import InputUpload from "./InputUpload";
|
||||||
// import AiSummaryIcon from "@/components/Common/Icons/AiSummaryIcon";
|
// import AiSummaryIcon from "@/components/Common/Icons/AiSummaryIcon";
|
||||||
|
|
||||||
interface InputControlsProps {
|
interface InputControlsProps {
|
||||||
@@ -56,16 +56,16 @@ const InputControls = ({
|
|||||||
isChatPage,
|
isChatPage,
|
||||||
hasModules,
|
hasModules,
|
||||||
changeMode,
|
changeMode,
|
||||||
checkScreenPermission,
|
}: // checkScreenPermission,
|
||||||
requestScreenPermission,
|
// requestScreenPermission,
|
||||||
getScreenMonitors,
|
// getScreenMonitors,
|
||||||
getScreenWindows,
|
// getScreenWindows,
|
||||||
captureWindowScreenshot,
|
// captureWindowScreenshot,
|
||||||
captureMonitorScreenshot,
|
// captureMonitorScreenshot,
|
||||||
openFileDialog,
|
// openFileDialog,
|
||||||
getFileMetadata,
|
// getFileMetadata,
|
||||||
getFileIcon,
|
// getFileIcon,
|
||||||
}: InputControlsProps) => {
|
InputControlsProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const isTauri = useAppStore((state) => state.isTauri);
|
const isTauri = useAppStore((state) => state.isTauri);
|
||||||
@@ -171,7 +171,7 @@ const InputControls = ({
|
|||||||
>
|
>
|
||||||
{isChatMode ? (
|
{isChatMode ? (
|
||||||
<div className="flex gap-2 text-[12px] leading-3 text-[#333] dark:text-[#d8d8d8]">
|
<div className="flex gap-2 text-[12px] leading-3 text-[#333] dark:text-[#d8d8d8]">
|
||||||
<InputUpload
|
{/* <InputUpload
|
||||||
checkScreenPermission={checkScreenPermission}
|
checkScreenPermission={checkScreenPermission}
|
||||||
requestScreenPermission={requestScreenPermission}
|
requestScreenPermission={requestScreenPermission}
|
||||||
getScreenMonitors={getScreenMonitors}
|
getScreenMonitors={getScreenMonitors}
|
||||||
@@ -181,7 +181,7 @@ const InputControls = ({
|
|||||||
openFileDialog={openFileDialog}
|
openFileDialog={openFileDialog}
|
||||||
getFileMetadata={getFileMetadata}
|
getFileMetadata={getFileMetadata}
|
||||||
getFileIcon={getFileIcon}
|
getFileIcon={getFileIcon}
|
||||||
/>
|
/> */}
|
||||||
|
|
||||||
{source?.type === "deep_think" && source?.config?.visible && (
|
{source?.type === "deep_think" && source?.config?.visible && (
|
||||||
<button
|
<button
|
||||||
|
|||||||
Reference in New Issue
Block a user