From 705453532186050ae5b10ac6c92f8e82b9896f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Wed, 4 Feb 2026 12:33:18 +0800 Subject: [PATCH] Add codeString prop to Snippet for formatted JSON Pass JSON.stringify(...) as the codeString prop to Snippet so structured message/response objects are rendered as pretty-printed JSON and can be copied via the tooltip. Changes applied in show_structed_message.tsx, display_card/render.tsx, and display_card/response.tsx. --- .../components/chat_input/components/show_structed_message.tsx | 1 + .../src/components/onebot/display_card/render.tsx | 1 + .../src/components/onebot/display_card/response.tsx | 1 + 3 files changed, 3 insertions(+) diff --git a/packages/napcat-webui-frontend/src/components/chat_input/components/show_structed_message.tsx b/packages/napcat-webui-frontend/src/components/chat_input/components/show_structed_message.tsx index 6dd63425..13032967 100644 --- a/packages/napcat-webui-frontend/src/components/chat_input/components/show_structed_message.tsx +++ b/packages/napcat-webui-frontend/src/components/chat_input/components/show_structed_message.tsx @@ -10,6 +10,7 @@ const ShowStructedMessage = ({ messages }: ShowStructedMessageProps) => { return ( { = ({