diff --git a/core/config/yaml/loadYaml.ts b/core/config/yaml/loadYaml.ts index 1ca54337b..949e963e9 100644 --- a/core/config/yaml/loadYaml.ts +++ b/core/config/yaml/loadYaml.ts @@ -206,7 +206,6 @@ async function configYamlToContinueConfig( continueConfig.systemMessage, ); - // if (modelsArrayRoles.some((role) => model.roles?.includes(role))) { continueConfig.models.push(...llms); } @@ -244,7 +243,10 @@ async function configYamlToContinueConfig( } else { continueConfig.modelsByRole.embed.push( new embeddingsProviderClass( - options, + { + ...options, + title: options.name, + }, (url: string | URL, init: any) => fetchwithRequestOptions(url, init, { ...options.requestOptions, @@ -265,10 +267,15 @@ async function configYamlToContinueConfig( const rerankerClass = AllRerankers[provider]; if (rerankerClass) { continueConfig.modelsByRole.rerank.push( - new rerankerClass(options, (url: string | URL, init: any) => - fetchwithRequestOptions(url, init, { - ...options.requestOptions, - }), + new rerankerClass( + { + ...options, + title: options.name, + }, + (url: string | URL, init: any) => + fetchwithRequestOptions(url, init, { + ...options.requestOptions, + }), ), ); } else { diff --git a/core/llm/llms/TransformersJsEmbeddingsProvider.ts b/core/llm/llms/TransformersJsEmbeddingsProvider.ts index d17c9e0f1..7bd7b78ec 100644 --- a/core/llm/llms/TransformersJsEmbeddingsProvider.ts +++ b/core/llm/llms/TransformersJsEmbeddingsProvider.ts @@ -43,14 +43,16 @@ export class TransformersJsEmbeddingsProvider extends BaseLLM { static maxGroupSize: number = 1; static model: string = "all-MiniLM-L6-v2"; static mockVector: number[] = Array.from({ length: 384 }).fill(2) as number[]; - static title: string = "Transformers.js (Built-In)"; static defaultOptions: Partial | undefined = { model: TransformersJsEmbeddingsProvider.model, }; constructor() { - super({ model: TransformersJsEmbeddingsProvider.model }); + super({ + model: TransformersJsEmbeddingsProvider.model, + title: "Transformers.js (Built-In)", + }); } async embed(chunks: string[]) { diff --git a/gui/src/components/index.ts b/gui/src/components/index.ts index e4aad87c2..5c00bcb5c 100644 --- a/gui/src/components/index.ts +++ b/gui/src/components/index.ts @@ -153,13 +153,12 @@ export const SecondaryButton = styled.button` export const GhostButton = styled.button` padding: 6px 8px; - margin: 8px 0; + margin: 6px 0; border-radius: ${defaultBorderRadius}; border: none; color: ${vscForeground}; - background-color: transparent; - + background-color: rgba(255, 255, 255, 0.08); &:disabled { color: gray; pointer-events: none; @@ -167,7 +166,7 @@ export const GhostButton = styled.button` &:hover:enabled { cursor: pointer; - background-color: rgba(255, 255, 255, 0.08); /* Subtle hover effect */ + filter: brightness(125%); } `; diff --git a/gui/src/components/mainInput/Lump/index.tsx b/gui/src/components/mainInput/Lump/index.tsx index f12e35c4d..5c53fd6f8 100644 --- a/gui/src/components/mainInput/Lump/index.tsx +++ b/gui/src/components/mainInput/Lump/index.tsx @@ -5,6 +5,7 @@ import { vscCommandCenterInactiveBorder, vscInputBackground, } from "../.."; +import { useAppSelector } from "../../../redux/hooks"; import { LumpToolbar } from "./LumpToolbar"; import { SelectedSection } from "./sections/SelectedSection"; @@ -39,6 +40,7 @@ export function Lump(props: LumpProps) { const [selectedSection, setSelectedSection] = useState(null); const [displayedSection, setDisplayedSection] = useState(null); const [isVisible, setIsVisible] = useState(false); + const isStreaming = useAppSelector((state) => state.session.isStreaming); useEffect(() => { if (selectedSection) { @@ -71,7 +73,9 @@ export function Lump(props: LumpProps) { hasSection={!!selectedSection} isVisible={isVisible} > - + {!isStreaming && ( + + )} diff --git a/gui/src/components/mainInput/Lump/sections/AddBlockButton.tsx b/gui/src/components/mainInput/Lump/sections/ExploreBlocksButton.tsx similarity index 64% rename from gui/src/components/mainInput/Lump/sections/AddBlockButton.tsx rename to gui/src/components/mainInput/Lump/sections/ExploreBlocksButton.tsx index b409d160f..ad2212ac7 100644 --- a/gui/src/components/mainInput/Lump/sections/AddBlockButton.tsx +++ b/gui/src/components/mainInput/Lump/sections/ExploreBlocksButton.tsx @@ -1,5 +1,9 @@ -import { PlusIcon } from "@heroicons/react/24/outline"; +import { + ArrowTopRightOnSquareIcon, + PlusIcon, +} from "@heroicons/react/24/outline"; import { useContext } from "react"; +import { GhostButton } from "../../.."; import { useAuth } from "../../../../context/Auth"; import { IdeMessengerContext } from "../../../../context/IdeMessenger"; import { useAppDispatch } from "../../../../redux/hooks"; @@ -10,13 +14,22 @@ import { import { fontSize } from "../../../../util"; import AddDocsDialog from "../../../dialogs/AddDocsDialog"; -export function AddBlockButton(props: { blockType: string }) { +export function ExploreBlocksButton(props: { blockType: string }) { const { selectedProfile } = useAuth(); const ideMessenger = useContext(IdeMessengerContext); const dispatch = useAppDispatch(); + const isLocal = selectedProfile?.profileType === "local"; + + const Icon = isLocal ? PlusIcon : ArrowTopRightOnSquareIcon; + const text = `${isLocal ? "Add" : "Explore"} ${ + props.blockType === "mcpServers" + ? "MCP Servers" + : props.blockType.charAt(0).toUpperCase() + props.blockType.slice(1) + }`; + const handleClick = () => { - if (selectedProfile?.profileType === "local") { + if (isLocal) { switch (props.blockType) { case "docs": dispatch(setShowDialog(true)); @@ -36,8 +49,8 @@ export function AddBlockButton(props: { blockType: string }) { }; return ( -
- Add + {text}
-
+ ); } diff --git a/gui/src/components/mainInput/Lump/sections/PromptsSection.tsx b/gui/src/components/mainInput/Lump/sections/PromptsSection.tsx index 38ce05209..21a3e294b 100644 --- a/gui/src/components/mainInput/Lump/sections/PromptsSection.tsx +++ b/gui/src/components/mainInput/Lump/sections/PromptsSection.tsx @@ -5,7 +5,7 @@ import { import { BookmarkIcon as BookmarkSolid } from "@heroicons/react/24/solid"; import { fontSize } from "../../../../util"; import { useBookmarkedSlashCommands } from "../../../ConversationStarters/useBookmarkedSlashCommands"; -import { AddBlockButton } from "./AddBlockButton"; +import { ExploreBlocksButton } from "./ExploreBlocksButton"; interface PromptRowProps { command: string; @@ -24,7 +24,7 @@ function PromptRow({ }: PromptRowProps) { return (
setIsBookmarked(!isBookmarked)} - className="cursor-pointer pt-0.5 text-gray-400" + className="cursor-pointer pt-0.5 text-gray-400 hover:brightness-125" > {isBookmarked ? ( @@ -74,7 +74,7 @@ export function PromptsSection() { onEdit={() => handleEdit(prompt)} /> ))} - +
); } diff --git a/gui/src/components/mainInput/Lump/sections/RulesSection.tsx b/gui/src/components/mainInput/Lump/sections/RulesSection.tsx index 200472b22..bb96ee6d7 100644 --- a/gui/src/components/mainInput/Lump/sections/RulesSection.tsx +++ b/gui/src/components/mainInput/Lump/sections/RulesSection.tsx @@ -1,14 +1,19 @@ import { parseConfigYaml } from "@continuedev/config-yaml"; -import { PencilIcon } from "@heroicons/react/24/outline"; +import { ArrowsPointingOutIcon, PencilIcon } from "@heroicons/react/24/outline"; import { useContext, useMemo } from "react"; import { useSelector } from "react-redux"; import { defaultBorderRadius, vscCommandCenterActiveBorder } from "../../.."; import { useAuth } from "../../../../context/Auth"; import { IdeMessengerContext } from "../../../../context/IdeMessenger"; +import { useAppDispatch } from "../../../../redux/hooks"; +import { + setDialogMessage, + setShowDialog, +} from "../../../../redux/slices/uiSlice"; import { RootState } from "../../../../redux/store"; import { fontSize } from "../../../../util"; import HeaderButtonWithToolTip from "../../../gui/HeaderButtonWithToolTip"; -import { AddBlockButton } from "./AddBlockButton"; +import { ExploreBlocksButton } from "./ExploreBlocksButton"; interface RuleCardProps { index: number; @@ -18,12 +23,19 @@ interface RuleCardProps { } const RuleCard: React.FC = ({ index, rule, onClick, title }) => { - const truncateRule = (rule: string) => { - const maxLength = 75; - return rule.length > maxLength - ? `${rule.substring(0, maxLength)}...` - : rule; - }; + const dispatch = useAppDispatch(); + + function onClickExpand() { + dispatch(setShowDialog(true)); + dispatch( + setDialogMessage( +
+

{title}

+
{rule}
+
, + ), + ); + } return (
= ({ index, rule, onClick, title }) => { }} className="px-2 py-1 transition-colors" > -
-
-
- {title} +
+
+
+
+ {title} +
+
+ {rule} +
-
- {truncateRule(rule)} +
+ + + {" "} + + +
- - -
); @@ -86,63 +104,60 @@ export function RulesSection() { }); return ( -
- {mergedRules.length === 0 ? ( -
-

No rules defined yet

-
- ) : ( -
- {mergedRules.map((rule, index) => { - if (!rule.ruleFromYaml) { - return ( - - ideMessenger.post("config/openProfile", { - profileId: undefined, - }) - } - title="Locally Defined Rule" - /> - ); - } +
+
+ {mergedRules.map((rule, index) => { + if (!rule.ruleFromYaml) { + return ( + + ideMessenger.post("config/openProfile", { + profileId: undefined, + }) + } + title="Locally Defined Rule" + /> + ); + } - if (typeof rule.ruleFromYaml === "string") { - const slug = `${selectedProfile?.fullSlug.ownerSlug}/${selectedProfile?.fullSlug.packageSlug}`; - - return ( - openUrl(`${slug}/new-version`)} - title="Inline Rule" - /> - ); - } - - if (!rule.ruleFromYaml?.uses) { - return null; - } - - const ruleSlug = rule.ruleFromYaml?.uses; + if (typeof rule.ruleFromYaml === "string") { + const slug = `${selectedProfile?.fullSlug.ownerSlug}/${selectedProfile?.fullSlug.packageSlug}`; return ( openUrl(`${ruleSlug}/new-version`)} - title={ruleSlug} + onClick={() => openUrl(`${slug}/new-version`)} + title="Inline Rule" /> ); - })} -
- )} - + } + + if (!rule.ruleFromYaml?.uses) { + return null; + } + + const ruleSlug = rule.ruleFromYaml?.uses; + + return ( + openUrl(`${ruleSlug}/new-version`)} + title={ruleSlug} + /> + ); + })} +
+
); } +function useTypedDispatch() { + throw new Error("Function not implemented."); +} diff --git a/gui/src/components/mainInput/Lump/sections/docs/DocsIndexingStatus.tsx b/gui/src/components/mainInput/Lump/sections/docs/DocsIndexingStatus.tsx index 025ec6a5e..6a4215c2e 100644 --- a/gui/src/components/mainInput/Lump/sections/docs/DocsIndexingStatus.tsx +++ b/gui/src/components/mainInput/Lump/sections/docs/DocsIndexingStatus.tsx @@ -1,7 +1,6 @@ import { ConfigYaml } from "@continuedev/config-yaml"; import { ArrowPathIcon, - ArrowTopRightOnSquareIcon, PencilIcon, StopIcon, } from "@heroicons/react/24/outline"; @@ -140,7 +139,6 @@ function DocsIndexingStatus({ > {docConfig.title ?? docConfig.startUrl}

-
diff --git a/gui/src/components/mainInput/Lump/sections/docs/DocsSection.tsx b/gui/src/components/mainInput/Lump/sections/docs/DocsSection.tsx index 4349c9498..7a6bccb93 100644 --- a/gui/src/components/mainInput/Lump/sections/docs/DocsSection.tsx +++ b/gui/src/components/mainInput/Lump/sections/docs/DocsSection.tsx @@ -4,7 +4,7 @@ import { useMemo } from "react"; import { useDispatch } from "react-redux"; import { useAuth } from "../../../../../context/Auth"; import { useAppSelector } from "../../../../../redux/hooks"; -import { AddBlockButton } from "../AddBlockButton"; +import { ExploreBlocksButton } from "../ExploreBlocksButton"; import DocsIndexingStatus from "./DocsIndexingStatus"; function DocsIndexingStatuses() { @@ -70,7 +70,7 @@ function DocsIndexingStatuses() { ); })}
- +
); } diff --git a/gui/src/pages/config/MCPServersPreview.tsx b/gui/src/pages/config/MCPServersPreview.tsx index c34837f03..bf83043b2 100644 --- a/gui/src/pages/config/MCPServersPreview.tsx +++ b/gui/src/pages/config/MCPServersPreview.tsx @@ -8,7 +8,7 @@ import { import { MCPServerStatus } from "core"; import { useContext } from "react"; import { ToolTip } from "../../components/gui/Tooltip"; -import { AddBlockButton } from "../../components/mainInput/Lump/sections/AddBlockButton"; +import { ExploreBlocksButton } from "../../components/mainInput/Lump/sections/ExploreBlocksButton"; import { IdeMessengerContext } from "../../context/IdeMessenger"; import { useAppDispatch, useAppSelector } from "../../redux/hooks"; import { updateConfig } from "../../redux/slices/configSlice"; @@ -55,7 +55,7 @@ function MCPServerPreview({ server }: MCPServerStatusProps) { >
{/* Name and Status */} -

{server.name}

+ {server.name} {/* Error indicator if any */} {server.errors.length ? ( @@ -153,7 +153,6 @@ function MCPServersPreview() { const servers = useAppSelector( (store) => store.config.config.mcpServerStatuses, ); - const ideMessenger = useContext(IdeMessengerContext); return (
@@ -162,7 +161,7 @@ function MCPServersPreview() { ))}
- +
); }