Skip to content

Commit cb14325

Browse files
brichetdlqqq
authored andcommitted
Clean the panel with toolbar workaround after upgrading to jupyterlab>=4.6
1 parent 19b69c2 commit cb14325

1 file changed

Lines changed: 3 additions & 21 deletions

File tree

packages/jupyter-chat/src/widgets/multichat-panel.tsx

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { ArrayExt } from '@lumino/algorithm';
2525
import { Message, MessageLoop } from '@lumino/messaging';
2626
import { Debouncer } from '@lumino/polling';
2727
import { ISignal, Signal } from '@lumino/signaling';
28-
import { Panel, Widget } from '@lumino/widgets';
28+
import { Widget } from '@lumino/widgets';
2929
import React, { useEffect, useRef, useState } from 'react';
3030

3131
import { ChatSelectorPopup } from './chat-selector-popup';
@@ -45,26 +45,8 @@ const SIDEPANEL_CLASS = 'jp-chat-sidepanel';
4545
const ADD_BUTTON_CLASS = 'jp-chat-add';
4646
const OPEN_SELECT_CLASS = 'jp-chat-open';
4747
const SIDEPANEL_WIDGET_CLASS = 'jp-chat-sidepanel-widget';
48-
// TODO: Drop this workaround class (and related CSS) once we depend on
49-
// @jupyterlab/ui-components >= 4.6.0 (refs - jupyterlab/jupyterlab#18824).
5048
const TOOLBAR_CLASS = 'jp-chat-sidepanel-widget-toolbar';
5149

52-
/**
53-
* A panel widget with a reactive toolbar.
54-
*/
55-
class ReactivePanelWithToolbar extends Panel {
56-
constructor() {
57-
super();
58-
this._toolbar = new ReactiveToolbar({ noFocusOnClick: true });
59-
}
60-
61-
get toolbar(): ReactiveToolbar {
62-
return this._toolbar;
63-
}
64-
65-
private _toolbar: ReactiveToolbar;
66-
}
67-
6850
/**
6951
* Generic sidepanel widget including multiple chats and the add chat button.
7052
*/
@@ -531,9 +513,9 @@ export namespace MultiChatPanel {
531513
/**
532514
* A widget containing the chat and its toolbar.
533515
*/
534-
class SidePanelWidget extends ReactivePanelWithToolbar {
516+
class SidePanelWidget extends PanelWithToolbar {
535517
constructor(options: SidePanelWidget.IOptions) {
536-
super();
518+
super({ toolbar: new ReactiveToolbar({ noFocusOnClick: true }) });
537519
this._chatWidget = options.widget;
538520
this._displayName = options.displayName ?? options.widget.model.name;
539521
const trans = options.trans;

0 commit comments

Comments
 (0)