From e6f5da838301d7dcc6a263aa97f586ccae56d068 Mon Sep 17 00:00:00 2001 From: cgoing Date: Thu, 27 Mar 2025 10:49:37 +0900 Subject: [PATCH] Improve JsonView component styling and change to use JsonView in PromptsTab --- client/src/components/JsonView.tsx | 10 +++++++--- client/src/components/PromptsTab.tsx | 11 +++++------ client/src/components/ToolsTab.tsx | 23 ++++++++++------------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/client/src/components/JsonView.tsx b/client/src/components/JsonView.tsx index 6c348fe..e20dd5c 100644 --- a/client/src/components/JsonView.tsx +++ b/client/src/components/JsonView.tsx @@ -1,5 +1,6 @@ import { useState, memo } from "react"; import { JsonValue } from "./DynamicJsonForm"; +import clsx from "clsx"; interface JsonViewProps { data: JsonValue; @@ -70,7 +71,7 @@ const JsonNode = memo( boolean: "text-amber-600", null: "text-purple-600", undefined: "text-gray-600", - string: "text-green-600", + string: "text-green-600 break-all", default: "text-gray-700", }; @@ -173,7 +174,7 @@ const JsonNode = memo( {name}: )} - "{value}" +

"{value}"

); } @@ -186,7 +187,10 @@ const JsonNode = memo( )} setIsExpanded(!isExpanded)} title={isExpanded ? "Click to collapse" : "Click to expand"} > diff --git a/client/src/components/PromptsTab.tsx b/client/src/components/PromptsTab.tsx index f88b16f..b42cf77 100644 --- a/client/src/components/PromptsTab.tsx +++ b/client/src/components/PromptsTab.tsx @@ -3,7 +3,7 @@ import { Button } from "@/components/ui/button"; import { Combobox } from "@/components/ui/combobox"; import { Label } from "@/components/ui/label"; import { TabsContent } from "@/components/ui/tabs"; -import { Textarea } from "@/components/ui/textarea"; + import { ListPromptsResult, PromptReference, @@ -13,6 +13,7 @@ import { AlertCircle } from "lucide-react"; import { useEffect, useState } from "react"; import ListPane from "./ListPane"; import { useCompletionState } from "@/lib/hooks/useCompletionState"; +import JsonView from "./JsonView"; export type Prompt = { name: string; @@ -151,11 +152,9 @@ const PromptsTab = ({ Get Prompt {promptContent && ( -