@@ -122,7 +122,7 @@ writeSidebarChatSubDockedCell[ nbo_NotebookObject, sidebarCell_CellObject, conte
122122 ,
123123 (* else, write a new sub-cell after the last docked cell *)
124124 lastDockedCell = ConfirmMatch [ Last [ Cells [ sidebarCell , CellTags -> "SidebarDockedCell" ], $Failed ], _ CellObject , "SidebarDockedCell" ];
125- NotebookWrite [ System ` NotebookLocationSpecifier [ lastDockedCell , "After" ], RowBox [ { " \n " , makeSidebarChatSubDockedCellExpression [ nbo , sidebarCell , content ] } ] ]
125+ NotebookWrite [ System ` NotebookLocationSpecifier [ lastDockedCell , "After" ], makeSidebarChatSubDockedCellExpression [ nbo , sidebarCell , content ] ]
126126 ];
127127 (* TODO: move selection to side bar chat's input field *)
128128 ],
@@ -152,12 +152,7 @@ removeSidebarChatSubDockedCell // beginDefinition;
152152
153153removeSidebarChatSubDockedCell [ nbo_ NotebookObject , sidebarCell_ CellObject ] := Module [ { subDockedCell },
154154 subDockedCell = First [ Cells [ sidebarCell , CellTags -> "SidebarSubDockedCell" ], Missing @ "NoSidebarSubDockedCell" ];
155- If [ ! MissingQ @ subDockedCell ,
156- FrontEndExecute [ {
157- FrontEnd ` SelectionMove [ subDockedCell , Before , Cell ],
158- FrontEnd ` FrontEndToken [ nbo , "DeletePrevious" ], (* remove the newline character before the sub-cell *)
159- FrontEnd ` NotebookDelete @ subDockedCell } ]
160- ]
155+ If [ ! MissingQ @ subDockedCell , NotebookDelete @ subDockedCell ]
161156];
162157
163158removeSidebarChatSubDockedCell // endDefinition ;
@@ -167,11 +162,7 @@ removeSidebarChatSubDockedCell // endDefinition;
167162(*removeSidebarTopCell*)
168163removeSidebarTopCell // beginDefinition ;
169164
170- removeSidebarTopCell [ nbo_ NotebookObject , sidebarTopCell_ CellObject ] :=
171- FrontEndExecute [ {
172- FrontEnd ` SelectionMove [ sidebarTopCell , Before , Cell ],
173- FrontEnd ` FrontEndToken [ nbo , "DeletePrevious" ], (* remove the newline character before the top cell *)
174- FrontEnd ` NotebookDelete @ sidebarTopCell } ];
165+ removeSidebarTopCell [ nbo_ NotebookObject , sidebarTopCell_ CellObject ] := NotebookDelete @ sidebarTopCell ;
175166
176167removeSidebarTopCell // endDefinition ;
177168
@@ -182,12 +173,7 @@ removeSidebarScrollingContentCell // beginDefinition;
182173
183174removeSidebarScrollingContentCell [ nbo_ NotebookObject , sidebarCell_ CellObject ] := Module [ { scrollablePaneCell },
184175 scrollablePaneCell = First [ Cells [ sidebarCell , CellTags -> "SidebarScrollingContentCell" ], Missing @ "NoScrollingSidebarCell" ];
185- If [ ! MissingQ @ scrollablePaneCell ,
186- FrontEndExecute [ {
187- FrontEnd ` SelectionMove [ scrollablePaneCell , Before , Cell ],
188- FrontEnd ` FrontEndToken [ nbo , "DeletePrevious" ], (* remove the newline character before the top cell *)
189- FrontEnd ` NotebookDelete @ scrollablePaneCell } ]
190- ]
176+ If [ ! MissingQ @ scrollablePaneCell , NotebookDelete @ scrollablePaneCell ]
191177];
192178
193179removeSidebarScrollingContentCell // endDefinition ;
@@ -205,7 +191,7 @@ Module[ { sidebarCellObj, dockedCellObj, chatInputCellObj },
205191 With [ { sc = sidebarCellObj , cc = chatInputCellObj , dc = dockedCellObj },
206192 Cell [ BoxData @
207193 PaneBox [
208- RowBox @ Riffle [ cells , " \n " ] ,
194+ RowBox @ cells ,
209195 AppearanceElements -> {},
210196 ImageSize ->
211197 Dynamic [
@@ -2671,7 +2657,7 @@ loadConversation[ nbo_NotebookObject, sidebarCell_CellObject, id_ ] := Enclose[
26712657 scrollablePaneCell = First [ Cells [ sidebarCell , CellTags -> "SidebarScrollingContentCell" ], Missing @ "NoScrollingContent" ];
26722658 If [ MissingQ @ scrollablePaneCell ,
26732659 lastDockedCell = ConfirmMatch [ Last [ Cells [ sidebarCell , CellTags -> "SidebarDockedCell" ], $Failed ], _ CellObject , "SidebarDockedCell" ];
2674- NotebookWrite [ System ` NotebookLocationSpecifier [ lastDockedCell , "After" ], RowBox [ { " \n " , sidebarScrollingCell [ nbo , cells ] } ] ]
2660+ NotebookWrite [ System ` NotebookLocationSpecifier [ lastDockedCell , "After" ], sidebarScrollingCell [ nbo , cells ] ]
26752661 , (* ELSE *)
26762662 NotebookWrite [ scrollablePaneCell , sidebarScrollingCell [ nbo , cells ] ]
26772663 ];
0 commit comments