From 48b8f1f0ad89a2b4e35f49c360576dd5aa99a7c0 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Mon, 28 Aug 2023 19:43:21 -0700 Subject: feat: :lipstick: fixed footer and change button color --- extension/react-app/src/components/Layout.tsx | 146 ++++++++++++++------------ extension/react-app/src/pages/gui.tsx | 7 ++ 2 files changed, 87 insertions(+), 66 deletions(-) (limited to 'extension') diff --git a/extension/react-app/src/components/Layout.tsx b/extension/react-app/src/components/Layout.tsx index 897fd683..143b2302 100644 --- a/extension/react-app/src/components/Layout.tsx +++ b/extension/react-app/src/components/Layout.tsx @@ -25,6 +25,7 @@ import { useNavigate } from "react-router-dom"; import ModelSelect from "./ModelSelect"; // #region Styled Components +const FOOTER_HEIGHT = "1.8em"; const LayoutTopDiv = styled.div` height: 100%; @@ -58,6 +59,14 @@ const Footer = styled.footer` justify-content: right; padding: 8px; align-items: center; + width: calc(100% - 16px); + height: ${FOOTER_HEIGHT}; +`; + +const GridDiv = styled.div` + display: grid; + grid-template-rows: 1fr auto; + height: 100vh; `; // #endregion @@ -122,7 +131,77 @@ const Layout = () => { }} message={dialogMessage} /> - + + +
+ +
+
+ {localStorage.getItem("hideFeature") === "true" || ( + { + localStorage.setItem("hideFeature", "true"); + }} + onMouseEnter={() => { + dispatch( + setBottomMessage( + "🎁 New Feature: Use ⌘⇧R automatically debug errors in the terminal (you can click the sparkle icon to make it go away)" + ) + ); + }} + onMouseLeave={() => { + dispatch(setBottomMessage(undefined)); + }} + width="1.3em" + height="1.3em" + color="yellow" + /> + )} + + + { + client?.loadSession(undefined); + }} + text="New Session (⌥⌘N)" + > + + + { + navigate("/history"); + }} + text="History" + > + + + + + + + + + + + + + { + navigate("/settings"); + }} + text="Settings" + > + + +
+
{ > {bottomMessage} - ); diff --git a/extension/react-app/src/pages/gui.tsx b/extension/react-app/src/pages/gui.tsx index ac7c5070..35c17444 100644 --- a/extension/react-app/src/pages/gui.tsx +++ b/extension/react-app/src/pages/gui.tsx @@ -202,6 +202,13 @@ function GUI(props: GUIProps) { const onMainTextInput = (event?: any) => { if (mainTextInputRef.current) { let input = (mainTextInputRef.current as any).inputValue; + + if (input.startsWith("#") && (input.length === 7 || input.length === 4)) { + localStorage.setItem("continueButtonColor", input); + (mainTextInputRef.current as any).setInputValue(""); + return; + } + // cmd+enter to /edit if (isMetaEquivalentKeyPressed(event)) { input = `/edit ${input}`; -- cgit v1.2.3-70-g09d2