diff --git a/gui/src/components/AssistantAndOrgListbox/ScopeSelect.tsx b/gui/src/components/AssistantAndOrgListbox/ScopeSelect.tsx index 7cac430a8..6bfa2051b 100644 --- a/gui/src/components/AssistantAndOrgListbox/ScopeSelect.tsx +++ b/gui/src/components/AssistantAndOrgListbox/ScopeSelect.tsx @@ -31,7 +31,7 @@ function getOrgIcon(org: { name: string; iconUrl?: string | null }) { const IconComponent = org.name === "Personal" ? UserCircleIcon : BuildingOfficeIcon; - return ; + return ; } export function ScopeSelect({ onSelect }: ScopeSelectProps) { @@ -52,35 +52,67 @@ export function ScopeSelect({ onSelect }: ScopeSelectProps) { onSelect?.(); }; + const handleConfigClick = () => { + ideMessenger.post("config/openProfile", { + profileId: undefined, + }); + }; + const selectedDisplay = currentOrg ?? { name: "Personal", iconUrl: null, }; - return ( - -
- -
- {getOrgIcon(selectedDisplay)} - - {selectedDisplay?.name || "Select Organization"} - -
-
+ const isPersonalSelected = + !selectedOrgId || selectedDisplay?.name === "Personal"; - - {organizations.map((org) => ( - -
- {getOrgIcon(org)} - {org.name} -
-
- ))} -
-
-
+ return ( +
+ +
+ +
+ {getOrgIcon(selectedDisplay)} + + {selectedDisplay?.name || "Select Organization"} + +
+
+ + + {organizations.map((org) => ( + +
+ {getOrgIcon(org)} +
+ {org.name} + {org.name === "Personal" && ( + + Includes your local config.yaml + + )} +
+
+
+ ))} +
+
+
+ {isPersonalSelected && ( +

+ Includes your local{" "} + + config.yaml + +

+ )} +
); } diff --git a/gui/src/components/AssistantAndOrgListbox/index.tsx b/gui/src/components/AssistantAndOrgListbox/index.tsx index 4af9846c4..f36684e6f 100644 --- a/gui/src/components/AssistantAndOrgListbox/index.tsx +++ b/gui/src/components/AssistantAndOrgListbox/index.tsx @@ -10,7 +10,6 @@ import { } from "../../redux/slices/profilesSlice"; import { getMetaKeyLabel, isMetaEquivalentKeyPressed } from "../../util"; import { cn } from "../../util/cn"; -import { useLump } from "../mainInput/Lump/LumpContext"; import { Listbox, ListboxOption, @@ -27,7 +26,6 @@ export function AssistantAndOrgListbox() { const listboxRef = useRef(null); const currentOrg = useAppSelector(selectCurrentOrg); const ideMessenger = useContext(IdeMessengerContext); - const { isToolbarExpanded } = useLump(); const { profiles, selectedProfile, @@ -38,7 +36,6 @@ export function AssistantAndOrgListbox() { refreshProfiles, } = useAuth(); const configLoading = useAppSelector((store) => store.config.loading); - const smallFont = useFontSize(-3); const tinyFont = useFontSize(-4); const shouldRenderOrgInfo = session && organizations.length > 1 && !isOnPremSession(session); diff --git a/gui/src/components/PageHeader.tsx b/gui/src/components/PageHeader.tsx index 0e935b6a5..35989f537 100644 --- a/gui/src/components/PageHeader.tsx +++ b/gui/src/components/PageHeader.tsx @@ -1,49 +1,21 @@ import { ArrowLeftIcon } from "@heroicons/react/24/outline"; -import { useFontSize } from "./ui/font"; export interface PageHeaderProps { onTitleClick?: () => void; title?: string; - rightContent?: React.ReactNode; showBorder?: boolean; } -export function PageHeader({ - onTitleClick, - title, - rightContent, - showBorder, -}: PageHeaderProps) { - const fontSize = useFontSize(-1); - +export function PageHeader({ onTitleClick, title }: PageHeaderProps) { return ( -
- {title ? ( -
- - - {title} - -
- ) : ( -
- )} - - {rightContent &&
{rightContent}
} +
+
+ + {title && {title}} +
); } diff --git a/gui/src/components/gui/Alert.tsx b/gui/src/components/gui/Alert.tsx index 8035d8b8e..a473ba141 100644 --- a/gui/src/components/gui/Alert.tsx +++ b/gui/src/components/gui/Alert.tsx @@ -27,9 +27,9 @@ type AlertConfig = { const ALERT_CONFIGS: AlertConfig = { info: { Icon: InformationCircleIcon, - background: "bg-background", - border: "border-foreground", - iconColor: "text-foreground", + background: "bg-blue-600/20", + border: "border-blue-500", + iconColor: "text-blue-500", text: "text-foreground", }, success: { @@ -56,18 +56,18 @@ const ALERT_CONFIGS: AlertConfig = { }; const alertSizes = { - sm: "px-3 py-1.5 rounded-md border", - lg: "px-4 py-3 rounded-md border", + sm: "px-3 py-2 rounded-md", + lg: "px-3 py-2.5 rounded-md", }; const iconSizes = { - sm: "h-4 w-4 mt-1", - lg: "h-5 w-5 mt-0.5", + sm: "h-4 w-4", + lg: "h-4 w-4", }; const spacingSizes = { sm: "ml-2", - lg: "ml-3", + lg: "ml-2", }; function Alert({ type = "info", size = "lg", ...props }: AlertProps) { @@ -76,7 +76,7 @@ function Alert({ type = "info", size = "lg", ...props }: AlertProps) { return (
diff --git a/gui/src/components/ui/Button.tsx b/gui/src/components/ui/Button.tsx index 4139641b0..0f942ae42 100644 --- a/gui/src/components/ui/Button.tsx +++ b/gui/src/components/ui/Button.tsx @@ -15,7 +15,7 @@ const buttonVariants = { secondary: "border-none text-foreground bg-border hover:enabled:brightness-125", outline: - "border border-solid border-badge border-border text-foreground bg-transparent hover:enabled:bg-input", + "border border-solid border-description text-foreground bg-transparent hover:enabled:bg-input", ghost: "border-none text-foreground bg-inherit hover:enabled:brightness-125 hover:enabled:bg-input", }; diff --git a/gui/src/pages/config/AccountSection.tsx b/gui/src/pages/config/AccountSection.tsx index 61a15bc2e..e282ca3a8 100644 --- a/gui/src/pages/config/AccountSection.tsx +++ b/gui/src/pages/config/AccountSection.tsx @@ -1,26 +1,28 @@ -import { UserCircleIcon } from "@heroicons/react/24/solid"; +import { ArrowRightStartOnRectangleIcon } from "@heroicons/react/24/outline"; import { isOnPremSession } from "core/control-plane/AuthTypes"; +import { useContext } from "react"; import { ScopeSelect } from "../../components/AssistantAndOrgListbox/ScopeSelect"; +import { ToolTip } from "../../components/gui/Tooltip"; import { Button } from "../../components/ui"; import { useAuth } from "../../context/Auth"; +import { IdeMessengerContext } from "../../context/IdeMessenger"; import { useAppSelector } from "../../redux/hooks"; import { selectCurrentOrg } from "../../redux/slices/profilesSlice"; export function AccountSection() { const { session, logout, login, organizations } = useAuth(); const selectedOrg = useAppSelector(selectCurrentOrg); + const ideMessenger = useContext(IdeMessengerContext); if (!session) { return ( -
- +
-

Not signed in

-

Sign in to access your account settings

-
@@ -32,17 +34,16 @@ export function AccountSection() { if (isOnPremSession(session)) { return (
-
- -
-

Account

-

On-premise deployment

-
+
+

Account

+

On-premise deployment

- +
-

Account Information

-

Account details not available for on-premise deployments

+

Account Information

+

+ Account details not available for on-premise deployments +

); @@ -50,47 +51,48 @@ export function AccountSection() { return (
-
- +
-

Account

-

Manage your account settings

+

{session.account.label}

+

{session.account.id}

-
- -
-

Account Information

-
-
- {session.account.label} -
-
- {session.account.id} -
- - {organizations.length > 0 && ( -
- -
- -
-
- )} -
-
- -
-

Actions

+ Sign out
+ + {organizations.length > 0 && ( +
+ +

+ Determines what{" "} + + ideMessenger.post( + "openUrl", + "https://docs.continue.dev/hub/assistants/intro", + ) + } + > + agents + {" "} + are available for you to use +

+
+ +
+
+ )}
); -} \ No newline at end of file +} diff --git a/gui/src/pages/config/HelpCenterSection.tsx b/gui/src/pages/config/HelpCenterSection.tsx index 7a711068c..3e09b8ee8 100644 --- a/gui/src/pages/config/HelpCenterSection.tsx +++ b/gui/src/pages/config/HelpCenterSection.tsx @@ -5,15 +5,145 @@ import { PaintBrushIcon, TableCellsIcon, } from "@heroicons/react/24/outline"; -import { useContext } from "react"; +import { useContext, useMemo } from "react"; import { useNavigate } from "react-router-dom"; +import Shortcut from "../../components/gui/Shortcut"; import { IdeMessengerContext } from "../../context/IdeMessenger"; import { useAppDispatch, useAppSelector } from "../../redux/hooks"; import { setOnboardingCard } from "../../redux/slices/uiSlice"; import { saveCurrentSession } from "../../redux/thunks/session"; +import { isJetBrains } from "../../util"; import { ROUTES } from "../../util/navigation"; import MoreHelpRow from "./MoreHelpRow"; +interface KeyboardShortcutProps { + shortcut: string; + description: string; + isEven: boolean; +} + +function KeyboardShortcut(props: KeyboardShortcutProps) { + return ( +
+
+ {props.description}: +
+
+ {props.shortcut} +
+
+ ); +} + +// Shortcut strings will be rendered correctly based on the platform by the Shortcut component +const vscodeShortcuts: Omit[] = [ + { + shortcut: "cmd '", + description: "Toggle Selected Model", + }, + { + shortcut: "cmd I", + description: "Edit highlighted code", + }, + { + shortcut: "cmd L", + description: + "New Chat / New Chat With Selected Code / Close Continue Sidebar If Chat Already In Focus", + }, + { + shortcut: "cmd backspace", + description: "Cancel response", + }, + { + shortcut: "cmd shift I", + description: "Toggle inline edit focus", + }, + { + shortcut: "cmd shift L", + description: + "Focus Current Chat / Add Selected Code To Current Chat / Close Continue Sidebar If Chat Already In Focus", + }, + { + shortcut: "cmd shift R", + description: "Debug Terminal", + }, + { + shortcut: "cmd shift backspace", + description: "Reject Diff", + }, + { + shortcut: "cmd shift enter", + description: "Accept Diff", + }, + { + shortcut: "alt cmd N", + description: "Reject Top Change in Diff", + }, + { + shortcut: "alt cmd Y", + description: "Accept Top Change in Diff", + }, + { + shortcut: "cmd K cmd A", + description: "Toggle Autocomplete Enabled", + }, + { + shortcut: "cmd alt space", + description: "Force an Autocomplete Trigger", + }, + { + shortcut: "cmd K cmd M", + description: "Toggle Full Screen", + }, +]; + +const jetbrainsShortcuts: Omit[] = [ + { + shortcut: "cmd '", + description: "Toggle Selected Model", + }, + { + shortcut: "cmd I", + description: "Edit highlighted code", + }, + { + shortcut: "cmd J", + description: + "New Chat / New Chat With Selected Code / Close Continue Sidebar If Chat Already In Focus", + }, + { + shortcut: "cmd backspace", + description: "Cancel response", + }, + { + shortcut: "cmd shift I", + description: "Toggle inline edit focus", + }, + { + shortcut: "cmd shift J", + description: + "Focus Current Chat / Add Selected Code To Current Chat / Close Continue Sidebar If Chat Already In Focus", + }, + { + shortcut: "cmd shift backspace", + description: "Reject Diff", + }, + { + shortcut: "cmd shift enter", + description: "Accept Diff", + }, + { + shortcut: "alt shift J", + description: "Quick Input", + }, + { + shortcut: "alt cmd J", + description: "Toggle Sidebar", + }, +]; + export function HelpCenterSection() { const ideMessenger = useContext(IdeMessengerContext); const navigate = useNavigate(); @@ -21,6 +151,10 @@ export function HelpCenterSection() { const currentSession = useAppSelector((state) => state.session); + const shortcuts = useMemo(() => { + return isJetBrains() ? jetbrainsShortcuts : vscodeShortcuts; + }, []); + const handleViewSessionData = async () => { const sessionData = await ideMessenger.request("history/load", { id: currentSession.id, @@ -126,6 +260,23 @@ export function HelpCenterSection() { /> )}
+ + {/* Keyboard Shortcuts Section */} +
+

Keyboard shortcuts

+
+ {shortcuts.map((shortcut, i) => { + return ( + + ); + })} +
+
); } diff --git a/gui/src/pages/config/TabButton.tsx b/gui/src/pages/config/TabButton.tsx new file mode 100644 index 000000000..80daadd0f --- /dev/null +++ b/gui/src/pages/config/TabButton.tsx @@ -0,0 +1,44 @@ +import { v4 as uuidv4 } from "uuid"; +import { ToolTip } from "../../components/gui/Tooltip"; +import { fontSize } from "../../util"; + +interface TabButtonProps { + id: string; + label: string; + icon: React.ReactNode; + isActive: boolean; + onClick: () => void; +} + +export function TabButton({ id, label, icon, isActive, onClick }: TabButtonProps) { + const tooltipId = `tab-tooltip-${uuidv4()}`; + + return ( +
+
+ {icon} + {label} +
+ + + {label} + +
+ ); +} \ No newline at end of file diff --git a/gui/src/pages/config/TabGroup.tsx b/gui/src/pages/config/TabGroup.tsx new file mode 100644 index 000000000..b651768cd --- /dev/null +++ b/gui/src/pages/config/TabGroup.tsx @@ -0,0 +1,57 @@ +import { TabButton } from "./TabButton"; + +interface TabOption { + id: string; + label: string; + component: React.ReactNode; + icon: React.ReactNode; +} + +interface TabGroupProps { + tabs: TabOption[]; + activeTab: string; + onTabClick: (tabId: string) => void; + label?: string; + showTopDivider?: boolean; + showBottomDivider?: boolean; + className?: string; +} + +export function TabGroup({ + tabs, + activeTab, + onTabClick, + label, + showTopDivider = false, + showBottomDivider = false, + className = "", +}: TabGroupProps) { + return ( +
+ {showTopDivider && ( +
+ )} + + {label && ( +
+ {label} +
+ )} + + {tabs.map((tab) => ( + onTabClick(tab.id)} + /> + ))} + + {showBottomDivider && ( +
+ )} +
+ ); +} diff --git a/gui/src/pages/config/configTabs.tsx b/gui/src/pages/config/configTabs.tsx new file mode 100644 index 000000000..d3632aa85 --- /dev/null +++ b/gui/src/pages/config/configTabs.tsx @@ -0,0 +1,134 @@ +import { + CircleStackIcon, + Cog6ToothIcon, + CubeIcon, + PencilIcon, + QuestionMarkCircleIcon, + Squares2X2Icon, + WrenchScrewdriverIcon, +} from "@heroicons/react/24/outline"; +import { UserCircleIcon } from "@heroicons/react/24/solid"; +import MCPSection from "../../components/mainInput/Lump/sections/mcp/MCPSection"; +import { ModelsSection } from "../../components/mainInput/Lump/sections/ModelsSection"; +import { RulesSection } from "../../components/mainInput/Lump/sections/RulesSection"; +import { ToolPoliciesSection } from "../../components/mainInput/Lump/sections/tool-policies/ToolPoliciesSection"; +import { AccountSection } from "./AccountSection"; +import { HelpCenterSection } from "./HelpCenterSection"; +import { IndexingSettingsSection } from "./IndexingSettingsSection"; +import { UserSettingsForm } from "./UserSettingsForm"; + +interface TabOption { + id: string; + label: string; + component: React.ReactNode; + icon: React.ReactNode; +} + +interface TabSection { + id: string; + tabs: TabOption[]; + label?: string; + showTopDivider?: boolean; + showBottomDivider?: boolean; + className?: string; +} + +export const topTabSections: TabSection[] = [ + { + id: "top", + tabs: [ + { + id: "account", + label: "Account", + component: , + icon: , + }, + ], + }, + { + id: "blocks", + label: "Blocks", + showTopDivider: true, + tabs: [ + { + id: "models", + label: "Models", + component: ( +
+

Models

+ +
+ ), + icon: , + }, + { + id: "rules", + label: "Rules", + component: ( +
+

Rules

+ +
+ ), + icon: , + }, + { + id: "mcp", + label: "MCP", + component: , + icon: , + }, + { + id: "tools", + label: "Tools", + component: ( +
+

Tool Policies

+ +
+ ), + icon: ( + + ), + }, + ], + }, + { + id: "indexing", + showTopDivider: true, + tabs: [ + { + id: "indexing", + label: "Indexing", + component: , + icon: , + }, + ], + }, +]; + +export const bottomTabSections: TabSection[] = [ + { + id: "bottom", + tabs: [ + { + id: "settings", + label: "Settings", + component: , + icon: , + }, + { + id: "help", + label: "Help", + component: , + icon: ( + + ), + }, + ], + }, +]; + +export const getAllTabs = (): TabOption[] => { + return [...topTabSections, ...bottomTabSections].flatMap((section) => section.tabs); +}; \ No newline at end of file diff --git a/gui/src/pages/config/index.tsx b/gui/src/pages/config/index.tsx index 9fd94f13b..a470f2210 100644 --- a/gui/src/pages/config/index.tsx +++ b/gui/src/pages/config/index.tsx @@ -1,193 +1,59 @@ -import { - ArrowLeftIcon, - BoltIcon, - CircleStackIcon, - Cog6ToothIcon, - CubeIcon, - PencilIcon, - QuestionMarkCircleIcon, - Squares2X2Icon, - WrenchScrewdriverIcon, -} from "@heroicons/react/24/outline"; -import { UserCircleIcon } from "@heroicons/react/24/solid"; import { useState } from "react"; import { useNavigate } from "react-router-dom"; -import { v4 as uuidv4 } from "uuid"; -import { ToolTip } from "../../components/gui/Tooltip"; -import MCPSection from "../../components/mainInput/Lump/sections/mcp/MCPSection"; -import { ModelsSection } from "../../components/mainInput/Lump/sections/ModelsSection"; -import { RulesSection } from "../../components/mainInput/Lump/sections/RulesSection"; -import { ToolPoliciesSection } from "../../components/mainInput/Lump/sections/tool-policies/ToolPoliciesSection"; +import { PageHeader } from "../../components/PageHeader"; import { useNavigationListener } from "../../hooks/useNavigationListener"; -import { fontSize } from "../../util"; -import { AccountSection } from "./AccountSection"; -import { HelpCenterSection } from "./HelpCenterSection"; -import { IndexingSettingsSection } from "./IndexingSettingsSection"; -import KeyboardShortcuts from "./KeyboardShortcuts"; -import { UserSettingsForm } from "./UserSettingsForm"; - -type TabOption = { - id: string; - label: string; - component: React.ReactNode; - icon: React.ReactNode; -}; +import { topTabSections, bottomTabSections, getAllTabs } from "./configTabs"; +import { TabGroup } from "./TabGroup"; function ConfigPage() { useNavigationListener(); const navigate = useNavigate(); const [activeTab, setActiveTab] = useState("settings"); - const tabs: TabOption[] = [ - { - id: "account", - label: "Account", - component: , - icon: , - }, - { - id: "settings", - label: "Settings", - component: , - icon: , - }, - { - id: "models", - label: "Models", - component: ( -
-

Models

- -
- ), - icon: , - }, - { - id: "rules", - label: "Rules", - component: ( -
-

Rules

- -
- ), - icon: , - }, - { - id: "mcp", - label: "MCP", - component: , - icon: , - }, - { - id: "tools", - label: "Tools", - component: ( -
-

Tool Policies

- -
- ), - icon: ( - - ), - }, - { - id: "indexing", - label: "Indexing", - component: , - icon: , - }, - { - id: "help", - label: "Help", - component: , - icon: ( - - ), - }, - { - id: "shortcuts", - label: "Shortcuts", - component: , - icon: , - }, - ]; + const allTabs = getAllTabs(); return (
{/* Vertical Sidebar - full height */}
- {/* Sidebar content */} -
- {/* Back Button */} -
navigate("/")} - data-tooltip-id="back-tooltip" - style={{ - fontSize: fontSize(-2), - }} - > - - Back -
- - {/* Back button tooltip for small screens only */} - - Back - - - {/* Small gap between back button and tabs */} -
- - {/* Tab Headers */} - {tabs.map((tab) => { - const tooltipId = `tab-tooltip-${uuidv4()}`; - return ( -
-
setActiveTab(tab.id)} - data-tooltip-id={tooltipId} - > - {tab.icon} - {tab.label} -
- - {/* Tooltip for small screens only */} - - {tab.label} - -
- ); - })} +
+ {topTabSections.map((section) => ( + + ))} + +
+ +
+ {bottomTabSections.map((section) => ( + + ))}
{/* Main content area */}
+ navigate("/")} title="Back" /> {/* Tab Content */}
- {tabs.find((tab) => tab.id === activeTab)?.component} + {allTabs.find((tab) => tab.id === activeTab)?.component}
diff --git a/gui/src/pages/history/index.tsx b/gui/src/pages/history/index.tsx index a8be3d92f..86950ff24 100644 --- a/gui/src/pages/history/index.tsx +++ b/gui/src/pages/history/index.tsx @@ -2,7 +2,6 @@ import { useNavigate } from "react-router-dom"; import { History } from "../../components/History"; import { PageHeader } from "../../components/PageHeader"; import { getFontSize } from "../../util"; -import { AccountButton } from "../config/AccountButton"; export default function HistoryPage() { const navigate = useNavigate(); @@ -12,12 +11,7 @@ export default function HistoryPage() { className="flex flex-1 flex-col overflow-auto" style={{ fontSize: getFontSize() }} > - navigate("/")} - title="Chat" - rightContent={} - /> + navigate("/")} title="Chat" />
); diff --git a/gui/src/pages/stats.tsx b/gui/src/pages/stats.tsx index 21c2481b6..b97a319de 100644 --- a/gui/src/pages/stats.tsx +++ b/gui/src/pages/stats.tsx @@ -1,10 +1,10 @@ -import { ArrowLeftIcon } from "@heroicons/react/24/outline"; import { useContext, useEffect, useState } from "react"; import { useNavigate } from "react-router-dom"; import styled from "styled-components"; import { table } from "table"; import { lightGray, vscBackground, vscInputBackground } from "../components"; import { CopyIconButton } from "../components/gui/CopyIconButton"; +import { PageHeader } from "../components/PageHeader"; import { IdeMessengerContext } from "../context/IdeMessenger"; import { useNavigationListener } from "../hooks/useNavigationListener"; @@ -65,17 +65,11 @@ function Stats() { backgroundColor: vscBackground, }} > -
navigate(-1)} - className="sticky top-0 m-0 flex cursor-pointer items-center p-0" - style={{ - borderBottom: `0.5px solid ${lightGray}`, - backgroundColor: vscBackground, - }} - > - - More -
+ navigate(-1)} + showBorder + />