From 6ccdb22a08fa7f98e1aa786ce22c3704b9f99a28 Mon Sep 17 00:00:00 2001 From: Brent O'Neill Date: Wed, 24 Sep 2025 11:58:45 -0600 Subject: [PATCH] Revert "Settings page design sweep" This reverts commit 2ac257480ce7d5c42b2d5855fd3daeda39b27044. --- frontend/components/ui/button.tsx | 11 +- frontend/src/app/settings/page.tsx | 716 +++++++++--------- .../src/components/confirmation-dialog.tsx | 61 +- 3 files changed, 392 insertions(+), 396 deletions(-) diff --git a/frontend/components/ui/button.tsx b/frontend/components/ui/button.tsx index aff33335..b9a83922 100644 --- a/frontend/components/ui/button.tsx +++ b/frontend/components/ui/button.tsx @@ -14,7 +14,8 @@ const buttonVariants = cva( "border border-input hover:bg-muted hover:text-accent-foreground disabled:bg-muted disabled:!border-none", primary: "border bg-background text-secondary-foreground hover:bg-muted hover:shadow-sm", - warning: "bg-warning text-secondary hover:bg-warning/90", + warning: + "bg-warning-foreground text-warning-text hover:bg-warning-foreground/90 hover:shadow-sm", secondary: "border border-muted bg-muted text-secondary-foreground hover:bg-secondary-foreground/5", ghost: @@ -38,14 +39,14 @@ const buttonVariants = cva( variant: "default", size: "default", }, - } + }, ); function toTitleCase(text: string) { return text ?.split(" ") ?.map( - (word) => word?.charAt(0)?.toUpperCase() + word?.slice(1)?.toLowerCase() + (word) => word?.charAt(0)?.toUpperCase() + word?.slice(1)?.toLowerCase(), ) ?.join(" "); } @@ -71,7 +72,7 @@ const Button = React.forwardRef( ignoreTitleCase = false, ...props }, - ref + ref, ) => { const Comp = asChild ? Slot : "button"; let newChildren = children; @@ -100,7 +101,7 @@ const Button = React.forwardRef( )} ); - } + }, ); Button.displayName = "Button"; diff --git a/frontend/src/app/settings/page.tsx b/frontend/src/app/settings/page.tsx index 937d76c0..f49ff393 100644 --- a/frontend/src/app/settings/page.tsx +++ b/frontend/src/app/settings/page.tsx @@ -1,6 +1,6 @@ "use client"; -import { ArrowUpRight, Loader2, PlugZap, RefreshCw } from "lucide-react"; +import { Loader2, PlugZap, RefreshCw } from "lucide-react"; import { useSearchParams } from "next/navigation"; import { Suspense, useCallback, useEffect, useState } from "react"; import { useUpdateFlowSettingMutation } from "@/app/api/mutations/useUpdateFlowSettingMutation"; @@ -88,7 +88,6 @@ interface Connection { function KnowledgeSourcesPage() { const { isAuthenticated, isNoAuthMode } = useAuth(); - console.log({ isAuthenticated, isNoAuthMode }); const { addTask, tasks } = useTask(); const searchParams = useSearchParams(); @@ -123,7 +122,7 @@ function KnowledgeSourcesPage() { { enabled: (isAuthenticated || isNoAuthMode) && currentProvider === "openai", - } + }, ); const { data: ollamaModelsData } = useGetOllamaModelsQuery( @@ -131,14 +130,14 @@ function KnowledgeSourcesPage() { { enabled: (isAuthenticated || isNoAuthMode) && currentProvider === "ollama", - } + }, ); const { data: ibmModelsData } = useGetIBMModelsQuery( undefined, // No params for now, could be extended later { enabled: (isAuthenticated || isNoAuthMode) && currentProvider === "ibm", - } + }, ); // Select the appropriate models data based on provider @@ -166,7 +165,7 @@ function KnowledgeSourcesPage() { (variables: Parameters[0]) => { updateFlowSettingMutation.mutate(variables); }, - 500 + 500, ); // Sync system prompt state with settings data @@ -294,7 +293,7 @@ function KnowledgeSourcesPage() { const data = await response.json(); const connections = data.connections || []; const activeConnection = connections.find( - (conn: Connection) => conn.is_active + (conn: Connection) => conn.is_active, ); const isConnected = activeConnection !== undefined; @@ -306,8 +305,8 @@ function KnowledgeSourcesPage() { status: isConnected ? "connected" : "not_connected", connectionId: activeConnection?.connection_id, } - : c - ) + : c, + ), ); } } @@ -350,7 +349,7 @@ function KnowledgeSourcesPage() { `response_type=code&` + `scope=${result.oauth_config.scopes.join(" ")}&` + `redirect_uri=${encodeURIComponent( - result.oauth_config.redirect_uri + result.oauth_config.redirect_uri, )}&` + `access_type=offline&` + `prompt=consent&` + @@ -499,7 +498,7 @@ function KnowledgeSourcesPage() { const handleEditInLangflow = ( flowType: "chat" | "ingest", - closeDialog: () => void + closeDialog: () => void, ) => { // Select the appropriate flow ID and edit URL based on flow type const targetFlowId = @@ -556,6 +555,349 @@ function KnowledgeSourcesPage() { return (
+ {/* Agent Behavior Section */} + + +
+
+ Agent + + Quick Agent settings. Edit in Langflow for full control. + +
+
+ Restore flow} + title="Restore default Agent flow" + description="This restores defaults and discards all custom settings and overrides. This can't be undone." + confirmText="Restore" + variant="destructive" + onConfirm={handleRestoreRetrievalFlow} + /> + + + Langflow icon + + + + + Edit in Langflow + + } + title="Edit Agent flow in Langflow" + description="You're entering Langflow. You can edit the Agent flow and other underlying flows. Manual changes to components, wiring, or I/O can break this experience." + confirmText="Proceed" + onConfirm={(closeDialog) => + handleEditInLangflow("chat", closeDialog) + } + /> +
+
+
+ +
+
+ + +
+
+ +