@@ -102,6 +102,7 @@ makeSidebarChatSubDockedCellExpression[ nbo_NotebookObject, sidebarCell_CellObje
102102 DeleteCases [ makeWorkspaceChatSubDockedCellExpression @ content , _ [ Magnification | CellTags , _ ] ],
103103 Cell [
104104 CellTags -> "SidebarSubDockedCell" ,
105+ Deletable -> True , (* this cell can be replaced so override Deletable -> False inherited from the main sidebar cell *)
105106 FontSize -> 12 ,
106107 Magnification -> Dynamic [ 0.85 * AbsoluteCurrentValue [ nbo , Magnification ] ],
107108 ShowStringCharacters -> False ] ];
@@ -152,12 +153,7 @@ removeSidebarChatSubDockedCell // beginDefinition;
152153
153154removeSidebarChatSubDockedCell [ nbo_ NotebookObject , sidebarCell_ CellObject ] := Module [ { subDockedCell },
154155 subDockedCell = First [ Cells [ sidebarCell , CellTags -> "SidebarSubDockedCell" ], Missing @ "NoSidebarSubDockedCell" ];
155- If [ ! MissingQ @ subDockedCell ,
156- FrontEndExecute [ {
157- FrontEnd ` SetOptions [ subDockedCell , Deletable -> True ],
158- FrontEnd ` NotebookDelete @ subDockedCell
159- } ]
160- ]
156+ If [ ! MissingQ @ subDockedCell , NotebookDelete @ subDockedCell ]
161157];
162158
163159removeSidebarChatSubDockedCell // endDefinition ;
@@ -167,11 +163,7 @@ removeSidebarChatSubDockedCell // endDefinition;
167163(*removeSidebarTopCell*)
168164removeSidebarTopCell // beginDefinition ;
169165
170- removeSidebarTopCell [ nbo_ NotebookObject , sidebarTopCell_ CellObject ] :=
171- FrontEndExecute [ {
172- FrontEnd ` SetOptions [ sidebarTopCell , Deletable -> True ],
173- FrontEnd ` NotebookDelete @ sidebarTopCell
174- } ];
166+ removeSidebarTopCell [ nbo_ NotebookObject , sidebarTopCell_ CellObject ] := NotebookDelete @ sidebarTopCell ;
175167
176168removeSidebarTopCell // endDefinition ;
177169
@@ -182,12 +174,7 @@ removeSidebarScrollingContentCell // beginDefinition;
182174
183175removeSidebarScrollingContentCell [ nbo_ NotebookObject , sidebarCell_ CellObject ] := Module [ { scrollablePaneCell },
184176 scrollablePaneCell = First [ Cells [ sidebarCell , CellTags -> "SidebarScrollingContentCell" ], Missing @ "NoScrollingSidebarCell" ];
185- If [ ! MissingQ @ scrollablePaneCell ,
186- FrontEndExecute [ {
187- FrontEnd ` SetOptions [ scrollablePaneCell , Deletable -> True ],
188- FrontEnd ` NotebookDelete @ scrollablePaneCell
189- } ]
190- ]
177+ If [ ! MissingQ @ scrollablePaneCell , NotebookDelete @ scrollablePaneCell ]
191178];
192179
193180removeSidebarScrollingContentCell // endDefinition ;
@@ -221,6 +208,7 @@ Module[ { sidebarCellObj, dockedCellObj, chatInputCellObj },
221208 ],
222209 Background -> color @ "NA_NotebookBackground" ,
223210 CellTags -> "SidebarScrollingContentCell" ,
211+ Deletable -> True , (* this cell can be replaced so override Deletable -> False inherited from the main sidebar cell *)
224212 Magnification -> Dynamic [ 0.85 * AbsoluteCurrentValue [ nbo , Magnification ] ]
225213 ] ]
226214]
@@ -333,9 +321,8 @@ sidebarHideButton[ Dynamic[ nbo_ ] ] := Button[
333321 tr @ "SidebarToolbarButtonTooltipHideSidebar"
334322 ],
335323 CurrentValue [ $FrontEndSession , "ShowNotebookAssistant" ] = False ;
336- FrontEndToken [nbo , "HideSidebar" ],
337- Appearance -> "Suppressed" ,
338- Evaluator -> None
324+ FrontEndTokenExecute [nbo , "HideSidebar" ],
325+ Appearance -> "Suppressed"
339326]
340327
341328sidebarHideButton // endDefinition ;
0 commit comments