diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/index.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/index.jsx index 75316308..45193df5 100644 --- a/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/index.jsx +++ b/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/index.jsx @@ -1,21 +1,10 @@ -import { - Chats, - CircleNotch, - Gear, - PaperPlaneRight, - Quotes, -} from "@phosphor-icons/react"; +import { CircleNotch, PaperPlaneRight } from "@phosphor-icons/react"; import React, { useState, useRef } from "react"; -import ManageWorkspace, { - useManageWorkspaceModal, -} from "../../../Modals/MangeWorkspace"; -import useUser from "@/hooks/useUser"; import SlashCommandsButton, { SlashCommands, useSlashCommands, } from "./SlashCommands"; import { isMobile } from "react-device-detect"; -import { Tooltip } from "react-tooltip"; export default function PromptInput({ workspace, @@ -27,10 +16,8 @@ export default function PromptInput({ sendCommand, }) { const { showSlashCommand, setShowSlashCommand } = useSlashCommands(); - const { showing, showModal, hideModal } = useManageWorkspaceModal(); const formRef = useRef(null); const [_, setFocused] = useState(false); - const { user } = useUser(); const handleSubmit = (e) => { setFocused(false); @@ -100,24 +87,6 @@ export default function PromptInput({
- {user?.role !== "default" && ( -
- - -
- )} -
- {showing && ( - - )} -
- ); -} - -function ChatModeSelector({ workspace }) { - const STORAGE_KEY = `workspace_chat_mode_${workspace.slug}`; - const [chatMode, setChatMode] = useState( - window.localStorage.getItem(STORAGE_KEY) ?? "chat" - ); - - function toggleMode() { - const newChatMode = chatMode === "chat" ? "query" : "chat"; - setChatMode(newChatMode); - window.localStorage.setItem(STORAGE_KEY, newChatMode); - } - - const ModeIcon = chatMode === "chat" ? Chats : Quotes; - return ( -
- -
); } diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/index.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/index.jsx index 543d6105..8a99a62a 100644 --- a/frontend/src/components/WorkspaceChat/ChatContainer/index.jsx +++ b/frontend/src/components/WorkspaceChat/ChatContainer/index.jsx @@ -77,9 +77,6 @@ export default function ChatContainer({ workspace, knownHistory = [] }) { await Workspace.threads.streamChat( { workspaceSlug: workspace.slug, threadSlug }, promptMessage.userMessage, - window.localStorage.getItem( - `workspace_chat_mode_${workspace.slug}` - ) ?? "chat", (chatResult) => handleChat( chatResult, @@ -93,9 +90,6 @@ export default function ChatContainer({ workspace, knownHistory = [] }) { await Workspace.streamChat( workspace, promptMessage.userMessage, - window.localStorage.getItem( - `workspace_chat_mode_${workspace.slug}` - ) ?? "chat", (chatResult) => handleChat( chatResult, diff --git a/frontend/src/index.css b/frontend/src/index.css index b9e6976d..2c437982 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -439,3 +439,7 @@ dialog::backdrop { .slide-up { animation: slideUp 0.3s ease-out forwards; } + +.input-label { + @apply text-[14px] font-bold text-white; +} diff --git a/frontend/src/models/workspace.js b/frontend/src/models/workspace.js index 3b31646d..d77e2ad5 100644 --- a/frontend/src/models/workspace.js +++ b/frontend/src/models/workspace.js @@ -73,11 +73,11 @@ const Workspace = { .catch(() => false); return result; }, - streamChat: async function ({ slug }, message, mode = "query", handleChat) { + streamChat: async function ({ slug }, message, handleChat) { const ctrl = new AbortController(); await fetchEventSource(`${API_BASE}/workspace/${slug}/stream-chat`, { method: "POST", - body: JSON.stringify({ message, mode }), + body: JSON.stringify({ message }), headers: baseHeaders(), signal: ctrl.signal, openWhenHidden: true, diff --git a/frontend/src/models/workspaceThread.js b/frontend/src/models/workspaceThread.js index 256ea496..f9fad317 100644 --- a/frontend/src/models/workspaceThread.js +++ b/frontend/src/models/workspaceThread.js @@ -77,7 +77,6 @@ const WorkspaceThread = { streamChat: async function ( { workspaceSlug, threadSlug }, message, - mode = "query", handleChat ) { const ctrl = new AbortController(); @@ -85,7 +84,7 @@ const WorkspaceThread = { `${API_BASE}/workspace/${workspaceSlug}/thread/${threadSlug}/stream-chat`, { method: "POST", - body: JSON.stringify({ message, mode }), + body: JSON.stringify({ message }), headers: baseHeaders(), signal: ctrl.signal, openWhenHidden: true, diff --git a/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatHistorySettings/index.jsx b/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatHistorySettings/index.jsx index 29083574..9d46bc3b 100644 --- a/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatHistorySettings/index.jsx +++ b/frontend/src/pages/WorkspaceSettings/ChatSettings/ChatHistorySettings/index.jsx @@ -2,10 +2,7 @@ export default function ChatHistorySettings({ workspace, setHasChanges }) { return (
-