From 671335c236245bb9f55bbed8905f618f72898516 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Mon, 25 Nov 2024 17:00:34 -0800 Subject: [PATCH 1/5] github icon --- gui/src/App.tsx | 2 +- gui/src/components/svg/Github.tsx | 27 +++++++++++++++++++++++++++ gui/src/pages/error.tsx | 12 +++++++----- 3 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 gui/src/components/svg/Github.tsx diff --git a/gui/src/App.tsx b/gui/src/App.tsx index 1e34e6e15..fcd8c5135 100644 --- a/gui/src/App.tsx +++ b/gui/src/App.tsx @@ -84,7 +84,7 @@ function App() { const vscTheme = useVscTheme(); const submenuContextProvidersMethods = useSubmenuContextProviders(); - + // throw new Error("hahaha"); return ( { + size?: number; +} + +export function GithubIcon({ + size = 24, + className, + ...props +}: GithubIconProps) { + return ( + + + + ); +} diff --git a/gui/src/pages/error.tsx b/gui/src/pages/error.tsx index 885043989..1f36f3c1f 100644 --- a/gui/src/pages/error.tsx +++ b/gui/src/pages/error.tsx @@ -3,6 +3,7 @@ import { useNavigate, useRouteError } from "react-router-dom"; import { newSession } from "../redux/slices/stateSlice"; import ContinueButton from "../components/mainInput/ContinueButton"; import { vscBackground } from "../components"; +import { GithubIcon } from "../components/svg/Github"; export default function ErrorPage() { const error: any = useRouteError(); @@ -11,17 +12,14 @@ export default function ErrorPage() { const navigate = useNavigate(); return ( -
+

Error in Continue React App

{error.statusText || error.message}


Click below to Continue

+
{ dispatch(newSession()); localStorage.removeItem("persist:root"); + localStorage.removeItem("inputHistory_chat"); + // localStorage.removeItem("showTutorialCard"); + // localStorage.removeItem("onboardingStatus"); + // localStorage.removeItem("lastSessionId"); navigate("/"); }} > From 8e9683d83189af5780c85afc5207958b2cb34334 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Mon, 25 Nov 2024 17:34:06 -0800 Subject: [PATCH 2/5] error page --- gui/src/App.tsx | 1 - gui/src/components/svg/DiscordIcon.tsx | 27 +++++ .../svg/{Github.tsx => GithubIcon.tsx} | 0 gui/src/pages/error.tsx | 100 +++++++++++++++--- gui/src/pages/gui/Chat.tsx | 1 + 5 files changed, 115 insertions(+), 14 deletions(-) create mode 100644 gui/src/components/svg/DiscordIcon.tsx rename gui/src/components/svg/{Github.tsx => GithubIcon.tsx} (100%) diff --git a/gui/src/App.tsx b/gui/src/App.tsx index fcd8c5135..d71e7561a 100644 --- a/gui/src/App.tsx +++ b/gui/src/App.tsx @@ -84,7 +84,6 @@ function App() { const vscTheme = useVscTheme(); const submenuContextProvidersMethods = useSubmenuContextProviders(); - // throw new Error("hahaha"); return ( { + size?: number; +} + +export function DiscordIcon({ + size = 24, + className, + ...props +}: DiscordIconProps) { + return ( + + + + ); +} diff --git a/gui/src/components/svg/Github.tsx b/gui/src/components/svg/GithubIcon.tsx similarity index 100% rename from gui/src/components/svg/Github.tsx rename to gui/src/components/svg/GithubIcon.tsx diff --git a/gui/src/pages/error.tsx b/gui/src/pages/error.tsx index 1f36f3c1f..2c119e001 100644 --- a/gui/src/pages/error.tsx +++ b/gui/src/pages/error.tsx @@ -1,26 +1,80 @@ import { useDispatch } from "react-redux"; import { useNavigate, useRouteError } from "react-router-dom"; import { newSession } from "../redux/slices/stateSlice"; +// import ContinueButton from "../components/mainInput/ContinueButton"; +// import { vscBackground } from "../components"; +import { GithubIcon } from "../components/svg/GithubIcon"; +// import { useState } from "react"; +import { DiscordIcon } from "../components/svg/DiscordIcon"; +import { useContext } from "react"; +import { IdeMessengerContext } from "../context/IdeMessenger"; +import { Button, SecondaryButton } from "../components"; import ContinueButton from "../components/mainInput/ContinueButton"; -import { vscBackground } from "../components"; -import { GithubIcon } from "../components/svg/Github"; -export default function ErrorPage() { +// const GITHUB_LINK = "https://github.com/continuedev/continue/issues/new/choose"; +// const DISCORD_LINK = "https://discord.com/invite/EfJEfdFnDQ"; + +// export default function ErrorPage() { +// const error: any = useRouteError(); +// console.error(error); +// const dispatch = useDispatch(); +// const navigate = useNavigate(); + +// return ( +//
+//

Error in Continue React App

+//

+// {error.statusText || error.message} +//

+//
+//

Click below to Continue

+ +//
+// { +// dispatch(newSession()); +// localStorage.removeItem("persist:root"); +// localStorage.removeItem("inputHistory_chat"); +// // localStorage.removeItem("showTutorialCard"); +// // localStorage.removeItem("onboardingStatus"); +// // localStorage.removeItem("lastSessionId"); +// navigate("/"); +// }} +// > + +// +// +//
+// ); +// } + +const GITHUB_LINK = "https://github.com/continuedev/continue/issues/new/choose"; +const DISCORD_LINK = "https://discord.com/invite/EfJEfdFnDQ"; + +const ErrorPage: React.FC = () => { const error: any = useRouteError(); console.error(error); const dispatch = useDispatch(); const navigate = useNavigate(); + const messenger = useContext(IdeMessengerContext); + const openUrl = (url: string) => { + if (messenger) { + messenger.post("openUrl", url); + } + }; return ( -
-

Error in Continue React App

-

- {error.statusText || error.message} -

-
-

Click below to Continue

- -
+
+

Error in Continue React App

+ +
+        
+          {error.statusText || error.message}
+        
+      
+ + +

Report the issue:

+
+ openUrl(GITHUB_LINK)} + className="flex items-center space-x-2 rounded-lg px-4 py-2 text-white" + > + + {/* Report on GitHub */} + + openUrl(DISCORD_LINK)} + className="flex items-center rounded-lg" + > + + {/* Join Discord */} + +
); -} +}; + +export default ErrorPage; diff --git a/gui/src/pages/gui/Chat.tsx b/gui/src/pages/gui/Chat.tsx index a810dc87a..375e16c36 100644 --- a/gui/src/pages/gui/Chat.tsx +++ b/gui/src/pages/gui/Chat.tsx @@ -163,6 +163,7 @@ export function Chat() { // smoothScrollToBottom(); // }, 400); // }, [smoothScrollToBottom, state.sessionId]); + throw new Error("This is an error"); useEffect(() => { // Cmd + Backspace to delete current step From 9935a08e37b213a392db55f1ab60d0f47737a0df Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Mon, 25 Nov 2024 17:50:03 -0800 Subject: [PATCH 3/5] error page finished --- gui/src/pages/error.tsx | 38 +++++++++++++++++++++++++++----------- gui/src/pages/gui/Chat.tsx | 1 - 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/gui/src/pages/error.tsx b/gui/src/pages/error.tsx index 2c119e001..89edcae39 100644 --- a/gui/src/pages/error.tsx +++ b/gui/src/pages/error.tsx @@ -6,10 +6,17 @@ import { newSession } from "../redux/slices/stateSlice"; import { GithubIcon } from "../components/svg/GithubIcon"; // import { useState } from "react"; import { DiscordIcon } from "../components/svg/DiscordIcon"; -import { useContext } from "react"; +import { useContext, useEffect, useState } from "react"; import { IdeMessengerContext } from "../context/IdeMessenger"; import { Button, SecondaryButton } from "../components"; import ContinueButton from "../components/mainInput/ContinueButton"; +import { + ArrowPathIcon, + ArrowPathRoundedSquareIcon, + FlagIcon, +} from "@heroicons/react/24/outline"; +import Loader from "../components/loaders/Loader"; +import RingLoader from "../components/loaders/RingLoader"; // const GITHUB_LINK = "https://github.com/continuedev/continue/issues/new/choose"; // const DISCORD_LINK = "https://discord.com/invite/EfJEfdFnDQ"; @@ -65,19 +72,23 @@ const ErrorPage: React.FC = () => { messenger.post("openUrl", url); } }; + + const [initialLoad, setInitialLoad] = useState(true); + useEffect(() => { + setTimeout(() => { + setInitialLoad(false); + }, 500); + }, []); return (

Error in Continue React App

-
-        
-          {error.statusText || error.message}
-        
+      
+        {error.statusText || error.message}
       
- { dispatch(newSession()); localStorage.removeItem("persist:root"); @@ -87,7 +98,14 @@ const ErrorPage: React.FC = () => { // localStorage.removeItem("lastSessionId"); navigate("/"); }} - > + > + {initialLoad ? ( + + ) : ( + + )} + Continue +

Report the issue:

@@ -96,14 +114,12 @@ const ErrorPage: React.FC = () => { className="flex items-center space-x-2 rounded-lg px-4 py-2 text-white" > - {/* Report on GitHub */} openUrl(DISCORD_LINK)} className="flex items-center rounded-lg" > - {/* Join Discord */}
diff --git a/gui/src/pages/gui/Chat.tsx b/gui/src/pages/gui/Chat.tsx index 375e16c36..a810dc87a 100644 --- a/gui/src/pages/gui/Chat.tsx +++ b/gui/src/pages/gui/Chat.tsx @@ -163,7 +163,6 @@ export function Chat() { // smoothScrollToBottom(); // }, 400); // }, [smoothScrollToBottom, state.sessionId]); - throw new Error("This is an error"); useEffect(() => { // Cmd + Backspace to delete current step From b9bfaa80c30b2000240a1d54e337f8b49427f92b Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Mon, 25 Nov 2024 17:52:08 -0800 Subject: [PATCH 4/5] error page cleanup --- gui/src/pages/error.tsx | 51 +---------------------------------------- 1 file changed, 1 insertion(+), 50 deletions(-) diff --git a/gui/src/pages/error.tsx b/gui/src/pages/error.tsx index 89edcae39..632d5086c 100644 --- a/gui/src/pages/error.tsx +++ b/gui/src/pages/error.tsx @@ -1,61 +1,12 @@ import { useDispatch } from "react-redux"; import { useNavigate, useRouteError } from "react-router-dom"; import { newSession } from "../redux/slices/stateSlice"; -// import ContinueButton from "../components/mainInput/ContinueButton"; -// import { vscBackground } from "../components"; import { GithubIcon } from "../components/svg/GithubIcon"; -// import { useState } from "react"; import { DiscordIcon } from "../components/svg/DiscordIcon"; import { useContext, useEffect, useState } from "react"; import { IdeMessengerContext } from "../context/IdeMessenger"; import { Button, SecondaryButton } from "../components"; -import ContinueButton from "../components/mainInput/ContinueButton"; -import { - ArrowPathIcon, - ArrowPathRoundedSquareIcon, - FlagIcon, -} from "@heroicons/react/24/outline"; -import Loader from "../components/loaders/Loader"; -import RingLoader from "../components/loaders/RingLoader"; - -// const GITHUB_LINK = "https://github.com/continuedev/continue/issues/new/choose"; -// const DISCORD_LINK = "https://discord.com/invite/EfJEfdFnDQ"; - -// export default function ErrorPage() { -// const error: any = useRouteError(); -// console.error(error); -// const dispatch = useDispatch(); -// const navigate = useNavigate(); - -// return ( -//
-//

Error in Continue React App

-//

-// {error.statusText || error.message} -//

-//
-//

Click below to Continue

- -//
-// { -// dispatch(newSession()); -// localStorage.removeItem("persist:root"); -// localStorage.removeItem("inputHistory_chat"); -// // localStorage.removeItem("showTutorialCard"); -// // localStorage.removeItem("onboardingStatus"); -// // localStorage.removeItem("lastSessionId"); -// navigate("/"); -// }} -// > - -// -// -//
-// ); -// } +import { ArrowPathIcon, FlagIcon } from "@heroicons/react/24/outline"; const GITHUB_LINK = "https://github.com/continuedev/continue/issues/new/choose"; const DISCORD_LINK = "https://discord.com/invite/EfJEfdFnDQ"; From adaba8925ece805f969adff9ebd99ad0024378a3 Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Mon, 25 Nov 2024 17:56:14 -0800 Subject: [PATCH 5/5] change error page message --- gui/src/pages/error.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/src/pages/error.tsx b/gui/src/pages/error.tsx index 632d5086c..d00dd533d 100644 --- a/gui/src/pages/error.tsx +++ b/gui/src/pages/error.tsx @@ -32,7 +32,7 @@ const ErrorPage: React.FC = () => { }, []); return (
-

Error in Continue React App

+

Error in Continue UI

         {error.statusText || error.message}