From 5aa627a3c0bbe2e15ac176c1a497abeec679dde1 Mon Sep 17 00:00:00 2001 From: Rick Hennigan Date: Wed, 27 Nov 2024 09:23:58 -0500 Subject: [PATCH 1/2] Bugfix: Edits made to code blocks are reflected in inserted code --- Source/Chatbook/Formatting.wl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Source/Chatbook/Formatting.wl b/Source/Chatbook/Formatting.wl index c51ed9bc..5e833924 100644 --- a/Source/Chatbook/Formatting.wl +++ b/Source/Chatbook/Formatting.wl @@ -619,11 +619,15 @@ floatingButtonGrid[ cell_Cell, lang_ ] := Grid[ { checkTemplateBoxes @ { - button[ evaluateLanguageLabel @ lang, insertCodeBelow[ cell, True ] ], + button[ evaluateLanguageLabel @ lang, insertCodeBelow[ EvaluationCell[ ], True ] ], button[ - If[ TrueQ @ CurrentChatSettings[ cellObj, "WorkspaceChat" ], $insertInputButtonLabelWorkspaceChat, $insertInputButtonLabel ], - insertCodeBelow[ cell, False ] ], - button[ $copyToClipboardButtonLabel, copyCodeBlock @ cell ] + If[ TrueQ @ CurrentChatSettings[ cellObj, "WorkspaceChat" ], + $insertInputButtonLabelWorkspaceChat, + $insertInputButtonLabel + ], + insertCodeBelow[ EvaluationCell[ ], False ] + ], + button[ $copyToClipboardButtonLabel, copyCodeBlock @ EvaluationCell[ ] ] } }, Alignment -> Top, @@ -821,6 +825,7 @@ insertCodeInUserNotebook // endDefinition; (* ::Subsubsection::Closed:: *) (*copyCodeBlock*) copyCodeBlock // beginDefinition; +copyCodeBlock[ cell_CellObject ] := copyCodeBlock @ getCodeBlockContent @ cell; copyCodeBlock[ code_String ] := CopyToClipboard @ code; copyCodeBlock[ Cell[ BoxData[ cell_Cell, ___ ] ] ] := copyCodeBlock @ cell; copyCodeBlock[ Cell[ code_String, ___ ] ] := copyCodeBlock @ code; From 2471877f82869eac386296db4fd86396f71e1e39 Mon Sep 17 00:00:00 2001 From: Rick Hennigan Date: Wed, 27 Nov 2024 09:24:58 -0500 Subject: [PATCH 2/2] Paclet version --- PacletInfo.wl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PacletInfo.wl b/PacletInfo.wl index 6456d3e1..25571e9a 100644 --- a/PacletInfo.wl +++ b/PacletInfo.wl @@ -1,7 +1,7 @@ PacletObject[ <| "Name" -> "Wolfram/Chatbook", "PublisherID" -> "Wolfram", - "Version" -> "1.5.2.7", + "Version" -> "1.5.2.8", "WolframVersion" -> "14.1+", "Description" -> "Wolfram Notebooks + LLMs", "License" -> "MIT",