Merge pull request #2367 from continuedev/pe/xxs-breakpoint

Pe/xxs breakpoint
This commit is contained in:
Patrick Erichsen 2024-09-24 10:18:15 -07:00 • committed by GitHub
commit e0911b5d62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 140 additions and 63 deletions

View file

@ -1044,6 +1044,7 @@
"llama2-70b",
"mistral-8x7b",
"gemma",
"gemma2",
"llama3-8b",
"llama3-70b",
"llama3.1-8b",
@ -2114,6 +2115,13 @@
"minimum": 128,
"exclusiveMaximum": 2147483647
},
"maxBatchSize": {
"title": "Maximum Batch Size",
"description": "The maximum number of chunks that can be sent to the embeddings provider in a single request",
"type": "integer",
"minimum": 1,
"exclusiveMaximum": 2147483647
},
"region": {
"title": "Region",
"description": "The region where the model is hosted",

View file

@ -2115,6 +2115,13 @@
"minimum": 128,
"exclusiveMaximum": 2147483647
},
"maxBatchSize": {
"title": "Maximum Batch Size",
"description": "The maximum number of chunks that can be sent to the embeddings provider in a single request",
"type": "integer",
"minimum": 1,
"exclusiveMaximum": 2147483647
},
"region": {
"title": "Region",
"description": "The region where the model is hosted",

View file

@ -2356,6 +2356,13 @@
"minimum": 128,
"exclusiveMaximum": 2147483647
},
"maxBatchSize": {
"title": "Maximum Batch Size",
"description": "The maximum number of chunks that can be sent to the embeddings provider in a single request",
"type": "integer",
"minimum": 1,
"exclusiveMaximum": 2147483647
},
"region": {
"title": "Region",
"description": "The region where the model is hosted",

View file

@ -9,7 +9,6 @@ import { useOnboardingCard } from "./hooks/useOnboardingCard";
const StyledCard = styled.div`
margin: auto;
border-radius: ${defaultBorderRadius};
padding: 1rem 1.5rem;
background-color: ${vscInputBackground};
box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1),
0 8px 10px -6px rgb(0 0 0 / 0.1);
@ -43,13 +42,13 @@ export function OnboardingCard(props: OnboardingCardProps) {
}
return (
<StyledCard className="relative">
<StyledCard className="relative px-2 py-3 xs:py-4 xs:px-4">
<OnboardingCardTabs
activeTab={onboardingCard.activeTab}
onTabClick={onboardingCard.setActiveTab}
/>
<CloseButton onClick={onboardingCard.close}>
<XMarkIcon className="h-5 w-5" />
<XMarkIcon className="h-5 w-5 hidden sm:flex" />
</CloseButton>
<div className="content py-4">{renderTabContent()}</div>
</StyledCard>

View file

@ -65,13 +65,13 @@ function BestExperienceConfigForm({
<div className="text-lg font-bold mb-1 flex flex-row justify-between gap-4">
<label className="text-lg font-bold">Chat model</label>
<div
className="flex items-center text-xs font-semibold justify-end"
className="flex items-center text-xs font-semibold justify-end hidden sm:flex"
style={{ color: lightGray }}
>
<CubeIcon className="w-4 h-4 mr-1 flex-shrink-0" />
<span className="italic text-right inline">
{chatModel.title}{" "}
<span className="max-xs:hidden">by Anthropic</span>
<span className="hidden md:inline">by Anthropic</span>
</span>
</div>
</div>
@ -99,13 +99,13 @@ function BestExperienceConfigForm({
<div className="text-lg font-bold mb-1 flex flex-row justify-between gap-4">
<label className="text-lg font-bold">Autocomplete model</label>
<div
className="flex items-center text-xs font-semibold"
className="flex items-center text-xs font-semibold hidden sm:flex"
style={{ color: lightGray }}
>
<CubeIcon className="w-4 h-4 mr-1 flex-shrink-0 inline" />
<span className="italic text-right">
{autocompleteModel.title}{" "}
<span className="max-xs:hidden">by Mistral</span>
<span className="hidden md:inline">by Mistral</span>
</span>
</div>
</div>
@ -129,7 +129,7 @@ function BestExperienceConfigForm({
</div>
</div>
<div className="mt-2 w-full">
<div className="w-full">
<Button className="w-full" type="submit" disabled={!chatApiKey}>
Connect
</Button>

View file

@ -7,7 +7,7 @@ interface OllamaCompletedStepProps {
function OllamaCompletedStep({ text }: OllamaCompletedStepProps) {
return (
<div className="flex justify-between items-center">
<p className="text-sm w-3/4 font-mono">{text}</p>
<p className="text-sm w-3/4 font-mono truncate mr-1">{text}</p>
<CheckCircleIcon width={24} height={24} className="text-emerald-600" />
</div>
);

View file

@ -35,7 +35,7 @@ function OllamaModelDownload({
) : (
<>
<StyledActionButton data-tooltip-id={id} onClick={onClick}>
<p className="font-mono">{command}</p>
<p className="font-mono truncate">{command}</p>
<CommandLineIcon width={24} height={24} />
</StyledActionButton>
{tooltipPortalDiv &&

View file

@ -35,14 +35,14 @@ export function OllamaStatus({ isOllamaConnected }: OllamaStatusProps) {
case OllamaConnectionStatuses.WaitingToDownload:
return (
<StyledActionButton onClick={onClickDownload}>
<p className="underline text-sm">{downloadUrl}</p>
<p className="underline text-sm truncate mr-1">{downloadUrl}</p>
<ArrowTopRightOnSquareIcon width={24} height={24} />
</StyledActionButton>
);
case OllamaConnectionStatuses.Downloading:
return (
<div className="flex justify-between items-center">
<p className="text-sm w-3/4 font-mono">
<p className="text-sm w-3/4 font-mono truncate mr-1">
Checking for connection to Ollama at http://localhost:11434
</p>
<ArrowPathIcon className="h-4 w-4 animate-spin-slow mr-1" />

View file

@ -9,23 +9,39 @@ interface OnboardingCardTabsProps {
export type TabTitle = "Quickstart" | "Best" | "Local";
export const TabTitles: { [k in TabTitle]: { xs: string; default: string } } = {
export const TabTitles: { [k in TabTitle]: { md: string; default: string } } = {
Quickstart: {
xs: "Quickstart",
md: "Quickstart",
default: "Quickstart",
},
Best: {
xs: "Best",
md: "Best",
default: "Best experience",
},
Local: {
xs: "Local",
md: "Local",
default: "Local with Ollama",
},
};
const StyledSelect = styled.select`
width: 100%;
padding: 0.5rem;
background-color: transparent;
color: ${vscForeground};
border: none;
border-bottom: 1px solid ${vscForeground};
border-radius: 0;
font-size: 1rem;
cursor: pointer;
display: block;
&:focus {
outline: none;
}
`;
const TabButton = styled.button<{ isActive: boolean }>`
padding: 1rem 1rem 0.5rem 1rem;
margin-bottom: -1px;
focus: outline-none;
background: transparent;
@ -54,23 +70,48 @@ export function OnboardingCardTabs({
onTabClick,
}: OnboardingCardTabsProps) {
return (
<TabList>
{Object.entries(TabTitles).map(([tabType, titles]) => {
if (hasPassedFTL() && tabType === "Quickstart") {
return undefined;
}
<div>
<div className="hidden xs:block">
<TabList>
{Object.entries(TabTitles).map(([tabType, titles]) => {
if (hasPassedFTL() && tabType === "Quickstart") {
return undefined;
}
return (
<TabButton
key={tabType}
isActive={activeTab === tabType}
onClick={() => onTabClick(tabType as TabTitle)}
>
<p className="hidden xs:block m-0 font-medium">{titles.default}</p>
<p className="block xs:hidden m-0 font-medium">{titles.xs}</p>
</TabButton>
);
})}
</TabList>
return (
<TabButton
className="px-6 py-2 xs:py-2 xs:px-3 sm:px-5"
key={tabType}
isActive={activeTab === tabType}
onClick={() => onTabClick(tabType as TabTitle)}
>
<p className="hidden md:block m-0 font-medium">
{titles.default}
</p>
<p className="block md:hidden m-0 font-medium">{titles.md}</p>
</TabButton>
);
})}
</TabList>
</div>
<div className="block xs:hidden">
<StyledSelect
value={activeTab}
onChange={(e) => onTabClick(e.target.value as TabTitle)}
>
{Object.entries(TabTitles).map(([tabType, titles]) => {
if (hasPassedFTL() && tabType === "Quickstart") {
return null;
}
return (
<option key={tabType} value={tabType}>
{titles.md}
</option>
);
})}
</StyledSelect>
</div>
</div>
);
}

View file

@ -17,7 +17,7 @@ function ProviderAlert() {
}
return (
<div>
<div className="w-full">
<Alert type="info">
<p className="font-semibold text-sm m-0">
Prefer to use an different provider like OpenAI?

View file

@ -7,7 +7,9 @@ function OnboardingBestTab() {
return (
<div className="flex flex-col gap-8">
<ProviderAlert />
<div className="hidden xs:flex w-full">
<ProviderAlert />
</div>
<BestExperienceConfigForm onComplete={submitOnboarding} />
</div>
);

View file

@ -3,18 +3,18 @@ import QuickStartSubmitButton from "../components/QuickStartSubmitButton";
function OnboardingQuickstartTab() {
return (
<div className="flex justify-center items-center">
<div className="flex flex-col items-center justify-center w-3/4 text-center">
<div className="mr-5">
<div className="flex justify-center items-center w-full h-full">
<div className="flex flex-col items-center justify-center w-full max-w-full px-4 xs:px-0 text-center">
<div className="hidden xs:flex">
<ContinueLogo height={75} />
</div>
<p className="text-sm">
<p className="text-sm w-full xs:w-3/4">
Quickly get up and running using our API keys. After this trial, we'll
help you set up your own models.
</p>
<p className="text-sm">
<p className="text-sm w-full xs:w-3/4">
To prevent abuse, we'll ask you to sign in to GitHub.
</p>

View file

@ -124,14 +124,14 @@ function StepContainer(props: StepContainerProps) {
{(props.isLast || isHovered || typeof feedback !== "undefined") &&
!active && (
<div
className="flex items-center gap-1 absolute -bottom-2 right-2"
className="flex items-center gap-1 absolute -bottom-2 right-2 hidden xs:flex"
style={{
color: lightGray,
fontSize: getFontSize() - 3,
}}
>
{props.modelTitle && (
<>
<div className="hidden sm:flex">
<div className="flex items-center">{props.modelTitle}</div>
<div
className="ml-2 mr-1"
@ -141,7 +141,7 @@ function StepContainer(props: StepContainerProps) {
backgroundColor: lightGray,
}}
></div>
</>
</div>
)}
{truncatedEarly && (

View file

@ -28,7 +28,6 @@ import ModelSelect from "../modelSelection/ModelSelect";
const StyledDiv = styled.div<{ isHidden: boolean }>`
padding: 4px 0;
display: flex;
justify-content: space-between;
gap: 1px;
background-color: ${vscInputBackground};
@ -110,6 +109,7 @@ function InputToolbar(props: InputToolbarProps) {
isHidden={props.hidden}
onClick={props.onClick}
id="input-toolbar"
className="hidden xs:flex"
>
<span className="flex gap-2 items-center whitespace-nowrap">
<ModelSelect />
@ -207,17 +207,19 @@ function InputToolbar(props: InputToolbarProps) {
{getMetaKeyLabel()} ⏎ Use @codebase
</StyledSpan>
)}
<EnterButton
offFocus={props.usingCodebase}
onClick={(e) => {
props.onEnter({
useCodebase: isMetaEquivalentKeyPressed(e),
noContext: useActiveFile ? e.altKey : !e.altKey,
});
}}
>
⏎ Enter
</EnterButton>
<div className="hidden xs:flex">
<EnterButton
offFocus={props.usingCodebase}
onClick={(e) => {
props.onEnter({
useCodebase: isMetaEquivalentKeyPressed(e),
noContext: useActiveFile ? e.altKey : !e.altKey,
});
}}
>
⏎ Enter
</EnterButton>
</div>
</span>
</StyledDiv>
</>

View file

@ -894,6 +894,7 @@ function TipTapEditor(props: TipTapEditorProps) {
});
}}
/>
{showDragOverMsg &&
modelSupportsImages(
defaultModel.provider,

View file

@ -28,6 +28,7 @@ import FileIcon from "../FileIcon";
import ButtonWithTooltip from "../ButtonWithTooltip";
import { CopyButton as CopyButtonHeader } from "./CopyButton";
import { ToolbarButtonWithTooltip } from "./ToolbarButtonWithTooltip";
import { getBasename } from "core/util";
const ToolbarDiv = styled.div`
display: flex;
@ -217,11 +218,15 @@ function CodeBlockToolBar(props: CodeBlockToolBarProps) {
return (
<ToolbarDiv>
<div
className="flex items-center cursor-pointer py-0.5 px-0.5"
className="flex items-center cursor-pointer py-0.5 px-0.5 max-w-[50%]"
onClick={onClickHeader}
>
<FileIcon filename={props.filepath} height="18px" width="18px" />
<span className="hover:brightness-125 ml-1">{props.filepath}</span>{" "}
<div className="ml-1 truncate">
<span className="hover:brightness-125 truncate inline-block w-full">
{getBasename(props.filepath)}
</span>
</div>
</div>
<div className="flex items-center gap-1">
@ -233,12 +238,12 @@ function CodeBlockToolBar(props: CodeBlockToolBarProps) {
{isCopied ? (
<>
<CheckIcon className="w-3 h-3 text-green-500 hover:brightness-125" />
<span>Copied</span>
<span className="hidden sm:inline">Copied</span>
</>
) : (
<>
<ClipboardIcon className="w-3 h-3 hover:brightness-125" />
<span>Copy</span>
<span className="hidden xs:inline">Copy</span>
</>
)}
</div>
@ -256,7 +261,7 @@ function CodeBlockToolBar(props: CodeBlockToolBarProps) {
style={{ color: lightGray }}
>
<PlayIcon className="w-3 h-3" />
<span>Apply</span>
<span className="hidden xs:inline">Apply</span>
</div>
</ToolbarButton>
) : (

View file

@ -9,8 +9,13 @@ module.exports = {
],
theme: {
screens: {
xs: "425px",
...defaultTheme.screens,
xxs: "170px", // Smallest width for Primary Sidebar in VS Code
xs: "250px", // Default sidebar width in VS Code
sm: "320px",
md: "480px",
lg: "640px", // Tailwind's default 'sm'
xl: "768px", // Tailwind's default 'md'
"2xl": "1024px", // Tailwind's default 'lg'
},
extend: {
animation: {