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.
This commit is contained in:
手瓜一十雪 committed 2026-02-04 12:33:18 +08:00
1 parent 280aac5c75
commit 29d7b95d05
3 files changed
+3

No files matched your search

@@ -10,6 +10,7 @@ const ShowStructedMessage = ({ messages }: ShowStructedMessageProps) => {
return (
<Snippet
hideSymbol
codeString={JSON.stringify(messages, null, 2)}
tooltipProps={{
content: '点击复制',
}}