-
+
{selectedProfile?.profileType === "local" && (
<>
)}
-
-
- meta ' to toggle model
+
+ {getMetaKeyLabel()}' to toggle model
diff --git a/gui/src/components/modelSelection/platform/AssistantSelect.tsx b/gui/src/components/modelSelection/platform/AssistantSelect.tsx
index 76ac06c4e..daebc62b2 100644
--- a/gui/src/components/modelSelection/platform/AssistantSelect.tsx
+++ b/gui/src/components/modelSelection/platform/AssistantSelect.tsx
@@ -1,43 +1,148 @@
-import { ChevronDownIcon, PlusIcon } from "@heroicons/react/24/outline";
-import { ProfileDescription } from "core/config/ConfigHandler";
+import {
+ ArrowTopRightOnSquareIcon,
+ BuildingOfficeIcon,
+ ChevronDownIcon,
+ Cog6ToothIcon,
+ ExclamationTriangleIcon,
+ PlusIcon,
+} from "@heroicons/react/24/outline";
import { useContext, useEffect, useRef } from "react";
import { useAuth } from "../../../context/Auth";
import { IdeMessengerContext } from "../../../context/IdeMessenger";
-import { cycleProfile } from "../../../redux";
+import { cycleProfile, selectProfileThunk } from "../../../redux";
import { useAppDispatch, useAppSelector } from "../../../redux/hooks";
-import { fontSize, isMetaEquivalentKeyPressed } from "../../../util";
-import { Listbox, ListboxButton, ListboxOptions, Transition } from "../../ui";
+import {
+ fontSize,
+ getMetaKeyLabel,
+ isLocalProfile,
+ isMetaEquivalentKeyPressed,
+} from "../../../util";
+import {
+ Listbox,
+ ListboxButton,
+ ListboxOption,
+ ListboxOptions,
+ Transition,
+} from "../../ui";
+import { ProfileDescription } from "core/config/ConfigHandler";
+import { useNavigate } from "react-router-dom";
+import { vscCommandCenterInactiveBorder } from "../..";
+import { ROUTES } from "../../../util/navigation";
+import { ToolTip } from "../../gui/Tooltip";
+import { useFontSize } from "../../ui/font";
import AssistantIcon from "./AssistantIcon";
-import { AssistantSelectOptions } from "./AssistantSelectOptions";
-function AssistantSelectButton(props: { selectedProfile: ProfileDescription }) {
- const isLumpToolbarExpanded = useAppSelector(
- (state) => state.ui.isBlockSettingsToolbarExpanded,
- );
- return (
-
-
-
- {props.selectedProfile.title}
-
-
-
- );
+interface AssistantSelectOptionProps {
+ profile: ProfileDescription;
+ onClick: () => void;
}
+const AssistantSelectOption = ({
+ profile,
+ onClick,
+}: AssistantSelectOptionProps) => {
+ const disabled = !!profile.errors?.length;
+ const dispatch = useAppDispatch();
+ const showConfigure = isLocalProfile(profile);
+ const ideMessenger = useContext(IdeMessengerContext);
+
+ function handleOptionClick(e: any) {
+ if (disabled) {
+ e.preventDefault();
+ e.stopPropagation();
+ }
+ dispatch(selectProfileThunk(profile.id));
+ onClick();
+ }
+
+ function handleConfigure() {
+ ideMessenger.post("config/openProfile", { profileId: profile.id });
+ close();
+ }
+
+ function handleClickError() {
+ ideMessenger.post("config/openProfile", { profileId: profile.id });
+ close();
+ }
+
+ return (
+
+
+
+
+
+ {!profile.errors?.length ? (
+ showConfigure ? (
+
{
+ e.stopPropagation();
+ e.preventDefault();
+ handleConfigure();
+ }}
+ />
+ ) : (
+ {
+ e.stopPropagation();
+ e.preventDefault();
+ handleConfigure();
+ }}
+ />
+ )
+ ) : (
+ <>
+ handleClickError()}
+ />
+
+ Errors
+ {JSON.stringify(profile.errors, null, 2)}
+
+ >
+ )}
+
+
+
+
+ );
+};
export default function AssistantSelect() {
const dispatch = useAppDispatch();
const buttonRef = useRef
(null);
const { selectedProfile, selectedOrganization } = useAuth();
const ideMessenger = useContext(IdeMessengerContext);
+ const isLumpToolbarExpanded = useAppSelector(
+ (state) => state.ui.isBlockSettingsToolbarExpanded,
+ );
+
+ const { profiles, session, login } = useAuth();
+ const navigate = useNavigate();
+
+ function close() {
+ if (buttonRef.current) {
+ buttonRef.current.click();
+ }
+ }
+ function onNewAssistant() {
+ ideMessenger.post("controlPlane/openUrl", {
+ path: "new",
+ orgSlug: selectedOrganization?.slug,
+ });
+ close();
+ }
useEffect(() => {
let lastToggleTime = 0;
@@ -64,6 +169,9 @@ export default function AssistantSelect() {
};
}, []);
+ const tinyFont = useFontSize(-4);
+ const smallFont = useFontSize(-3);
+
if (!selectedProfile) {
return (
-
Create your first assistant
+
+
+ Create your first assistant
+
);
}
return (
-
+
-
+
+
+
+ {selectedProfile.title}
+
+
+
-
- {
- if (buttonRef.current) {
- buttonRef.current.click();
- }
- }}
- />
+
+
+ {profiles?.map((profile, idx) => {
+ return (
+
+ );
+ })}
+
+
+
+
+
+
login(false)}
+ >
+
+
+
+
+
+
+
+ {getMetaKeyLabel()} ⇧ ' to toggle
+
+
navigate(ROUTES.CONFIG)}
+ >
+ {selectedOrganization?.iconUrl ? (
+

+ ) : (
+
+ )}
+
+ {selectedOrganization?.name || "Personal"}
+
+
+
+
diff --git a/gui/src/components/modelSelection/platform/AssistantSelectOptions.tsx b/gui/src/components/modelSelection/platform/AssistantSelectOptions.tsx
deleted file mode 100644
index d22f64cc7..000000000
--- a/gui/src/components/modelSelection/platform/AssistantSelectOptions.tsx
+++ /dev/null
@@ -1,202 +0,0 @@
-import { BuildingOfficeIcon, PlusIcon } from "@heroicons/react/24/outline";
-import { ProfileDescription } from "core/config/ConfigHandler";
-import { useContext } from "react";
-import { useNavigate } from "react-router-dom";
-import { lightGray } from "../..";
-import { useAuth } from "../../../context/Auth";
-import { IdeMessengerContext } from "../../../context/IdeMessenger";
-import { selectProfileThunk } from "../../../redux";
-import { useAppDispatch } from "../../../redux/hooks";
-import { getFontSize, getMetaKeyLabel, isLocalProfile } from "../../../util";
-import { ROUTES } from "../../../util/navigation";
-import { ToolTip } from "../../gui/Tooltip";
-import { ListboxOption } from "../../ui";
-import AssistantIcon from "./AssistantIcon";
-
-import {
- ArrowTopRightOnSquareIcon,
- Cog6ToothIcon,
- ExclamationTriangleIcon,
-} from "@heroicons/react/24/outline";
-
-// const IconBase = styled.div<{ $hovered: boolean }>`
-
-// `;
-
-// const StyledCog6ToothIcon = styled(IconBase).attrs({ as: Cog6ToothIcon })``;
-// const StyledArrowTopRightOnSquareIcon = styled(IconBase).attrs({
-// as: ArrowTopRightOnSquareIcon,
-// })``;
-// const StyledExclamationTriangleIcon = styled(IconBase).attrs({
-// as: ExclamationTriangleIcon,
-// })``;
-
-// 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")};
-
-// &:hover {
-// opacity: 1;
-// background-color: ${lightGray}33;
-// }
-
-interface AssistantSelectOptionsProps {
- onClose: () => void;
-}
-
-export function AssistantSelectOptions({
- onClose,
-}: AssistantSelectOptionsProps) {
- const ideMessenger = useContext(IdeMessengerContext);
- const { profiles, selectedProfile, selectedOrganization, session, login } =
- useAuth();
- const dispatch = useAppDispatch();
- const navigate = useNavigate();
-
- function onNewAssistant() {
- ideMessenger.post("controlPlane/openUrl", {
- path: "new",
- orgSlug: selectedOrganization?.slug,
- });
- onClose();
- }
-
- function handleConfigure(profile: ProfileDescription) {
- ideMessenger.post("config/openProfile", { profileId: profile.id });
- onClose();
- }
-
- function handleClickError(profileId: string) {
- ideMessenger.post("config/openProfile", { profileId });
- onClose();
- }
-
- if (!profiles) {
- return null;
- }
-
- return (
-
-
- {profiles.map((profile, idx) => {
- const disabled = !!profile.errors?.length;
- const showConfigure = isLocalProfile(profile);
- // const [hovered, setHovered] = useState(false);
-
- function handleOptionClick(e: any) {
- if (disabled) {
- e.preventDefault();
- e.stopPropagation();
- }
- dispatch(selectProfileThunk(profile.id));
- onClose();
- }
-
- return (
-
-
-
-
-
-
- {profile.title}
-
-
-
- {!profile.errors?.length ? (
- showConfigure ? (
-
{
- e.stopPropagation();
- e.preventDefault();
- handleConfigure(profile);
- }}
- />
- ) : (
- {
- e.stopPropagation();
- e.preventDefault();
- handleConfigure(profile);
- }}
- />
- )
- ) : (
- <>
- handleClickError(profile.id)}
- />
-
- Errors
- {JSON.stringify(profile.errors, null, 2)}
-
- >
- )}
-
-
-
-
- );
- })}
-
-
-
-
login(false)}
- >
-
-
-
-
-
-
-
- {getMetaKeyLabel()} ⇧ ' to toggle
-
-
navigate(ROUTES.CONFIG)}
- >
- {selectedOrganization?.iconUrl ? (
-

- ) : (
-
- )}
-
- {selectedOrganization?.name || "Personal"}
-
-
-
-
-
- );
-}
diff --git a/gui/src/components/ui/Listbox.tsx b/gui/src/components/ui/Listbox.tsx
index a63f5eef0..c5c09fb95 100644
--- a/gui/src/components/ui/Listbox.tsx
+++ b/gui/src/components/ui/Listbox.tsx
@@ -5,6 +5,7 @@ import {
Listbox,
} from "@headlessui/react";
import * as React from "react";
+import { vscCommandCenterInactiveBorder } from "..";
import { cn } from "../../util/cn";
import { FontSizeModifier, useFontSize } from "./font";
@@ -20,7 +21,7 @@ const ListboxButton = React.forwardRef
(
ref={ref}
{...props}
className={cn(
- "border-vsc-input-border bg-vsc-input-background text-vsc-foreground m-0 flex flex-1 cursor-pointer flex-row items-center rounded-sm border border-solid px-1 py-0.5",
+ "border-vsc-input-border bg-vsc-background text-vsc-foreground m-0 flex flex-1 cursor-pointer flex-row items-center gap-1 rounded-sm border border-solid px-1 py-0.5 text-left",
props.className,
)}
style={{
@@ -41,13 +42,14 @@ const ListboxOptions = React.forwardRef(
return (
);
}
diff --git a/gui/src/index.css b/gui/src/index.css
index 7be83dea4..6ef5e902e 100644
--- a/gui/src/index.css
+++ b/gui/src/index.css
@@ -81,26 +81,6 @@ body {
scrollbar-width: none; /* Firefox */
}
-.lines {
- /* white-space: pre-wrap; */
- word-break: break-word;
- overflow: hidden;
- line-height: 1.375;
- text-overflow: ellipsis;
-}
-
-.lines-3 {
- display: -webkit-box;
- -webkit-line-clamp: 3;
- -webkit-box-orient: vertical;
-}
-
-.lines-1 {
- display: -webkit-box;
- -webkit-line-clamp: 1;
- -webkit-box-orient: vertical;
-}
-
.truncate-start {
display: inline-block;
vertical-align: middle;
diff --git a/gui/src/pages/config/ModelRoleSelector.tsx b/gui/src/pages/config/ModelRoleSelector.tsx
index e8461a060..0884d7164 100644
--- a/gui/src/pages/config/ModelRoleSelector.tsx
+++ b/gui/src/pages/config/ModelRoleSelector.tsx
@@ -50,17 +50,17 @@ const ModelRoleSelector = ({
{({ open }) => (
{models.length === 0 ? (
{`No ${displayName} models${["Chat", "Apply", "Edit"].includes(displayName) ? ". Using chat model" : ""}`}
) : (
{selectedModel?.title ?? `Select ${displayName} model`}
@@ -79,9 +79,9 @@ const ModelRoleSelector = ({
className="min-w-40"
>
{models.map((option, idx) => (
-
+
{option.title}
diff --git a/gui/src/pages/config/UserSettingsForm.tsx b/gui/src/pages/config/UserSettingsForm.tsx
index f2555c415..caf13b963 100644
--- a/gui/src/pages/config/UserSettingsForm.tsx
+++ b/gui/src/pages/config/UserSettingsForm.tsx
@@ -104,7 +104,7 @@ export function UserSettingsForm() {
{!controlServerBetaEnabled || hubEnabled ? (
-
+
User settings
@@ -208,7 +208,7 @@ export function UserSettingsForm() {
/> */}