From d0f834da6b29733b5d12bfa1927cd9903b395cb3 Mon Sep 17 00:00:00 2001 From: Test Date: Wed, 23 Oct 2024 18:25:26 -0700 Subject: [PATCH] gui: misc css fixes --- .../components/History/HistoryTableRow.tsx | 6 +-- gui/src/components/mainInput/TutorialCard.tsx | 19 +++---- .../modelSelection/ModelSelectionListbox.tsx | 31 +++++++---- gui/src/forms/AddModelForm.tsx | 54 +++++++++---------- gui/src/pages/More/KeyboardShortcuts.tsx | 12 ++--- gui/src/pages/More/More.tsx | 16 +++--- gui/src/pages/history/HistoryHeader.tsx | 2 +- gui/src/pages/stats.tsx | 10 ++-- 8 files changed, 77 insertions(+), 73 deletions(-) diff --git a/gui/src/components/History/HistoryTableRow.tsx b/gui/src/components/History/HistoryTableRow.tsx index ca140c8ab..76c241d63 100644 --- a/gui/src/components/History/HistoryTableRow.tsx +++ b/gui/src/components/History/HistoryTableRow.tsx @@ -56,10 +56,10 @@ export function HistoryTableRow({ onMouseLeave={() => setHovered(false)} >
{ // Save current session - saveSession(); + await saveSession(); await loadSession(session.sessionId); navigate("/"); }} @@ -113,7 +113,7 @@ export function HistoryTableRow({ { - deleteSession(session.sessionId); + await deleteSession(session.sessionId); onDelete(session.sessionId); }} > diff --git a/gui/src/components/mainInput/TutorialCard.tsx b/gui/src/components/mainInput/TutorialCard.tsx index cd5be630b..3a424e257 100644 --- a/gui/src/components/mainInput/TutorialCard.tsx +++ b/gui/src/components/mainInput/TutorialCard.tsx @@ -52,10 +52,10 @@ export function TutorialCard({ onClose }: TutorialCardProps) {
    {!isJetBrains() && (
  • - + ideMessenger.request( "vscode/openMoveRightMarkdown", @@ -70,32 +70,33 @@ export function TutorialCard({ onClose }: TutorialCardProps) {
  • )}
  • - + Highlight code and press {getMetaKeyLabel() + "I"} to quickly make natural language edits
  • - + Highlight code and press {getMetaKeyLabel() + "L"} to add it to the chat window
  • - + Click the gear icon in the bottom right to configure Continue
  • - + + ideMessenger.post("openUrl", "https://docs.continue.dev") + } > Read our documentation {" "} diff --git a/gui/src/components/modelSelection/ModelSelectionListbox.tsx b/gui/src/components/modelSelection/ModelSelectionListbox.tsx index 451be0e16..629463943 100644 --- a/gui/src/components/modelSelection/ModelSelectionListbox.tsx +++ b/gui/src/components/modelSelection/ModelSelectionListbox.tsx @@ -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 ( -
    +
    {window.vscMediaUrl && selectedProvider.icon && ( @@ -141,25 +145,30 @@ function ModelSelectionListbox({ {({ selected }) => ( <> - {window.vscMediaUrl && option.icon && ( - + {option.title === "Autodetect" ? ( + + ) : ( + window.vscMediaUrl && + option.icon && ( + + ) )} {option.title} - {selected ? ( + {selected && ( - ) : null} + )} )} diff --git a/gui/src/forms/AddModelForm.tsx b/gui/src/forms/AddModelForm.tsx index e045ca13e..861333517 100644 --- a/gui/src/forms/AddModelForm.tsx +++ b/gui/src/forms/AddModelForm.tsx @@ -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 (
    -
    -

    Add Chat model

    +
    +

    Add Chat model

    {!hideFreeTrialLimitMessage && hasPassedFTL() && ( -

    +

    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{" "} - ideMessenger.post( - "openUrl", - "https://docs.continue.dev/setup/overview", - ) - } + onClick={() => ideMessenger.post("openUrl", CONTINUE_SETUP_URL)} > documentation @@ -121,7 +119,7 @@ function AddModelForm({

    )} -
    +
    !["freetrial", "openai-aiohttp"].includes(key), ) .map(([, provider]) => provider)} - > + /> Don't see your provider?{" "} + ideMessenger.post("openUrl", MODEL_PROVIDERS_URL) + } > Click here {" "} @@ -148,12 +147,12 @@ function AddModelForm({ {selectedProvider.downloadUrl && (
    -
    {selectedModel.params.model.startsWith("codestral") && (
    -

    Codestral API key

    +

    Codestral API key

    Note that codestral requires a different API key from other Mistral models @@ -189,7 +188,7 @@ function AddModelForm({ {selectedProvider.apiKeyUrl && (

    <> -
    )} - + {selectedProvider.collectInputFor && selectedProvider.collectInputFor .filter( @@ -225,7 +225,7 @@ function AddModelForm({ .map((field) => (
    <> -