diff --git a/.continue/rules/migrate-styled-components-to-tailwind.md b/.continue/rules/migrate-styled-components-to-tailwind.md
new file mode 100644
index 000000000..0432f9a8d
--- /dev/null
+++ b/.continue/rules/migrate-styled-components-to-tailwind.md
@@ -0,0 +1,5 @@
+---
+alwaysApply: false
+---
+
+Convert all of the styled components in this file into tailwind CSS. If a variable is used that is not already in @theme.ts and @tailwind.config.cjs, then you should figure out where it comes from and try adding that so it can be used. Wherever a function is called to interpolate a value, you can just use inline `styles={{ ... }}`. For ternaries, you could use @cn.ts.
diff --git a/gui/src/components/AssistantAndOrgListbox/shared.tsx b/gui/src/components/AssistantAndOrgListbox/shared.tsx
index 1f57a4309..0cd897b5e 100644
--- a/gui/src/components/AssistantAndOrgListbox/shared.tsx
+++ b/gui/src/components/AssistantAndOrgListbox/shared.tsx
@@ -6,11 +6,8 @@ import {
} from "@heroicons/react/24/outline";
import { useState } from "react";
import styled from "styled-components";
-import {
- defaultBorderRadius,
- lightGray,
- vscCommandCenterInactiveBorder,
-} from "..";
+import { lightGray } from "..";
+import { cn } from "../../util/cn";
import { ToolTip } from "../gui/Tooltip";
export const OptionDiv = styled.div<{
@@ -47,11 +44,6 @@ export const OptionDiv = styled.div<{
export const MAX_HEIGHT_PX = 300;
-export const Divider = styled.div`
- height: 0.5px;
- background-color: ${vscCommandCenterInactiveBorder};
-`;
-
interface ModelOptionProps {
children: React.ReactNode;
idx: number;
@@ -64,28 +56,81 @@ interface ModelOptionProps {
onClickError?: (e: any) => void;
}
-const IconBase = styled.div<{ $hovered: boolean }>`
- width: 1.2em;
- height: 1.2em;
- cursor: pointer;
- padding: 4px;
- border-radius: ${defaultBorderRadius};
- opacity: ${(props) => (props.$hovered ? 0.75 : 0)};
- visibility: ${(props) => (props.$hovered ? "visible" : "hidden")};
+interface IconBaseProps {
+ $hovered: boolean;
+ onClick?: (e: any) => void;
+ className?: string;
+ children?: React.ReactNode;
+ [key: string]: any;
+}
- &:hover {
- opacity: 1;
- background-color: ${lightGray}33;
- }
-`;
+function IconBase({
+ $hovered,
+ onClick,
+ className,
+ children,
+ ...props
+}: IconBaseProps) {
+ return (
+
+ {children}
+
+ );
+}
-const StyledCog6ToothIcon = styled(IconBase).attrs({ as: Cog6ToothIcon })``;
-const StyledArrowTopRightOnSquareIcon = styled(IconBase).attrs({
- as: ArrowTopRightOnSquareIcon,
-})``;
-const StyledExclamationTriangleIcon = styled(IconBase).attrs({
- as: ExclamationTriangleIcon,
-})``;
+const StyledCog6ToothIcon = ({
+ $hovered,
+ onClick,
+}: {
+ $hovered: boolean;
+ onClick?: (e: any) => void;
+}) => (
+
+
+
+);
+
+const StyledArrowTopRightOnSquareIcon = ({
+ $hovered,
+ onClick,
+}: {
+ $hovered: boolean;
+ onClick?: (e: any) => void;
+}) => (
+
+
+
+);
+
+const StyledExclamationTriangleIcon = ({
+ $hovered,
+ onClick,
+ className,
+ ...props
+}: {
+ $hovered: boolean;
+ onClick?: (e: any) => void;
+ className?: string;
+ [key: string]: any;
+}) => (
+
+
+
+);
export function Option({
children,
diff --git a/gui/src/components/Footer.tsx b/gui/src/components/Footer.tsx
deleted file mode 100644
index 35fe7fa56..000000000
--- a/gui/src/components/Footer.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import { useAppSelector } from "../redux/hooks";
-import { selectSelectedChatModel } from "../redux/slices/configSlice";
-
-function Footer() {
- const defaultModel = useAppSelector(selectSelectedChatModel);
-
- // TODO hook hub up to free trial
- // if (defaultModel?.provider === "free-trial") {
- // return (
- //
- // );
- // }
- return null;
-}
-
-export default Footer;
diff --git a/gui/src/components/Layout.tsx b/gui/src/components/Layout.tsx
index e37d245cd..e072f0f1b 100644
--- a/gui/src/components/Layout.tsx
+++ b/gui/src/components/Layout.tsx
@@ -17,7 +17,6 @@ import { incrementFreeTrialCount } from "../util/freeTrial";
import { ROUTES } from "../util/navigation";
import { FatalErrorIndicator } from "./config/FatalErrorNotice";
import TextDialog from "./dialogs";
-import Footer from "./Footer";
import { GenerateRuleDialog } from "./GenerateRuleDialog";
import { LumpProvider } from "./mainInput/Lump/LumpContext";
import { useMainEditor } from "./mainInput/TipTapEditor";
@@ -261,7 +260,6 @@ const Layout = () => {
-
diff --git a/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/ToolbarButtonWithTooltip.tsx b/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/ToolbarButtonWithTooltip.tsx
index 6950ee415..58f05ef0c 100644
--- a/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/ToolbarButtonWithTooltip.tsx
+++ b/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/ToolbarButtonWithTooltip.tsx
@@ -1,25 +1,7 @@
import { ReactNode, useMemo } from "react";
import { Tooltip } from "react-tooltip";
-import styled from "styled-components";
-import { lightGray, vscForeground } from "../..";
import { getFontSize } from "../../../util";
-export const ToolbarButton = styled.button`
- display: flex;
- align-items: center;
- border: none;
- outline: none;
- background: transparent;
-
- color: ${vscForeground};
- font-size: ${getFontSize() - 2}px;
-
- &:hover {
- cursor: pointer;
- filter: brightness(1.25);
- }
-`;
-
interface ToolbarButtonWithTooltipProps {
onClick: () => void;
children: ReactNode;
@@ -40,15 +22,17 @@ export function ToolbarButtonWithTooltip({
return (
<>
-
{children}
-
+
{tooltipContent}
diff --git a/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx b/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx
index f5737c78e..8ece216bb 100644
--- a/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx
+++ b/gui/src/components/StyledMarkdownPreview/StepContainerPreToolbar/index.tsx
@@ -1,12 +1,6 @@
import { ChevronDownIcon } from "@heroicons/react/24/outline";
import { inferResolvedUriFromRelativePath } from "core/util/ideUtils";
import { useContext, useEffect, useMemo, useState } from "react";
-import styled from "styled-components";
-import {
- defaultBorderRadius,
- vscCommandCenterInactiveBorder,
- vscEditorBackground,
-} from "../..";
import { IdeMessengerContext } from "../../../context/IdeMessenger";
import { useIdeMessengerRequest } from "../../../hooks/useIdeMessengerRequest";
import { useWebviewListener } from "../../../hooks/useWebviewListener";
@@ -25,29 +19,6 @@ import { FileInfo } from "./FileInfo";
import { InsertButton } from "./InsertButton";
import { RunInTerminalButton } from "./RunInTerminalButton";
-const TopDiv = styled.div`
- display: flex;
- flex-direction: column;
- outline: 1px solid ${vscCommandCenterInactiveBorder};
- outline-offset: -0.5px;
- border-radius: ${defaultBorderRadius};
- margin-bottom: 8px !important;
- margin-top: 8px !important;
- background-color: ${vscEditorBackground};
- min-width: 0;
-`;
-
-const ToolbarDiv = styled.div<{ isExpanded: boolean }>`
- display: flex;
- justify-content: space-between;
- align-items: center;
- font-size: ${getFontSize() - 2}px;
- padding: 4px 6px;
- margin: 0;
- border-bottom: ${({ isExpanded }) =>
- isExpanded ? `1px solid ${vscCommandCenterInactiveBorder}` : "inherit"};
-`;
-
export interface StepContainerPreToolbarProps {
codeBlockContent: string;
language: string | null;
@@ -290,9 +261,12 @@ export function StepContainerPreToolbar({
}
return (
-
-
-
+
+
+
setIsExpanded(!isExpanded)}
@@ -323,11 +297,11 @@ export function StepContainerPreToolbar({
{renderActionButtons()}
-
+
{isExpanded && (
{children}
)}
-
+
);
}
diff --git a/gui/src/util/cn.ts b/gui/src/util/cn.ts
index a5ef19350..ed267ad72 100644
--- a/gui/src/util/cn.ts
+++ b/gui/src/util/cn.ts
@@ -1,6 +1,20 @@
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
+/**
+ * Combines multiple class values and merges Tailwind CSS classes.
+ *
+ * This utility function combines the functionality of clsx (for conditional class names)
+ * and tailwind-merge (for intelligently merging Tailwind CSS classes, removing duplicates
+ * and conflicts).
+ *
+ * @param inputs - Class values that can be strings, objects, arrays, or conditional expressions
+ * @returns A merged string of class names with Tailwind conflicts resolved
+ *
+ * @example
+ * cn('px-2 py-1', 'px-4') // Returns 'py-1 px-4' (px-2 is overridden by px-4)
+ * cn('text-red-500', { 'text-blue-500': isActive }) // Conditionally applies classes
+ */
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
diff --git a/gui/tailwind.config.cjs b/gui/tailwind.config.cjs
index d5871cc80..dbb8fcb62 100644
--- a/gui/tailwind.config.cjs
+++ b/gui/tailwind.config.cjs
@@ -29,6 +29,9 @@ module.exports = {
borderRadius: {
default: "0.5rem",
},
+ outlineOffset: {
+ 0.5: "0.5px",
+ },
colors: {
background: varWithFallback("background"),
foreground: varWithFallback("foreground"),