diff --git a/client/src/components/JsonView.tsx b/client/src/components/JsonView.tsx index 9787b76..3fcbf8e 100644 --- a/client/src/components/JsonView.tsx +++ b/client/src/components/JsonView.tsx @@ -12,6 +12,7 @@ interface JsonViewProps { initialExpandDepth?: number; className?: string; withCopyButton?: boolean; + isError?: boolean; } const JsonView = memo( @@ -21,6 +22,7 @@ const JsonView = memo( initialExpandDepth = 3, className, withCopyButton = true, + isError = false, }: JsonViewProps) => { const { toast } = useToast(); const [copied, setCopied] = useState(false); @@ -86,6 +88,7 @@ const JsonView = memo( name={name} depth={0} initialExpandDepth={initialExpandDepth} + isError={isError} /> @@ -100,17 +103,25 @@ interface JsonNodeProps { name?: string; depth: number; initialExpandDepth: number; + isError?: boolean; } const JsonNode = memo( - ({ data, name, depth = 0, initialExpandDepth }: JsonNodeProps) => { + ({ + data, + name, + depth = 0, + initialExpandDepth, + isError = false, + }: JsonNodeProps) => { const [isExpanded, setIsExpanded] = useState(depth < initialExpandDepth); const [typeStyleMap] = useState>({ number: "text-blue-600", boolean: "text-amber-600", null: "text-purple-600", undefined: "text-gray-600", - string: "text-green-600 break-all whitespace-pre-wrap", + string: "text-green-600 group-hover:text-green-500", + error: "text-red-600 group-hover:text-red-500", default: "text-gray-700", }); const dataType = getDataType(data); @@ -214,7 +225,14 @@ const JsonNode = memo( {name}: )} -
"{value}"
+
+              "{value}"
+            
); } @@ -228,8 +246,8 @@ const JsonNode = memo( )}
 setIsExpanded(!isExpanded)}
             title={isExpanded ? "Click to collapse" : "Click to expand"}
diff --git a/client/src/components/Sidebar.tsx b/client/src/components/Sidebar.tsx
index 31f9b68..a53d337 100644
--- a/client/src/components/Sidebar.tsx
+++ b/client/src/components/Sidebar.tsx
@@ -103,14 +103,19 @@ const Sidebar = ({
       
- + setCommand(e.target.value)} @@ -132,8 +140,14 @@ const Sidebar = ({ />
- + setArgs(e.target.value)} @@ -144,8 +158,11 @@ const Sidebar = ({ ) : ( <>
- + setSseUrl(e.target.value)} @@ -157,6 +174,7 @@ const Sidebar = ({ variant="outline" onClick={() => setShowBearerToken(!showBearerToken)} className="flex items-center w-full" + aria-expanded={showBearerToken} > {showBearerToken ? ( @@ -167,8 +185,14 @@ const Sidebar = ({ {showBearerToken && (
- + setBearerToken(e.target.value)} @@ -187,6 +211,7 @@ const Sidebar = ({ onClick={() => setShowEnvVars(!showEnvVars)} className="flex items-center w-full" data-testid="env-vars-button" + aria-expanded={showEnvVars} > {showEnvVars ? ( @@ -201,6 +226,7 @@ const Sidebar = ({
{ @@ -243,6 +269,7 @@ const Sidebar = ({
setShowConfig(!showConfig)} className="flex items-center w-full" data-testid="config-button" + aria-expanded={showConfig} > {showConfig ? ( @@ -325,7 +353,10 @@ const Sidebar = ({ return (
-
{typeof configItem.value === "number" ? ( - + @@ -375,6 +407,7 @@ const Sidebar = ({ ) : ( { @@ -454,14 +487,19 @@ const Sidebar = ({ {loggingSupported && connectionStatus === "connected" && (
- +