From f851d8bdc55fa5b506ada1cd105f7f456bb9c7fc Mon Sep 17 00:00:00 2001 From: Dallin Romney Date: Thu, 11 Sep 2025 14:39:31 -0700 Subject: [PATCH] fix: show config errors for selected assistant, remove duplicate fatal error --- gui/src/components/Layout.tsx | 5 +- .../pages/config/sections/AgentsSection.tsx | 82 ++++++++++--------- 2 files changed, 47 insertions(+), 40 deletions(-) diff --git a/gui/src/components/Layout.tsx b/gui/src/components/Layout.tsx index 049c363d5..345d174ea 100644 --- a/gui/src/components/Layout.tsx +++ b/gui/src/components/Layout.tsx @@ -16,6 +16,7 @@ import { saveCurrentSession } from "../redux/thunks/session"; import { fontSize, isMetaEquivalentKeyPressed } from "../util"; import { incrementFreeTrialCount } from "../util/freeTrial"; import { ROUTES } from "../util/navigation"; +import { FatalErrorIndicator } from "./config/FatalErrorNotice"; import TextDialog from "./dialogs"; import { GenerateRuleDialog } from "./GenerateRuleDialog"; import { useMainEditor } from "./mainInput/TipTapEditor"; @@ -26,7 +27,6 @@ import { } from "./OnboardingCard"; import OSRContextMenu from "./OSRContextMenu"; import PostHogPageView from "./PosthogPageView"; -import { FatalErrorIndicator } from "./config/FatalErrorNotice"; const LayoutTopDiv = styled(CustomScrollbarDiv)` height: 100%; @@ -280,7 +280,8 @@ const Layout = () => { - + {/* The fatal error for chat is shown below input */} + {location.pathname !== "/" && }
diff --git a/gui/src/pages/config/sections/AgentsSection.tsx b/gui/src/pages/config/sections/AgentsSection.tsx index 7ceb37534..afeb3d0ad 100644 --- a/gui/src/pages/config/sections/AgentsSection.tsx +++ b/gui/src/pages/config/sections/AgentsSection.tsx @@ -5,11 +5,13 @@ import { ToolTip } from "../../../components/gui/Tooltip"; import { Button, Card, Divider, EmptyState } from "../../../components/ui"; import { useAuth } from "../../../context/Auth"; import { IdeMessengerContext } from "../../../context/IdeMessenger"; +import { useAppSelector } from "../../../redux/hooks"; import { ConfigHeader } from "../components/ConfigHeader"; export function AgentsSection() { - const { profiles } = useAuth(); + const { profiles, selectedProfile } = useAuth(); const ideMessenger = useContext(IdeMessengerContext); + const configError = useAppSelector((state) => state.config.configError); function handleAddAgent() { void ideMessenger.request("config/newAssistantFile", undefined); @@ -29,47 +31,51 @@ export function AgentsSection() { {profiles && profiles.length > 0 ? ( - profiles.map((profile, index) => ( -
-
-
-
- + profiles.map((profile, index) => { + const isSelected = profile.id === selectedProfile?.id; + const errors = isSelected ? configError : profile.errors; + return ( +
+
+
+
+ +
+
+

0 ? "text-error" : ""}`} + > + {profile.title} +

+ {errors && errors.length > 0 && ( +
+ {errors.map((error, errorIndex) => ( +
+ {error.message} +
+ ))} +
+ )} +
-
-

0 ? "text-error" : ""}`} + +

- {profile.errors && profile.errors.length > 0 && ( -
- {profile.errors.map((error, errorIndex) => ( -
- {error.message} -
- ))} -
- )} -
+ + +
- - - + {index < profiles.length - 1 && }
- {index < profiles.length - 1 && } -
- )) + ); + }) ) : ( )}