diff --git a/gui/src/components/mainInput/Lump/TopInputToolbar.tsx b/gui/src/components/mainInput/Lump/BlockSettingsTopToolbar.tsx similarity index 90% rename from gui/src/components/mainInput/Lump/TopInputToolbar.tsx rename to gui/src/components/mainInput/Lump/BlockSettingsTopToolbar.tsx index 034578053..380f19989 100644 --- a/gui/src/components/mainInput/Lump/TopInputToolbar.tsx +++ b/gui/src/components/mainInput/Lump/BlockSettingsTopToolbar.tsx @@ -11,7 +11,7 @@ import { fontSize } from "../../../util"; import AssistantSelect from "../../modelSelection/platform/AssistantSelect"; import HoverItem from "../InputToolbar/HoverItem"; -interface TopToolbarIconProps { +interface BlockSettingsToolbarIcon { tooltip: string; icon: React.ComponentType; itemCount?: number; @@ -19,7 +19,7 @@ interface TopToolbarIconProps { isSelected?: boolean; } -function TopToolbarIcon(props: TopToolbarIconProps) { +function BlockSettingsToolbarIcon(props: BlockSettingsToolbarIcon) { return (
void; } -export function TopInputToolbar(props: TopInputProps) { +export function BlockSettingsTopToolbar(props: BlockSettingsTopToolbarProps) { return (
- - - - */} - - void; +} + +export function TopToolbar(props: TopToolbarProps) { + const dispatch = useAppDispatch(); + const ideMessenger = useContext(IdeMessengerContext); + const ttsActive = useAppSelector((state) => state.ui.ttsActive); + const isStreaming = useAppSelector((state) => state.session.isStreaming); + + if (ttsActive) { + return ( + + { + ideMessenger.post("tts/kill", undefined); + }} + > + ■ Stop TTS + + + ); + } + + if (isStreaming) { + return ( + + { + dispatch(setInactive()); + dispatch(clearLastEmptyResponse()); + }} + > + {getMetaKeyLabel()} ⌫ Cancel + + + ); + } + + return ( + + ); +} diff --git a/gui/src/components/mainInput/Lump/index.tsx b/gui/src/components/mainInput/Lump/index.tsx index 61fcd1491..565743afb 100644 --- a/gui/src/components/mainInput/Lump/index.tsx +++ b/gui/src/components/mainInput/Lump/index.tsx @@ -5,8 +5,8 @@ import { vscCommandCenterInactiveBorder, vscInputBackground, } from "../.."; -import { TopInputToolbar } from "./TopInputToolbar"; import { SelectedSection } from "./sections/SelectedSection"; +import { TopToolbar } from "./TopToolbar"; interface LumpProps { open: boolean; @@ -61,7 +61,7 @@ export function Lump(props: LumpProps) { return (
- diff --git a/gui/src/pages/gui/Chat.tsx b/gui/src/pages/gui/Chat.tsx index 6545b1a44..922f53e48 100644 --- a/gui/src/pages/gui/Chat.tsx +++ b/gui/src/pages/gui/Chat.tsx @@ -13,12 +13,7 @@ import { useCallback, useContext, useEffect, useRef, useState } from "react"; import { ErrorBoundary } from "react-error-boundary"; import { useSelector } from "react-redux"; import styled from "styled-components"; -import { - Button, - defaultBorderRadius, - lightGray, - vscBackground, -} from "../../components"; +import { Button, lightGray, vscBackground } from "../../components"; import CodeToEditCard from "../../components/CodeToEditCard"; import FeedbackDialog from "../../components/dialogs/FeedbackDialog"; import FreeTrialOverDialog from "../../components/dialogs/FreeTrialOverDialog"; @@ -41,11 +36,9 @@ import { selectCurrentToolCall } from "../../redux/selectors/selectCurrentToolCa import { selectDefaultModel } from "../../redux/slices/configSlice"; import { submitEdit } from "../../redux/slices/editModeState"; import { - clearLastEmptyResponse, newSession, selectIsInEditMode, selectIsSingleRangeEditOrInsertion, - setInactive, } from "../../redux/slices/sessionSlice"; import { setDialogEntryOn, @@ -57,11 +50,7 @@ import { cancelStream } from "../../redux/thunks/cancelStream"; import { exitEditMode } from "../../redux/thunks/exitEditMode"; import { loadLastSession } from "../../redux/thunks/session"; import { streamResponseThunk } from "../../redux/thunks/streamResponse"; -import { - getFontSize, - getMetaKeyLabel, - isMetaEquivalentKeyPressed, -} from "../../util"; +import { isMetaEquivalentKeyPressed } from "../../util"; import { FREE_TRIAL_LIMIT_REQUESTS, incrementFreeTrialCount, @@ -76,29 +65,6 @@ import { ToolCallButtons } from "./ToolCallDiv/ToolCallButtonsDiv"; import ToolOutput from "./ToolCallDiv/ToolOutput"; import { useAutoScroll } from "./useAutoScroll"; -const StopButton = styled.div` - background-color: ${vscBackground}; - width: fit-content; - margin-right: auto; - margin-left: auto; - font-size: ${getFontSize() - 2}px; - border: 0.5px solid ${lightGray}; - border-radius: ${defaultBorderRadius}; - padding: 4px 8px; - color: ${lightGray}; - cursor: pointer; - box-shadow: - 0 4px 6px rgba(0, 0, 0, 0.1), - 0 1px 3px rgba(0, 0, 0, 0.08); - transition: box-shadow 0.3s ease; - - &:hover { - box-shadow: - 0 6px 8px rgba(0, 0, 0, 0.15), - 0 3px 6px rgba(0, 0, 0, 0.1); - } -`; - const StepsDiv = styled.div` position: relative; background-color: transparent; @@ -141,7 +107,6 @@ export function Chat() { (store) => store.config.config.ui?.showSessionTabs, ); const defaultModel = useAppSelector(selectDefaultModel); - const ttsActive = useAppSelector((state) => state.ui.ttsActive); const isStreaming = useAppSelector((state) => state.session.isStreaming); const [stepsOpen, setStepsOpen] = useState<(boolean | undefined)[]>([]); const mainTextInputRef = useRef(null); @@ -426,29 +391,6 @@ export function Chat() { ))}
-
- {ttsActive && ( - { - ideMessenger.post("tts/kill", undefined); - }} - > - ■ Stop TTS - - )} - {isStreaming && ( - { - dispatch(setInactive()); - dispatch(clearLastEmptyResponse()); - }} - > - {getMetaKeyLabel()} ⌫ Cancel - - )} -
- {toolCallState?.status === "generated" && } {isInEditMode && history.length === 0 && }