diff --git a/gui/src/components/Footer.tsx b/gui/src/components/Footer.tsx index 21b9df4f6..0c094155c 100644 --- a/gui/src/components/Footer.tsx +++ b/gui/src/components/Footer.tsx @@ -11,7 +11,7 @@ import { defaultModelSelector } from "../redux/selectors/modelSelectors"; import { RootState } from "../redux/store"; import { FREE_TRIAL_LIMIT_REQUESTS } from "../util/freeTrial"; import { ROUTES } from "../util/navigation"; -import ButtonWithTooltip from "./ButtonWithTooltip"; +import HeaderButtonWithToolTip from "./gui/HeaderButtonWithToolTip"; import FreeTrialProgressBar from "./loaders/FreeTrialProgressBar"; import ProfileSwitcher from "./ProfileSwitcher"; @@ -60,30 +60,30 @@ function Footer() {
{configError && ( - - + )} - - + - - +
); diff --git a/gui/src/components/History/HistoryTableRow.tsx b/gui/src/components/History/HistoryTableRow.tsx index 76c241d63..26107c199 100644 --- a/gui/src/components/History/HistoryTableRow.tsx +++ b/gui/src/components/History/HistoryTableRow.tsx @@ -5,7 +5,7 @@ import { useDispatch } from "react-redux"; import { useNavigate } from "react-router-dom"; import { Input } from ".."; import useHistory from "../../hooks/useHistory"; -import ButtonWithTooltip from "../ButtonWithTooltip"; +import HeaderButtonWithToolTip from "../gui/HeaderButtonWithToolTip"; function lastPartOfPath(path: string): string { const sep = path.includes("/") ? "/" : "\\"; @@ -101,7 +101,7 @@ export function HistoryTableRow({ {hovered && !editing && (
- { e.stopPropagation(); @@ -109,8 +109,8 @@ export function HistoryTableRow({ }} > - - + { await deleteSession(session.sessionId); @@ -118,7 +118,7 @@ export function HistoryTableRow({ }} > - +
)} diff --git a/gui/src/components/OnboardingCard/tabs/OnboardingQuickstartTab.tsx b/gui/src/components/OnboardingCard/tabs/OnboardingQuickstartTab.tsx index ff77e18e8..326fd32e2 100644 --- a/gui/src/components/OnboardingCard/tabs/OnboardingQuickstartTab.tsx +++ b/gui/src/components/OnboardingCard/tabs/OnboardingQuickstartTab.tsx @@ -1,20 +1,20 @@ -import ContinueLogo from "../../ContinueLogo"; +import ContinueLogo from "../../gui/ContinueLogo"; import QuickStartSubmitButton from "../components/QuickStartSubmitButton"; function OnboardingQuickstartTab() { return ( -
-
-
+
+
+
-

+

Quickly get up and running using our API keys. After this trial, we'll help you set up your own models.

-

+

To prevent abuse, we'll ask you to sign in to GitHub.

diff --git a/gui/src/components/ProfileSwitcher.tsx b/gui/src/components/ProfileSwitcher.tsx index f4bfde1cc..4fe8bd72d 100644 --- a/gui/src/components/ProfileSwitcher.tsx +++ b/gui/src/components/ProfileSwitcher.tsx @@ -24,7 +24,7 @@ import { useWebviewListener } from "../hooks/useWebviewListener"; import { setLastControlServerBetaEnabledStatus } from "../redux/slices/miscSlice"; import { RootState } from "../redux/store"; import { getFontSize } from "../util"; -import ButtonWithTooltip from "./ButtonWithTooltip"; +import HeaderButtonWithToolTip from "./gui/HeaderButtonWithToolTip"; const StyledListbox = styled(Listbox)` background-color: ${vscBackground}; @@ -247,7 +247,7 @@ function ProfileSwitcher() { {controlServerBetaEnabled && (session?.account ? ( - - + ) : ( - - + ))} ); diff --git a/gui/src/components/ContinueLogo.tsx b/gui/src/components/gui/ContinueLogo.tsx similarity index 99% rename from gui/src/components/ContinueLogo.tsx rename to gui/src/components/gui/ContinueLogo.tsx index 88aa18b68..b68f759c0 100644 --- a/gui/src/components/ContinueLogo.tsx +++ b/gui/src/components/gui/ContinueLogo.tsx @@ -1,4 +1,4 @@ -import { vscForeground } from "."; +import { vscForeground } from ".."; interface ContinueLogoProps { height?: number; diff --git a/gui/src/components/gui/CopyIconButton.tsx b/gui/src/components/gui/CopyIconButton.tsx index 85f44580b..560042026 100644 --- a/gui/src/components/gui/CopyIconButton.tsx +++ b/gui/src/components/gui/CopyIconButton.tsx @@ -2,7 +2,7 @@ import { CheckIcon, ClipboardIcon } from "@heroicons/react/24/outline"; import { useContext, useState } from "react"; import { IdeMessengerContext } from "../../context/IdeMessenger"; import { isJetBrains } from "../../util"; -import ButtonWithTooltip from "../ButtonWithTooltip"; +import HeaderButtonWithToolTip from "./HeaderButtonWithToolTip"; import useCopy from "../../hooks/useCopy"; interface CopyIconButtonProps { @@ -22,7 +22,7 @@ export function CopyIconButton({ return ( <> - )} - + ); } diff --git a/gui/src/components/gui/ErrorStepContainer.tsx b/gui/src/components/gui/ErrorStepContainer.tsx index e1d0515ce..80526132c 100644 --- a/gui/src/components/gui/ErrorStepContainer.tsx +++ b/gui/src/components/gui/ErrorStepContainer.tsx @@ -2,7 +2,7 @@ import { MinusCircleIcon, XMarkIcon } from "@heroicons/react/24/outline"; import { ContinueError } from "core"; import styled from "styled-components"; import { defaultBorderRadius, vscBackground } from ".."; -import ButtonWithTooltip from "../ButtonWithTooltip"; +import HeaderButtonWithToolTip from "./HeaderButtonWithToolTip"; const Div = styled.div` padding: 8px; @@ -29,12 +29,15 @@ function ErrorStepContainer(props: ErrorStepContainerProps) { display: "flex", }} > - props.onClose()}> + props.onClose()} + > - - props.onDelete()}> + + props.onDelete()}> - +
diff --git a/gui/src/components/ButtonWithTooltip.tsx b/gui/src/components/gui/HeaderButtonWithToolTip.tsx
similarity index 80%
rename from gui/src/components/ButtonWithTooltip.tsx
rename to gui/src/components/gui/HeaderButtonWithToolTip.tsx
index cf3cb9275..4a64c6283 100644
--- a/gui/src/components/ButtonWithTooltip.tsx
+++ b/gui/src/components/gui/HeaderButtonWithToolTip.tsx
@@ -1,10 +1,10 @@
 import React from "react";
 import { type PlacesType } from "react-tooltip";
-import { HeaderButton } from ".";
+import { HeaderButton } from "..";
 import { v4 as uuidv4 } from "uuid";
-import { ToolTip } from "./gui/Tooltip"; 
+import { ToolTip } from "./Tooltip";
 
-interface HeaderButtonWithTextProps {
+interface HeaderButtonWithToolTipProps {
   text: string | undefined;
   onClick?: (e: any) => void;
   children: React.ReactNode;
@@ -20,10 +20,10 @@ interface HeaderButtonWithTextProps {
   tooltipPlacement?: PlacesType;
 }
 
-const ButtonWithTooltip = React.forwardRef<
+const HeaderButtonWithToolTip = React.forwardRef<
   HTMLButtonElement,
-  HeaderButtonWithTextProps
->((props: HeaderButtonWithTextProps, ref) => {
+  HeaderButtonWithToolTipProps
+>((props: HeaderButtonWithToolTipProps, ref) => {
   const id = uuidv4();
   const tooltipId = `header_button_${id}`;
 
@@ -52,4 +52,4 @@ const ButtonWithTooltip = React.forwardRef<
   );
 });
 
-export default ButtonWithTooltip;
+export default HeaderButtonWithToolTip;
diff --git a/gui/src/components/gui/StepContainer.tsx b/gui/src/components/gui/StepContainer.tsx
index c2a4310cf..b156f6c1f 100644
--- a/gui/src/components/gui/StepContainer.tsx
+++ b/gui/src/components/gui/StepContainer.tsx
@@ -14,7 +14,7 @@ import { IdeMessengerContext } from "../../context/IdeMessenger";
 import useUIConfig from "../../hooks/useUIConfig";
 import { RootState } from "../../redux/store";
 import { getFontSize } from "../../util";
-import ButtonWithTooltip from "../ButtonWithTooltip";
+import HeaderButtonWithToolTip from "./HeaderButtonWithToolTip";
 import StyledMarkdownPreview from "../markdown/StyledMarkdownPreview";
 import { CopyIconButton } from "./CopyIconButton";
 
@@ -116,23 +116,23 @@ function StepContainer(props: StepContainerProps) {
         }}
       >
         {truncatedEarly && (
-          
             
-          
+          
         )}
 
         {props.index !== 1 && (
-          
             
-          
+          
         )}
 
         
 
-         sendFeedback(true)}
@@ -150,9 +150,9 @@ function StepContainer(props: StepContainerProps) {
           
-        
+        
 
-         sendFeedback(false)}
@@ -160,7 +160,7 @@ function StepContainer(props: StepContainerProps) {
           
-        
+        
       
); diff --git a/gui/src/components/mainInput/MentionList.tsx b/gui/src/components/mainInput/MentionList.tsx index a84294a23..84dbcf601 100644 --- a/gui/src/components/mainInput/MentionList.tsx +++ b/gui/src/components/mainInput/MentionList.tsx @@ -40,7 +40,7 @@ import { setDialogMessage, setShowDialog, } from "../../redux/slices/uiStateSlice"; -import ButtonWithTooltip from "../ButtonWithTooltip"; +import HeaderButtonWithToolTip from "../gui/HeaderButtonWithToolTip"; import FileIcon from "../FileIcon"; import SafeImg from "../SafeImg"; import AddDocsDialog from "../dialogs/AddDocsDialog"; @@ -375,7 +375,7 @@ const MentionList = forwardRef((props: MentionListProps, ref) => { onClick={() => selectItem(index)} onMouseEnter={() => setSelectedIndex(index)} > - +
{showFileIconForItem(item) && ( { opacity: index !== selectedIndex ? 0 : 1, minWidth: "30px", }} - className="whitespace-nowrap overflow-hidden overflow-ellipsis ml-2 flex items-center" + className="ml-2 flex items-center overflow-hidden overflow-ellipsis whitespace-nowrap" > {item.description} {item.type === "contextProvider" && @@ -414,7 +414,7 @@ const MentionList = forwardRef((props: MentionListProps, ref) => { {item.subActions?.map((subAction) => { const Icon = ICONS_FOR_DROPDOWN[subAction.icon]; return ( - { subAction.action(item); e.stopPropagation(); @@ -424,7 +424,7 @@ const MentionList = forwardRef((props: MentionListProps, ref) => { text={undefined} > - + ); })} diff --git a/gui/src/components/markdown/CodeSnippetPreview.tsx b/gui/src/components/markdown/CodeSnippetPreview.tsx index 62810b752..bd9f5b3a2 100644 --- a/gui/src/components/markdown/CodeSnippetPreview.tsx +++ b/gui/src/components/markdown/CodeSnippetPreview.tsx @@ -11,7 +11,7 @@ import styled from "styled-components"; import { defaultBorderRadius, lightGray, vscEditorBackground } from ".."; import { IdeMessengerContext } from "../../context/IdeMessenger"; import { getFontSize } from "../../util"; -import ButtonWithTooltip from "../ButtonWithTooltip"; +import HeaderButtonWithToolTip from "../gui/HeaderButtonWithToolTip"; import FileIcon from "../FileIcon"; import StyledMarkdownPreview from "./StyledMarkdownPreview"; @@ -49,7 +49,7 @@ interface CodeSnippetPreviewProps { editing?: boolean; } -const StyledHeaderButtonWithText = styled(ButtonWithTooltip)<{ +const StyledHeaderButtonWithText = styled(HeaderButtonWithToolTip)<{ color?: string; }>` ${(props) => props.color && `background-color: ${props.color};`} @@ -125,7 +125,7 @@ function CodeSnippetPreview(props: CodeSnippetPreviewProps) { )} - { e.stopPropagation(); @@ -133,7 +133,7 @@ function CodeSnippetPreview(props: CodeSnippetPreviewProps) { }} > - +
{(codeBlockRef.current?.scrollHeight ?? 0) > MAX_PREVIEW_HEIGHT && ( - @@ -166,7 +166,7 @@ function CodeSnippetPreview(props: CodeSnippetPreviewProps) { onClick={() => setCollapsed(true)} /> )} - + )} ); diff --git a/gui/src/components/markdown/StepContainerPreActionButtons.tsx b/gui/src/components/markdown/StepContainerPreActionButtons.tsx new file mode 100644 index 000000000..c3d2eda6a --- /dev/null +++ b/gui/src/components/markdown/StepContainerPreActionButtons.tsx @@ -0,0 +1,130 @@ +import { useContext, useRef, useState } from "react"; +import styled from "styled-components"; +import { + CommandLineIcon, + PlayIcon, + ArrowLeftEndOnRectangleIcon, +} from "@heroicons/react/24/outline"; +import { defaultBorderRadius, vscEditorBackground } from ".."; +import { IdeMessengerContext } from "../../context/IdeMessenger"; +import { isJetBrains } from "../../util"; +import { isTerminalCodeBlock } from "./utils"; +import HeaderButtonWithToolTip from "../gui/HeaderButtonWithToolTip"; +import { CopyIconButton } from "../gui/CopyIconButton"; +import useUIConfig from "../../hooks/useUIConfig"; +import { v4 as uuidv4 } from "uuid"; +import { useApplyCodeBlock } from "./utils/useApplyCodeBlock"; + +const TopDiv = styled.div` + outline: 0.5px solid rgba(153, 153, 152); + outline-offset: -0.5px; + border-radius: ${defaultBorderRadius}; + margin-bottom: 8px; + background-color: ${vscEditorBackground}; +`; + +const HoverDiv = styled.div` + position: sticky; + top: 0; + left: 100%; + height: 0; + width: 0; + overflow: visible; + z-index: 100; +`; + +const InnerHoverDiv = styled.div<{ isBottomToolbarPosition: boolean }>` + position: absolute; + ${(props) => (props.isBottomToolbarPosition ? "bottom: 3px;" : "top: -11px;")} + right: 10px; + display: flex; + padding: 1px 2px; + gap: 4px; + border: 0.5px solid #8888; + border-radius: ${defaultBorderRadius}; + background-color: ${vscEditorBackground}; +`; + +interface StepContainerPreActionButtonsProps { + language: string; + codeBlockContent: string; + filepath: string; + children: any; +} + +export default function StepContainerPreActionButtons({ + language, + codeBlockContent, + filepath, + children, +}: StepContainerPreActionButtonsProps) { + const [hovering, setHovering] = useState(false); + const ideMessenger = useContext(IdeMessengerContext); + const uiConfig = useUIConfig(); + const streamIdRef = useRef(null); + const onClickApply = useApplyCodeBlock({ + filepath, + codeBlockContent, + streamId: streamIdRef.current, + }); + + const isBottomToolbarPosition = + uiConfig?.codeBlockToolbarPosition == "bottom"; + const isTerminal = isTerminalCodeBlock(language, codeBlockContent); + + if (streamIdRef.current === null) { + streamIdRef.current = uuidv4(); + } + + if (!hovering) { + return ( + setHovering(true)} + onMouseLeave={() => setHovering(false)} + > + {children} + + ); + } + + return ( + setHovering(true)} + onMouseLeave={() => setHovering(false)} + > + + + {!isJetBrains() && isTerminal && ( + + + + )} + + + + + ideMessenger.post("insertAtCursor", { text: codeBlockContent }) + } + > + + + + + + {children} + + ); +} diff --git a/gui/src/components/markdown/StepContainerPreToolbar/ApplyActions.tsx b/gui/src/components/markdown/StepContainerPreToolbar/ApplyActions.tsx index d845e26e7..c303c2aa6 100644 --- a/gui/src/components/markdown/StepContainerPreToolbar/ApplyActions.tsx +++ b/gui/src/components/markdown/StepContainerPreToolbar/ApplyActions.tsx @@ -52,8 +52,6 @@ export default function ApplyActions(props: ApplyActionsProps) {
); case "closed": - // We show a codeblock as being "applied" whenever all individual diffs - // have been accepted/rejected, or when a user has explicitly accepted the entire block. if (!hasRejected && props.applyState.numDiffs === 0) { return ( diff --git a/gui/src/components/markdown/StepContainerPreToolbar/CodeBlockToolbar(OLD).tsx b/gui/src/components/markdown/StepContainerPreToolbar/CodeBlockToolbar(OLD).tsx index a7a82a13a..9e495d1ae 100644 --- a/gui/src/components/markdown/StepContainerPreToolbar/CodeBlockToolbar(OLD).tsx +++ b/gui/src/components/markdown/StepContainerPreToolbar/CodeBlockToolbar(OLD).tsx @@ -10,7 +10,7 @@ import { RootState } from "../../../redux/store"; import { getFontSize, isJetBrains } from "../../../util"; import ApplyStateControls from "./ApplyActions"; import FileInfo from "./FileInfo"; -import { isTerminalCodeBlock } from "./utils"; +import { isTerminalCodeBlock } from "../utils"; interface CodeBlockWithToolBarProps { text: string; diff --git a/gui/src/components/markdown/StepContainerPreToolbar/StepContainerPreToolbar.tsx b/gui/src/components/markdown/StepContainerPreToolbar/StepContainerPreToolbar.tsx index f52b2215c..cd87c651e 100644 --- a/gui/src/components/markdown/StepContainerPreToolbar/StepContainerPreToolbar.tsx +++ b/gui/src/components/markdown/StepContainerPreToolbar/StepContainerPreToolbar.tsx @@ -1,20 +1,12 @@ import { debounce } from "lodash"; import { useContext, useEffect, useRef, useState } from "react"; import { useWebviewListener } from "../../../hooks/useWebviewListener"; -import { - incrementNextCodeBlockToApplyIndex, - updateApplyState, -} from "../../../redux/slices/uiStateSlice"; +import { updateApplyState } from "../../../redux/slices/uiStateSlice"; import { useDispatch, useSelector } from "react-redux"; import { RootState } from "../../../redux/store"; import { IdeMessengerContext } from "../../../context/IdeMessenger"; -import { - childrenToText, - getTerminalCommand, - isTerminalCodeBlock, -} from "./utils"; +import { childrenToText } from "../utils"; import { v4 as uuidv4 } from "uuid"; -import { defaultModelSelector } from "../../../redux/selectors/modelSelectors"; import { defaultBorderRadius, lightGray, vscEditorBackground } from "../.."; import { getFontSize } from "../../../util"; import FileInfo from "./FileInfo"; @@ -23,7 +15,7 @@ import Spinner from "./Spinner"; import ApplyActions from "./ApplyActions"; import { ChevronDownIcon } from "@heroicons/react/24/outline"; import CopyButton from "./CopyButton"; -import { ApplyState } from "core/protocol/ideWebview"; +import { useApplyCodeBlock } from "../utils/useApplyCodeBlock"; const TopDiv = styled.div` outline: 1px solid rgba(153, 153, 152); @@ -61,10 +53,14 @@ export default function StepContainerPreToolbar( const ideMessenger = useContext(IdeMessengerContext); const streamIdRef = useRef(null); const wasGeneratingRef = useRef(props.isGeneratingCodeBlock); - const defaultModel = useSelector(defaultModelSelector); const [isExpanded, setIsExpanded] = useState(false); const [codeBlockContent, setCodeBlockContent] = useState(""); const isChatActive = useSelector((state: RootState) => state.state.active); + const onClickApply = useApplyCodeBlock({ + streamId: streamIdRef.current, + filepath: props.filepath, + codeBlockContent: props.codeBlockContent, + }); const nextCodeBlockIndex = useSelector( (state: RootState) => state.uiState.nextCodeBlockToApplyIndex, ); @@ -75,10 +71,6 @@ export default function StepContainerPreToolbar( ), ); - // console.log( - // `[StepContainerPreToolbar] streamId: ${applyState && applyState.streamId} numDiffs: ${applyState && applyState.numDiffs}`, - // ); - const isMultifileEdit = true; // TODO: Pull from Redux state const numLinesCodeBlock = props.codeBlockContent.split("\n").length; @@ -135,24 +127,6 @@ export default function StepContainerPreToolbar( wasGeneratingRef.current = isGeneratingCodeBlock; }, [isGeneratingCodeBlock]); - async function onClickApply() { - dispatch( - updateApplyState({ - streamId: streamIdRef.current, - status: "streaming", - }), - ); - - await ideMessenger.request("applyToFile", { - text: codeBlockContent, - streamId: streamIdRef.current, - curSelectedModelTitle: defaultModel.title, - filepath: props.filepath, - }); - - dispatch(incrementNextCodeBlockToApplyIndex({})); - } - function onClickAcceptApply() { ideMessenger.post("acceptDiff", { filepath: props.filepath }); dispatch( @@ -177,7 +151,8 @@ export default function StepContainerPreToolbar( setIsExpanded(!isExpanded); } - // If we don't have a file extension, we don't render any toolbar + // We want until there is an extension in the filepath to avoid rendering + // an incomplete filepath if (!hasFileExtension) { return props.children; } diff --git a/gui/src/components/markdown/StyledMarkdownPreview.tsx b/gui/src/components/markdown/StyledMarkdownPreview.tsx index 5397c990e..8d0c6dc01 100644 --- a/gui/src/components/markdown/StyledMarkdownPreview.tsx +++ b/gui/src/components/markdown/StyledMarkdownPreview.tsx @@ -11,7 +11,7 @@ import { vscEditorBackground, vscForeground, } from ".."; -import { getFontSize } from "../../util"; +import { getFontSize, isJetBrains } from "../../util"; import "./katex.css"; import "./markdown.css"; import { useSelector } from "react-redux"; @@ -20,6 +20,7 @@ import { ctxItemToRifWithContents } from "core/commands/util"; import FilenameLink from "./FilenameLink"; import StepContainerPreToolbar from "./StepContainerPreToolbar"; import { SyntaxHighlightedPre } from "./SyntaxHighlightedPre"; +import StepContainerPreActionButtons from "./StepContainerPreActionButtons"; const StyledMarkdown = styled.div<{ fontSize?: number; @@ -194,22 +195,47 @@ const StyledMarkdownPreview = memo(function StyledMarkdownPreview( codeBlockContent, } = preProps?.children?.[0]?.props; - if (!filepath || !props.isRenderingInStepContainer) { + if (!props.isRenderingInStepContainer) { return ; } - // We use a custom toolbar for codeblocks in the step container + const language = getLanuageFromClassName(className); + return ( - - + ); + + // // We don't support "lazy" applies in JB yet + // if (!filepath || isJetBrains()) { + // return ( + // + // + // + // ); + // } + + // // We use a custom toolbar for codeblocks in the step container + // return ( + // + // + // + // ); }, code: ({ node, ...codeProps }) => { const content = getCodeChildrenContent(codeProps.children); diff --git a/gui/src/components/markdown/StepContainerPreToolbar/utils.ts b/gui/src/components/markdown/utils/index.ts similarity index 100% rename from gui/src/components/markdown/StepContainerPreToolbar/utils.ts rename to gui/src/components/markdown/utils/index.ts diff --git a/gui/src/components/markdown/utils/useApplyCodeBlock.ts b/gui/src/components/markdown/utils/useApplyCodeBlock.ts new file mode 100644 index 000000000..02eee9364 --- /dev/null +++ b/gui/src/components/markdown/utils/useApplyCodeBlock.ts @@ -0,0 +1,44 @@ +import { useContext } from "react"; +import { useDispatch, useSelector } from "react-redux"; +import { IdeMessengerContext } from "../../../context/IdeMessenger"; +import { + incrementNextCodeBlockToApplyIndex, + updateApplyState, +} from "../../../redux/slices/uiStateSlice"; +import { defaultModelSelector } from "../../../redux/selectors/modelSelectors"; + +export interface useApplyCodeBlock { + streamId: string; + filepath: string; + codeBlockContent: string; +} + +export function useApplyCodeBlock({ + streamId, + filepath, + codeBlockContent, +}: useApplyCodeBlock) { + const dispatch = useDispatch(); + const ideMessenger = useContext(IdeMessengerContext); + const defaultModel = useSelector(defaultModelSelector); + + const applyCodeBlock = async () => { + dispatch( + updateApplyState({ + streamId, + status: "streaming", + }), + ); + + await ideMessenger.request("applyToFile", { + text: codeBlockContent, + streamId, + curSelectedModelTitle: defaultModel.title, + filepath, + }); + + dispatch(incrementNextCodeBlockToApplyIndex({})); + }; + + return applyCodeBlock; +} diff --git a/gui/src/components/modelSelection/ModelCard.tsx b/gui/src/components/modelSelection/ModelCard.tsx index 8f9d7b16b..35891df79 100644 --- a/gui/src/components/modelSelection/ModelCard.tsx +++ b/gui/src/components/modelSelection/ModelCard.tsx @@ -9,7 +9,7 @@ import { } from ".."; import { PackageDimension } from "../../pages/AddNewModel/configs/models"; import { providers } from "../../pages/AddNewModel/configs/providers"; -import ButtonWithTooltip from "../ButtonWithTooltip"; +import HeaderButtonWithToolTip from "../gui/HeaderButtonWithToolTip"; import InfoHover from "../InfoHover"; import { ModelProviderTag } from "./ModelProviderTag"; import { ModelProviderTags } from "./utils"; @@ -43,11 +43,11 @@ const Div = styled.div<{ color: string; disabled: boolean; hovered: boolean }>` opacity: 0.5; ` : props.hovered - ? ` + ? ` border: 1px solid ${props.color}; background-color: ${props.color}22; cursor: pointer;` - : ""} + : ""} `; const DimensionsDiv = styled.div` @@ -148,9 +148,7 @@ function ModelCard(props: ModelCardProps) {

{props.title}

- {props.tags?.map((tag, i) => ( - - ))} + {props.tags?.map((tag, i) => )}

{props.description}

@@ -164,9 +162,9 @@ function ModelCard(props: ModelCardProps) { href={props.refUrl} target="_blank" > - + - + )}
@@ -179,7 +177,7 @@ function ModelCard(props: ModelCardProps) {
-

{dimension.name}

+

{dimension.name}

{Object.keys(dimension.options).map((key) => { @@ -204,7 +202,7 @@ function ModelCard(props: ModelCardProps) { ); })} {props.providerOptions?.length && ( -
+
-
+
{props.providerOptions?.map((option, i) => { const info = providers[option]; if (!info) { return null; } return ( - )} - + ); })}
diff --git a/gui/src/pages/monaco.tsx b/gui/src/pages/monaco.tsx index 1e1e9879f..c0cfbd8ec 100644 --- a/gui/src/pages/monaco.tsx +++ b/gui/src/pages/monaco.tsx @@ -3,7 +3,7 @@ import { DiffEditor } from "@monaco-editor/react"; import React, { useContext, useEffect } from "react"; import { v4 } from "uuid"; import { vscInputBackground } from "../components"; -import ButtonWithTooltip from "../components/ButtonWithTooltip"; +import HeaderButtonWithToolTip from "../components/gui/HeaderButtonWithToolTip"; import { IdeMessengerContext } from "../context/IdeMessenger"; interface EditorFrameProps { @@ -37,7 +37,7 @@ function EditorFrame(props: EditorFrameProps) { return (
- {}}> + {}}> - - {}}> + + {}}> - +
{/*