File tree Expand file tree Collapse file tree 5 files changed +28
-25
lines changed
jupyterlab-chat-extension/src Expand file tree Collapse file tree 5 files changed +28
-25
lines changed Original file line number Diff line number Diff line change 19
19
}
20
20
21
21
/*
22
- *
23
22
* Selectors must be nested in `.jp-ThemedContainer` to have a higher
24
23
* specificity than selectors in rules provided by JupyterLab.
25
24
*
147
146
}
148
147
149
148
/* Keyframe animations */
150
-
151
149
@keyframes jp-chat-typing-bounce {
152
150
0% ,
153
151
80% ,
Original file line number Diff line number Diff line change 41
41
padding : 8px 0 ;
42
42
}
43
43
44
+ /* stylelint-disable-next-line selector-class-pattern */
44
45
.jp-chat-input-container .MuiTextField-root {
45
46
padding-bottom : 8px ;
46
47
}
47
48
48
49
.jp-chat-input-container .jp-chat-drag-hover ::after {
49
50
content : '' ;
50
51
position : absolute;
51
- top : 0 ;
52
- left : 0 ;
53
- right : 0 ;
54
- bottom : 0 ;
52
+ inset : 0 ;
55
53
background : rgb (33 150 243 / 10% );
56
54
border : 2px dashed var (--jp-brand-color1 );
57
55
border-radius : 4px ;
Original file line number Diff line number Diff line change @@ -760,23 +760,6 @@ const chatPanel: JupyterFrontEndPlugin<ChatPanel> = {
760
760
restorer . add ( chatPanel , 'jupyter-chat' ) ;
761
761
}
762
762
763
- // Use events system to watch changes on files, and update the chat list if a chat
764
- // file has been created, deleted or renamed.
765
- const schemaID =
766
- 'https://events.jupyter.org/jupyter_server/contents_service/v1' ;
767
- const actions = [ 'create' , 'delete' , 'rename' ] ;
768
- app . serviceManager . events . stream . connect ( ( _ , emission ) => {
769
- if ( emission . schema_id === schemaID ) {
770
- const action = emission . action as string ;
771
- if (
772
- actions . includes ( action ) &&
773
- ( emission . path as string ) . endsWith ( chatFileType . extensions [ 0 ] )
774
- ) {
775
- chatPanel . updateChatList ( ) ;
776
- }
777
- }
778
- } ) ;
779
-
780
763
/*
781
764
* Command to move a chat from the main area to the side panel.
782
765
*/
Original file line number Diff line number Diff line change @@ -137,6 +137,24 @@ export class ChatPanel extends SidePanel {
137
137
138
138
const content = this . content as AccordionPanel ;
139
139
content . expansionToggled . connect ( this . _onExpansionToggled , this ) ;
140
+
141
+ this . _contentsManager . fileChanged . connect ( ( _ , args ) => {
142
+ if ( args . type === 'delete' ) {
143
+ this . widgets . forEach ( widget => {
144
+ if ( ( widget as ChatSection ) . path === args . oldValue ?. path ) {
145
+ widget . dispose ( ) ;
146
+ }
147
+ } ) ;
148
+ this . updateChatList ( ) ;
149
+ }
150
+ const updateActions = [ 'new' , 'rename' ] ;
151
+ if (
152
+ updateActions . includes ( args . type ) &&
153
+ args . newValue ?. path ?. endsWith ( chatFileType . extensions [ 0 ] )
154
+ ) {
155
+ this . updateChatList ( ) ;
156
+ }
157
+ } ) ;
140
158
}
141
159
142
160
/**
@@ -236,9 +254,9 @@ export class ChatPanel extends SidePanel {
236
254
}
237
255
238
256
/**
239
- * A message handler invoked on an `'after-show '` message.
257
+ * A message handler invoked on an `'after-attach '` message.
240
258
*/
241
- protected onAfterShow ( msg : Message ) : void {
259
+ protected onAfterAttach ( msg : Message ) : void {
242
260
// Wait for the component to be rendered.
243
261
this . _openChat . renderPromise ?. then ( ( ) => this . updateChatList ( ) ) ;
244
262
}
Original file line number Diff line number Diff line change @@ -142,13 +142,19 @@ test.describe('#sidepanel', () => {
142
142
} ) ;
143
143
144
144
test . describe ( '#openingClosing' , ( ) => {
145
+ test . use ( { autoGoto : false } ) ;
146
+
145
147
const name = FILENAME . replace ( '.chat' , '' ) ;
146
148
const NEW_DIR = 'chats_dir' ;
147
149
let panel : Locator ;
148
150
let select : Locator ;
149
151
150
152
test . beforeEach ( async ( { page } ) => {
151
153
await page . filebrowser . contents . uploadContent ( '{}' , 'text' , FILENAME ) ;
154
+ await page . waitForCondition (
155
+ async ( ) => await page . filebrowser . contents . fileExists ( FILENAME )
156
+ ) ;
157
+ await page . goto ( ) ;
152
158
} ) ;
153
159
154
160
test . afterEach ( async ( { page } ) => {
You can’t perform that action at this time.
0 commit comments