summaryrefslogtreecommitdiff
path: root/extension/react-app/src/pages/settings.tsx
diff options
context:
space:
mode:
authorNate Sesti <33237525+sestinj@users.noreply.github.com>2023-09-23 13:06:00 -0700
committerGitHub <noreply@github.com>2023-09-23 13:06:00 -0700
commite976d60974a7837967d03807605cbf2e7b4f3f9a (patch)
tree5ecb19062abb162832530dd953e9d2801026c23c /extension/react-app/src/pages/settings.tsx
parent470711d25b44d1a545c57bc17d40d5e1fd402216 (diff)
downloadsncontinue-e976d60974a7837967d03807605cbf2e7b4f3f9a.tar.gz
sncontinue-e976d60974a7837967d03807605cbf2e7b4f3f9a.tar.bz2
sncontinue-e976d60974a7837967d03807605cbf2e7b4f3f9a.zip
UI Redesign and fixing many details (#496)
* feat: :lipstick: start of major design upgrade * feat: :lipstick: model selection page * feat: :lipstick: use shortcut to add highlighted code as ctx * feat: :lipstick: better display of errors * feat: :lipstick: ui for learning keyboard shortcuts, more details * refactor: :construction: testing slash commands ui * Truncate continue.log * refactor: :construction: refactoring client_session, ui, more * feat: :bug: layout fixes * refactor: :lipstick: ui to enter OpenAI Key * refactor: :truck: rename MaybeProxyOpenAI -> OpenAIFreeTrial * starting help center * removing old shortcut docs * fix: :bug: fix model setting logic to avoid overwrites * feat: :lipstick: tutorial and model descriptions * refactor: :truck: rename unused -> saved * refactor: :truck: rename model roles * feat: :lipstick: edit indicator * refactor: :lipstick: move +, folder icons * feat: :lipstick: tab to clear all context * fix: :bug: context providers ui fixes * fix: :bug: fix lag when stopping step * fix: :bug: don't override system message for models * fix: :bug: fix continue button cursor * feat: :lipstick: title bar * fix: :bug: updates to code highlighting logic and more * fix: :bug: fix renaming of summarize model role * feat: :lipstick: help page and better session title * feat: :lipstick: more help page / ui improvements * feat: :lipstick: set session title * fix: :bug: small fixes for changing sessions * fix: :bug: perfecting the highlighting code and ctx interactions * style: :lipstick: sticky headers for scroll, ollama warming * fix: :bug: fix toggle bug --------- Co-authored-by: Ty Dunn <ty@tydunn.com>
Diffstat (limited to 'extension/react-app/src/pages/settings.tsx')
-rw-r--r--extension/react-app/src/pages/settings.tsx45
1 files changed, 30 insertions, 15 deletions
diff --git a/extension/react-app/src/pages/settings.tsx b/extension/react-app/src/pages/settings.tsx
index 8b3d9c5b..4bd51163 100644
--- a/extension/react-app/src/pages/settings.tsx
+++ b/extension/react-app/src/pages/settings.tsx
@@ -1,15 +1,23 @@
-import React, { useContext, useEffect, useState } from "react";
+import React, { useContext } from "react";
import { GUIClientContext } from "../App";
-import { useSelector } from "react-redux";
+import { useDispatch, useSelector } from "react-redux";
import { RootStore } from "../redux/store";
import { useNavigate } from "react-router-dom";
import { ContinueConfig } from "../../../schema/ContinueConfig";
-import { Button, TextArea, lightGray, secondaryDark } from "../components";
+import {
+ Button,
+ TextArea,
+ lightGray,
+ secondaryDark,
+ vscBackground,
+} from "../components";
import styled from "styled-components";
-import { ArrowLeftIcon } from "@heroicons/react/24/outline";
+import { ArrowLeftIcon, Squares2X2Icon } from "@heroicons/react/24/outline";
import Loader from "../components/Loader";
import InfoHover from "../components/InfoHover";
import { FormProvider, useForm } from "react-hook-form";
+import { setDialogMessage, setShowDialog } from "../redux/slices/uiStateSlice";
+import KeyboardShortcutsDialog from "../components/dialogs/KeyboardShortcuts";
const Hr = styled.hr`
border: 0.5px solid ${lightGray};
@@ -70,7 +78,7 @@ const Slider = styled.input.attrs({ type: "range" })`
border: none;
}
`;
-const ALL_MODEL_ROLES = ["default", "small", "medium", "large", "edit", "chat"];
+const ALL_MODEL_ROLES = ["default", "summarize", "edit", "chat"];
function Settings() {
const formMethods = useForm<ContinueConfig>();
@@ -79,6 +87,7 @@ function Settings() {
const navigate = useNavigate();
const client = useContext(GUIClientContext);
const config = useSelector((state: RootStore) => state.serverState.config);
+ const dispatch = useDispatch();
const submitChanges = () => {
if (!client) return;
@@ -106,17 +115,23 @@ function Settings() {
return (
<FormProvider {...formMethods}>
- <div className="w-full">
+ <div className="overflow-scroll">
+ <div
+ className="items-center flex sticky top-0"
+ style={{
+ borderBottom: `0.5px solid ${lightGray}`,
+ backgroundColor: vscBackground,
+ }}
+ >
+ <ArrowLeftIcon
+ width="1.2em"
+ height="1.2em"
+ onClick={submitAndLeave}
+ className="inline-block ml-4 cursor-pointer"
+ />
+ <h3 className="text-lg font-bold m-2 inline-block">Settings</h3>
+ </div>
<form onSubmit={formMethods.handleSubmit(onSubmit)}>
- <div className="items-center flex">
- <ArrowLeftIcon
- width="1.4em"
- height="1.4em"
- onClick={submitAndLeave}
- className="inline-block ml-4 cursor-pointer"
- />
- <h1 className="text-2xl font-bold m-4 inline-block">Settings</h1>
- </div>
{config ? (
<div className="p-2">
<h3 className="flex gap-1">