@@ -306,7 +306,7 @@ sidebarNewChatButton[ nbo_NotebookObject, sidebarCell_CellObject ] :=
306306 removeSidebarScrollingCellContent [ nbo , sidebarCell ];
307307 removeSidebarChatSubDockedCell [ nbo , sidebarCell ];
308308 CurrentChatSettings [ sidebarCell , "ConversationUUID" ] = CreateUUID [ ];
309- CurrentValue [ sidebarCell , { TaggingRules , "ConversationTitle" } ] = ""
309+ setCurrentValue [ sidebarCell , { TaggingRules , "ConversationTitle" }, "" ]
310310 ,
311311 Appearance -> "Suppressed" ,
312312 Method -> "Queued"
@@ -347,7 +347,7 @@ sidebarOpenAsAssistantWindowButton[ nbo_NotebookObject, sidebarCell_CellObject ]
347347 removeSidebarScrollingCellContent [ nbo , sidebarCell ];
348348 removeSidebarChatSubDockedCell [ nbo , sidebarCell ];
349349 CurrentChatSettings [ sidebarCell , "ConversationUUID" ] = CreateUUID [ ];
350- CurrentValue [ sidebarCell , { TaggingRules , "ConversationTitle" } ] = "" ;
350+ setCurrentValue [ sidebarCell , { TaggingRules , "ConversationTitle" }, "" ] ;
351351 FrontEndTokenExecute [ nbo , "HideSidebar" ];
352352 ]
353353 ],
@@ -381,7 +381,7 @@ sidebarHideButton[ nbo_NotebookObject ] := Button[
381381 ],
382382 tr @ "SidebarToolbarButtonTooltipHideSidebar"
383383 ],
384- CurrentValue [ $FrontEndSession , "ShowNotebookAssistant" ] = False ;
384+ setCurrentValue [ $FrontEndSession , "ShowNotebookAssistant" , False ] ;
385385 FrontEndTokenExecute [nbo , "HideSidebar" ],
386386 Appearance -> "Suppressed"
387387]
@@ -452,12 +452,12 @@ makeWorkspaceChatSubDockedCellExpression // endDefinition;
452452writeWorkspaceChatSubDockedCell // beginDefinition ;
453453
454454writeWorkspaceChatSubDockedCell [ nbo_ NotebookObject , content_ ] := (
455- CurrentValue [ nbo , DockedCells ] = Inherited ;
456- CurrentValue [ nbo , DockedCells ] = {
455+ setCurrentValue [ nbo , DockedCells , Inherited ] ;
456+ setCurrentValue [ nbo , DockedCells , {
457457 First @ Replace [ AbsoluteCurrentValue [ nbo , DockedCells ], c_ Cell :> {c } ],
458- makeWorkspaceChatSubDockedCellExpression [ content ] };
459- (* Rewriting docked cells seems to steal focus from the chat input field, so restore it here: *)
460- If [ SelectedCells @ nbo === { }, moveToChatInputField [ nbo , True ] ]
458+ makeWorkspaceChatSubDockedCellExpression [ content ] } ] ;
459+ (* Rewriting docked cells seems to steal focus from the chat input field, so restore it here: *)
460+ If [ SelectedCells @ nbo === { }, moveToChatInputField [ nbo , True ] ]
461461)
462462
463463writeWorkspaceChatSubDockedCell [ nbo_ NotebookObject , WindowTitle ] := writeWorkspaceChatSubDockedCell [
@@ -480,7 +480,7 @@ writeWorkspaceChatSubDockedCell // endDefinition;
480480(*removeWorkspaceChatSubDockedCell*)
481481removeWorkspaceChatSubDockedCell // beginDefinition ;
482482
483- removeWorkspaceChatSubDockedCell [ nbo_ NotebookObject ] := CurrentValue [ nbo , DockedCells ] = Inherited ;
483+ removeWorkspaceChatSubDockedCell [ nbo_ NotebookObject ] := setCurrentValue [ nbo , DockedCells , Inherited ] ;
484484
485485removeWorkspaceChatSubDockedCell // endDefinition ;
486486
@@ -523,7 +523,7 @@ newChatButton[ Dynamic[ nbo_ ] ] :=
523523 NotebookDelete @ Cells @ nbo ;
524524 removeWorkspaceChatSubDockedCell @ nbo ;
525525 CurrentChatSettings [ nbo , "ConversationUUID" ] = CreateUUID [ ];
526- CurrentValue [ nbo , { TaggingRules , "ConversationTitle" } ] = "" ;
526+ setCurrentValue [ nbo , { TaggingRules , "ConversationTitle" }, "" ] ;
527527 moveChatInputToTop @ nbo ;
528528 ,
529529 Appearance -> "Suppressed" ,
@@ -677,7 +677,7 @@ makeSidebarChatInputCell[ initialContent_ ] := Cell[
677677 ];
678678 (* spooky action at a distance: regenerating a side bar ChatOutput cell *)
679679 If [ cellTaggedQ [ thisCell , "RegenerateChatOutput" ],
680- chatEvalCell = CurrentValue [ sidebarCell , { TaggingRules , "ChatEvaluationCell" } ];
680+ chatEvalCell = CurrentValue [ sidebarCell , { TaggingRules , "ChatEvaluationCell" } ]; (* get the CellObject stored in the TaggingRules *)
681681 With [ { sbc = sidebarCell }, (* "Set" is HoldFirst so we must inject values *)
682682 FrontEndExecute [ {
683683 FrontEnd ` SetOptions [ thisCell , CellTags -> "SidebarChatInputCell" ],
@@ -688,7 +688,7 @@ makeSidebarChatInputCell[ initialContent_ ] := Cell[
688688 ]
689689 ,
690690 SynchronousUpdating -> False ,
691- TrackedSymbols :> { returnKeyDownQ }
691+ TrackedSymbols :> { returnKeyDownQ } (* changes to TaggingRules are automatically tracked *)
692692 ],
693693 (* no need to templatize an attached cell as it is ephemeral *)
694694 PaneSelector [
@@ -2138,16 +2138,15 @@ loadingOverlay // endDefinition;
21382138(* ::Subsection::Closed:: *)
21392139(*restoreVerticalScrollbar*)
21402140restoreVerticalScrollbar // beginDefinition ;
2141- restoreVerticalScrollbar [ nbo_ NotebookObject ] := CurrentValue [ nbo , WindowElements ] = Inherited ;
2141+ restoreVerticalScrollbar [ nbo_ NotebookObject ] := setCurrentValue [ nbo , WindowElements , Inherited ] ;
21422142restoreVerticalScrollbar // endDefinition ;
21432143
21442144(* ::**************************************************************************************************************:: *)
21452145(* ::Subsection::Closed:: *)
21462146(*hideVerticalScrollbar*)
21472147hideVerticalScrollbar // beginDefinition ;
21482148
2149- hideVerticalScrollbar [ nbo_ NotebookObject ] := CurrentValue [ nbo , WindowElements ] =
2150- DeleteCases [ AbsoluteCurrentValue [ nbo , WindowElements ], "VerticalScrollBar" ];
2149+ hideVerticalScrollbar [ nbo_ NotebookObject ] := setCurrentValue [ nbo , WindowElements , DeleteCases [ AbsoluteCurrentValue [ nbo , WindowElements ], "VerticalScrollBar" ] ];
21512150
21522151hideVerticalScrollbar // endDefinition ;
21532152
@@ -2713,16 +2712,16 @@ loadConversation[ nbo_NotebookObject, None, id_ ] := Enclose[
27132712 NotebookDelete @ First [ Cells [ nbo , AttachedCell -> True , CellStyle -> "ChatInputField" ], $Failed ];
27142713
27152714 WithCleanup [
2716- CurrentValue [ nbo , Selectable ] = True ,
2715+ setCurrentValue [ nbo , Selectable , True ] ,
27172716 SelectionMove [ nbo , Before , Notebook , AutoScroll -> True ];
27182717 ConfirmMatch [ NotebookWrite [ nbo , cells , AutoScroll -> False ], Null , "Write" ];
27192718 If [ Cells @ nbo === { }, NotebookWrite [ nbo , cells , AutoScroll -> False ] ],
2720- CurrentValue [ nbo , Selectable ] = Inherited
2719+ setCurrentValue [ nbo , Selectable , Inherited ]
27212720 ];
27222721
27232722 ChatbookAction [ "AttachWorkspaceChatInput" , nbo ];
27242723 CurrentChatSettings [ nbo , "ConversationUUID" ] = uuid ;
2725- CurrentValue [ nbo , { TaggingRules , "ConversationTitle" } ] = title ;
2724+ setCurrentValue [ nbo , { TaggingRules , "ConversationTitle" }, title ] ;
27262725 writeWorkspaceChatSubDockedCell [ nbo , WindowTitle ];
27272726 restoreVerticalScrollbar @ nbo ;
27282727 moveToChatInputField [ nbo , True ]
@@ -2750,7 +2749,7 @@ loadConversation[ nbo_NotebookObject, sidebarCell_CellObject, id_ ] := Enclose[
27502749 ];
27512750
27522751 CurrentChatSettings [ sidebarCell , "ConversationUUID" ] = uuid ;
2753- CurrentValue [ sidebarCell , { TaggingRules , "ConversationTitle" } ] = title ;
2752+ setCurrentValue [ sidebarCell , { TaggingRules , "ConversationTitle" }, title ] ;
27542753 writeSidebarChatSubDockedCell [ nbo , sidebarCell , WindowTitle ];
27552754 (* TODO: moveToChatInputField[ nbo, True ] *)
27562755 ] // withLoadingOverlay [ { nbo , sidebarCell } ],
0 commit comments