Merge pull request #2652 from continuedev/pe/jb-misc-fixes

gui: misc css fixes
This commit is contained in:
Patrick Erichsen 2024-10-23 18:25:50 -07:00 • committed by GitHub
commit ea32d60177
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 77 additions and 73 deletions

View file

@ -56,10 +56,10 @@ export function HistoryTableRow({
onMouseLeave={() => setHovered(false)}
>
<div
className="hover:bg-vsc-editor-background relative box-border flex max-w-full overflow-hidden rounded-lg p-3"
className="hover:bg-vsc-editor-background relative box-border flex max-w-full cursor-pointer overflow-hidden rounded-lg p-3"
onClick={async () => {
// Save current session
saveSession();
await saveSession();
await loadSession(session.sessionId);
navigate("/");
}}
@ -113,7 +113,7 @@ export function HistoryTableRow({
<ButtonWithTooltip
text="Delete"
onClick={async () => {
deleteSession(session.sessionId);
await deleteSession(session.sessionId);
onDelete(session.sessionId);
}}
>

View file

@ -52,10 +52,10 @@ export function TutorialCard({ onClose }: TutorialCardProps) {
<ul className="space-y-4 pl-0" style={{ color: lightGray }}>
{!isJetBrains() && (
<li className="flex items-start">
<ArrowRightStartOnRectangleIcon className="align-middle pr-3 h-4 w-4" />
<ArrowRightStartOnRectangleIcon className="h-4 w-4 pr-3 align-middle" />
<span>
<span
className="underline cursor-pointer"
className="cursor-pointer underline"
onClick={() =>
ideMessenger.request(
"vscode/openMoveRightMarkdown",
@ -70,32 +70,33 @@ export function TutorialCard({ onClose }: TutorialCardProps) {
</li>
)}
<li className="flex items-start">
<PencilSquareIcon className="align-middle pr-3 h-4 w-4" />
<PencilSquareIcon className="h-4 w-4 pr-3 align-middle" />
<span>
Highlight code and press <code>{getMetaKeyLabel() + "I"}</code> to
quickly make natural language edits
</span>
</li>
<li className="flex items-start">
<ClipboardDocumentIcon className="align-middle pr-3 h-4 w-4" />
<ClipboardDocumentIcon className="h-4 w-4 pr-3 align-middle" />
<span>
Highlight code and press <code>{getMetaKeyLabel() + "L"}</code> to
add it to the chat window
</span>
</li>
<li className="flex items-start">
<Cog6ToothIcon className="align-middle pr-3 h-4 w-4" />
<Cog6ToothIcon className="h-4 w-4 pr-3 align-middle" />
<span>
Click the gear icon in the bottom right to configure Continue
</span>
</li>
<li className="flex items-start">
<BookOpenIcon className="align-middle pr-3 h-4 w-4" />
<BookOpenIcon className="h-4 w-4 pr-3 align-middle" />
<span>
<a
href="https://docs.continue.dev"
target="_blank"
className="text-inherit underline cursor-pointer hover:text-inherit"
className="cursor-pointer text-inherit underline hover:text-inherit"
onClick={() =>
ideMessenger.post("openUrl", "https://docs.continue.dev")
}
>
Read our documentation
</a>{" "}

View file

@ -1,5 +1,9 @@
import { Transition } from "@headlessui/react";
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/react/24/outline";
import {
CheckIcon,
ChevronUpDownIcon,
CubeIcon,
} from "@heroicons/react/24/outline";
import { Dispatch, Fragment, SetStateAction } from "react";
import { Listbox } from "@headlessui/react";
import styled from "styled-components";
@ -111,7 +115,7 @@ function ModelSelectionListbox({
}: ModelSelectionListboxProps) {
return (
<StyledListbox value={selectedProvider} onChange={setSelectedProvider}>
<div className="relative mt-1 mb-2">
<div className="relative mb-2 mt-1">
<StyledListboxButton>
<span className="flex items-center">
{window.vscMediaUrl && selectedProvider.icon && (
@ -141,25 +145,30 @@ function ModelSelectionListbox({
<StyledListboxOption
selected={selectedProvider.title === option.title}
key={index}
className="relative cursor-default select-none py-2 pl-10 pr-4 text-gray-900"
className="relative cursor-default select-none py-2 pl-10 pr-4 text-gray-400"
value={option}
>
{({ selected }) => (
<>
{window.vscMediaUrl && option.icon && (
<img
src={`${window.vscMediaUrl}/logos/${option.icon}`}
height="24px"
style={{ marginRight: "10px" }}
/>
{option.title === "Autodetect" ? (
<CubeIcon className="mr-2.5 h-6 w-6 text-gray-400" />
) : (
window.vscMediaUrl &&
option.icon && (
<img
src={`${window.vscMediaUrl}/logos/${option.icon}`}
height="24px"
style={{ marginRight: "10px" }}
/>
)
)}
<span className="text-md">{option.title}</span>
{selected ? (
{selected && (
<span className="inset-y-0 ml-auto flex items-center pl-3">
<CheckIcon className="h-5 w-5" aria-hidden="true" />
</span>
) : null}
)}
</>
)}
</StyledListboxOption>

View file

@ -20,6 +20,11 @@ interface QuickModelSetupProps {
hideFreeTrialLimitMessage?: boolean;
}
const MODEL_PROVIDERS_URL =
"https://docs.continue.dev/customize/model-providers";
const CODESTRAL_URL = "https://console.mistral.ai/codestral";
const CONTINUE_SETUP_URL = "https://docs.continue.dev/setup/overview";
function AddModelForm({
onDone,
hideFreeTrialLimitMessage,
@ -39,7 +44,7 @@ function AddModelForm({
const selectedProviderApiKeyUrl = selectedModel.params.model.startsWith(
"codestral",
)
? "https://console.mistral.ai/codestral"
? CODESTRAL_URL
: selectedProvider.apiKeyUrl;
function isDisabled() {
@ -97,23 +102,16 @@ function AddModelForm({
return (
<FormProvider {...formMethods}>
<form onSubmit={formMethods.handleSubmit(onSubmit)}>
<div className="p-6 max-w-md mx-auto">
<h1 className="text-center mb-0">Add Chat model</h1>
<div className="mx-auto max-w-md p-6">
<h1 className="mb-0 text-center text-2xl">Add Chat model</h1>
{!hideFreeTrialLimitMessage && hasPassedFTL() && (
<p className="text-sm text-gray-500">
<p className="text-sm text-gray-400">
You've reached the free trial limit of {FREE_TRIAL_LIMIT_REQUESTS}{" "}
free inputs. To keep using Continue, you can either use your own
API key, or use a local LLM. To read more about the options, see
our{" "}
<a
href="https://docs.continue.dev/setup/overview"
target="_blank"
onClick={() =>
ideMessenger.post(
"openUrl",
"https://docs.continue.dev/setup/overview",
)
}
onClick={() => ideMessenger.post("openUrl", CONTINUE_SETUP_URL)}
>
documentation
</a>
@ -121,7 +119,7 @@ function AddModelForm({
</p>
)}
<div className="flex flex-col gap-6 my-8">
<div className="my-8 flex flex-col gap-6">
<div>
<label className="block text-sm font-medium">Provider</label>
<ModelSelectionListbox
@ -132,13 +130,14 @@ function AddModelForm({
([key]) => !["freetrial", "openai-aiohttp"].includes(key),
)
.map(([, provider]) => provider)}
></ModelSelectionListbox>
/>
<InputSubtext className="mb-0">
Don't see your provider?{" "}
<a
href="https://docs.continue.dev/customize/model-providers"
target="_blank"
className="text-inherit underline cursor-pointer hover:text-inherit"
className="cursor-pointer text-inherit underline hover:text-inherit"
onClick={() =>
ideMessenger.post("openUrl", MODEL_PROVIDERS_URL)
}
>
Click here
</a>{" "}
@ -148,12 +147,12 @@ function AddModelForm({
{selectedProvider.downloadUrl && (
<div>
<label className="block text-sm font-medium mb-1">
<label className="mb-1 block text-sm font-medium">
Install provider
</label>
<StyledActionButton onClick={onClickDownloadProvider}>
<p className="underline text-sm">
<p className="text-sm underline">
{selectedProvider.downloadUrl}
</p>
<ArrowTopRightOnSquareIcon width={24} height={24} />
@ -171,13 +170,13 @@ function AddModelForm({
([, provider]) => provider.title === selectedProvider.title,
)?.[1].packages
}
></ModelSelectionListbox>
/>
</div>
{selectedModel.params.model.startsWith("codestral") && (
<div className="my-2">
<Alert>
<p className="font-bold text-sm m-0">Codestral API key</p>
<p className="m-0 text-sm font-bold">Codestral API key</p>
<p className="m-0 mt-1">
Note that codestral requires a different API key from other
Mistral models
@ -189,7 +188,7 @@ function AddModelForm({
{selectedProvider.apiKeyUrl && (
<div>
<>
<label className="block text-sm font-medium mb-1">
<label className="mb-1 block text-sm font-medium">
API key
</label>
<Input
@ -200,9 +199,10 @@ function AddModelForm({
/>
<InputSubtext className="mb-0">
<a
href={selectedProviderApiKeyUrl}
target="_blank"
className="text-inherit underline cursor-pointer hover:text-inherit"
className="cursor-pointer text-inherit underline hover:text-inherit"
onClick={() =>
ideMessenger.post("openUrl", selectedProviderApiKeyUrl)
}
>
Click here
</a>{" "}
@ -211,7 +211,7 @@ function AddModelForm({
</>
</div>
)}
{selectedProvider.collectInputFor &&
selectedProvider.collectInputFor
.filter(
@ -225,7 +225,7 @@ function AddModelForm({
.map((field) => (
<div>
<>
<label className="block text-sm font-medium mb-1">
<label className="mb-1 block text-sm font-medium">
{field.label}
</label>
<Input

View file

@ -63,15 +63,9 @@ interface KeyboardShortcutProps {
function KeyboardShortcut(props: KeyboardShortcutProps) {
const shortcut = getPlatform() === "mac" ? props.mac : props.windows;
return (
<div className="flex justify-between w-full items-center">
<span
style={{
color: vscForeground,
}}
>
{props.description}
</span>
<div className="flex gap-2 float-right">
<div className="flex w-full items-center justify-between">
<span className="text-sm">{props.description}</span>
<div className="float-right flex gap-2">
{shortcut.split(" ").map((key, i) => {
return <KeyDiv key={i} text={key}></KeyDiv>;
})}

View file

@ -27,20 +27,20 @@ function MorePage() {
<div className="overflow-y-scroll">
<div
onClick={() => navigate("/")}
className="items-center flex m-0 p-0 sticky top-0 cursor-pointer border-0 border-b border-solid border-b-zinc-700 bg-inherit"
className="sticky top-0 m-0 flex cursor-pointer items-center border-0 border-b border-solid border-b-zinc-700 bg-inherit p-0"
style={{
backgroundColor: vscBackground,
}}
>
<ArrowLeftIcon className="inline-block ml-3 cursor-pointer w-3 h-3" />
<span className="text-sm font-bold m-2 inline-block">Chat</span>
<ArrowLeftIcon className="ml-3 inline-block h-3 w-3 cursor-pointer" />
<span className="m-2 inline-block text-base font-bold">Chat</span>
</div>
<div className="px-4 divide-y-2 divide-y divide-zinc-700 divide-solid divide-x-0 gap-2">
<div className="gap-2 divide-x-0 divide-y-2 divide-solid divide-zinc-700 px-4">
<div className="py-5">
<div>
<h3 className="mx-auto text-xl mb-1 mt-0">@codebase index</h3>
<span className="text-xs text-stone-500 w-3/4">
<h3 className="mx-auto mb-1 mt-0 text-xl">@codebase index</h3>
<span className="w-3/4 text-xs text-stone-500">
Local embeddings of your codebase
</span>
</div>
@ -48,7 +48,7 @@ function MorePage() {
</div>
<div className="py-5">
<h3 className="text-xl mb-4 mt-0">Help center</h3>
<h3 className="mb-4 mt-0 text-xl">Help center</h3>
<div className="flex flex-col gap-5">
<MoreHelpRow
title="Documentation"
@ -103,7 +103,7 @@ function MorePage() {
</div>
<div>
<h3 className="mx-auto text-lg mb-1">Keyboard shortcuts</h3>
<h3 className="mx-auto mb-1 text-lg">Keyboard shortcuts</h3>
<KeyboardShortcuts />
</div>
</div>

View file

@ -25,7 +25,7 @@ export const HistoryHeader = () => {
onClick={() => navigate("/")}
className="ml-4 inline-block cursor-pointer"
/>
<h3 className="m-2 inline-block text-lg font-bold">History</h3>
<span className="m-2 inline-block text-base font-bold">Chat</span>
</div>
{/* {workspacePaths && workspacePaths.length > 0 && (
<CheckDiv

View file

@ -67,18 +67,18 @@ function Stats() {
>
<div
onClick={() => navigate(-1)}
className="items-center flex m-0 p-0 sticky top-0 cursor-pointer"
className="sticky top-0 m-0 flex cursor-pointer items-center p-0"
style={{
borderBottom: `0.5px solid ${lightGray}`,
backgroundColor: vscBackground,
}}
>
<ArrowLeftIcon className="inline-block ml-4 cursor-pointer w-3 h-3" />
<span className="text-sm font-bold m-2 inline-block">More</span>
<ArrowLeftIcon className="ml-4 inline-block h-3 w-3 cursor-pointer" />
<span className="m-2 inline-block text-base font-bold">More</span>
</div>
<div className="p-2">
<div className="flex gap-2 items-center">
<div className="flex items-center gap-2">
<h2 className="ml-2">Tokens per Day</h2>
<CopyButton
text={generateTable(
@ -111,7 +111,7 @@ function Stats() {
</tbody>
</table>
<div className="flex gap-2 items-center">
<div className="flex items-center gap-2">
<h2 className="ml-2">Tokens per Model</h2>
<CopyButton
text={generateTable(