make model/assistant selectors scrollable
This commit is contained in:
parent
d629294a71
commit
acefabd698
3 changed files with 41 additions and 40 deletions
|
|
@ -1,3 +1,7 @@
|
|||
import crypto from "crypto";
|
||||
|
||||
import { ControlPlaneSessionInfo } from "core/control-plane/client";
|
||||
import { controlPlaneEnv } from "core/control-plane/env";
|
||||
import fetch from "node-fetch";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import {
|
||||
|
|
@ -16,6 +20,7 @@ import {
|
|||
} from "vscode";
|
||||
|
||||
import { PromiseAdapter, promiseFromEvent } from "./promiseUtils";
|
||||
import { SecretStorage } from "./SecretStorage";
|
||||
|
||||
const AUTH_NAME = "Continue";
|
||||
|
||||
|
|
@ -26,14 +31,6 @@ class UriEventHandler extends EventEmitter<Uri> implements UriHandler {
|
|||
this.fire(uri);
|
||||
}
|
||||
}
|
||||
|
||||
import { ControlPlaneSessionInfo } from "core/control-plane/client";
|
||||
import { controlPlaneEnv } from "core/control-plane/env";
|
||||
|
||||
import crypto from "crypto";
|
||||
|
||||
import { SecretStorage } from "./SecretStorage";
|
||||
|
||||
// Function to generate a random string of specified length
|
||||
function generateRandomString(length: number): string {
|
||||
const possibleCharacters =
|
||||
|
|
|
|||
|
|
@ -26,37 +26,41 @@ export function AssistantSelect(props: AssistantSelectProps) {
|
|||
|
||||
return (
|
||||
<div className="border-lightgray flex min-w-0 flex-col border-0 border-r-[0.5px] border-solid pt-0">
|
||||
{profiles.map((option, idx) => (
|
||||
<Option
|
||||
idx={idx}
|
||||
disabled={false}
|
||||
showConfigure={true}
|
||||
selected={option.id === selectedProfile?.id}
|
||||
onConfigure={(e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
<div className={`max-h-[300px] overflow-y-scroll`}>
|
||||
{profiles.map((option, idx) => (
|
||||
<Option
|
||||
idx={idx}
|
||||
disabled={false}
|
||||
showConfigure={true}
|
||||
selected={option.id === selectedProfile?.id}
|
||||
onConfigure={(e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
ideMessenger.post("config/openProfile", {
|
||||
profileId: option.id,
|
||||
});
|
||||
}}
|
||||
onClick={() => dispatch(setProfileId(option.id))}
|
||||
>
|
||||
<div className="flex flex-grow items-center">
|
||||
{option.id === "local" ? (
|
||||
<DocumentIcon className="mr-2 h-4 w-4 flex-shrink-0" />
|
||||
) : (
|
||||
<SparklesIcon
|
||||
className="mr-2 h-4 w-4 flex-shrink-0"
|
||||
color={option.id === selectedProfile?.id ? "yellow" : undefined}
|
||||
/>
|
||||
)}
|
||||
<span className="lines lines-1 relative flex h-5 items-center justify-between gap-3 overflow-hidden text-ellipsis pr-2 text-xs sm:max-w-32">
|
||||
{option.title}
|
||||
</span>
|
||||
</div>
|
||||
</Option>
|
||||
))}
|
||||
ideMessenger.post("config/openProfile", {
|
||||
profileId: option.id,
|
||||
});
|
||||
}}
|
||||
onClick={() => dispatch(setProfileId(option.id))}
|
||||
>
|
||||
<div className="flex flex-grow items-center">
|
||||
{option.id === "local" ? (
|
||||
<DocumentIcon className="mr-2 h-4 w-4 flex-shrink-0" />
|
||||
) : (
|
||||
<SparklesIcon
|
||||
className="mr-2 h-4 w-4 flex-shrink-0"
|
||||
color={
|
||||
option.id === selectedProfile?.id ? "yellow" : undefined
|
||||
}
|
||||
/>
|
||||
)}
|
||||
<span className="lines lines-1 relative flex h-5 items-center justify-between gap-3 overflow-hidden text-ellipsis pr-2 text-xs sm:max-w-32">
|
||||
{option.title}
|
||||
</span>
|
||||
</div>
|
||||
</Option>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="mt-auto w-full">
|
||||
<OptionDiv key={profiles.length} onClick={onNewAssistant}>
|
||||
|
|
|
|||
|
|
@ -68,8 +68,8 @@ export function ModelSelect(props: ModelSelectProps) {
|
|||
}
|
||||
|
||||
return (
|
||||
<div className="xs:flex hidden h-full min-w-0 flex-col">
|
||||
<div>
|
||||
<div className="xs:flex hidden min-w-0 flex-col">
|
||||
<div className={`max-h-[300px] overflow-y-scroll`}>
|
||||
{sortedOptions.map((option, idx) => (
|
||||
<Option
|
||||
idx={idx}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue