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", 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;