Skip to content

Commit f5bbd99

Browse files
committed
Use the chat.IOptions in multichat panel to clarify.
1 parent 9d6de18 commit f5bbd99

File tree

2 files changed

+5
-30
lines changed

2 files changed

+5
-30
lines changed

packages/jupyter-chat/src/components/chat.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export function ChatBody(props: Chat.IChatProps): JSX.Element {
5959
}
6060

6161
export function Chat(props: Chat.IOptions): JSX.Element {
62-
const [view, setView] = useState<Chat.View>(props.chatView || Chat.View.chat);
62+
const [view, setView] = useState<Chat.View>(Chat.View.chat);
6363
return (
6464
<JlThemeProvider themeManager={props.themeManager ?? null}>
6565
<Box
@@ -154,10 +154,6 @@ export namespace Chat {
154154
* The theme manager.
155155
*/
156156
themeManager?: IThemeManager | null;
157-
/**
158-
* The view to render.
159-
*/
160-
chatView?: View;
161157
/**
162158
* A settings panel that can be used for dedicated settings (e.g. jupyter-ai)
163159
*/

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

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
* Originally adapted from jupyterlab-chat's ChatPanel
99
*/
1010

11-
import { InputDialog, IThemeManager } from '@jupyterlab/apputils';
12-
import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
11+
import { InputDialog } from '@jupyterlab/apputils';
1312
import {
1413
addIcon,
1514
closeIcon,
@@ -34,11 +33,6 @@ import {
3433
} from '../components';
3534
import { chatIcon, readIcon } from '../icons';
3635
import { IChatModel } from '../model';
37-
import {
38-
IAttachmentOpenerRegistry,
39-
IChatCommandRegistry,
40-
IMessageFooterRegistry
41-
} from '../registers';
4236

4337
const SIDEPANEL_CLASS = 'jp-chat-sidepanel';
4438
const ADD_BUTTON_CLASS = 'jp-chat-add';
@@ -58,13 +52,8 @@ export class MultiChatPanel extends SidePanel {
5852

5953
this.addClass(SIDEPANEL_CLASS);
6054

61-
this._rmRegistry = options.rmRegistry;
62-
this._themeManager = options.themeManager;
63-
this._chatCommandRegistry = options.chatCommandRegistry;
64-
this._attachmentOpenerRegistry = options.attachmentOpenerRegistry;
55+
this._chatOptions = options;
6556
this._inputToolbarFactory = options.inputToolbarFactory;
66-
this._messageFooterRegistry = options.messageFooterRegistry;
67-
this._welcomeMessage = options.welcomeMessage;
6857

6958
this._getChatNames = options.getChatNames;
7059
this._createModel = options.createModel;
@@ -149,13 +138,8 @@ export class MultiChatPanel extends SidePanel {
149138
// Create a new widget.
150139
const widget = new ChatWidget({
151140
model,
152-
rmRegistry: this._rmRegistry,
153-
themeManager: this._themeManager,
154-
chatCommandRegistry: this._chatCommandRegistry,
155-
attachmentOpenerRegistry: this._attachmentOpenerRegistry,
141+
...this._chatOptions,
156142
inputToolbarRegistry,
157-
messageFooterRegistry: this._messageFooterRegistry,
158-
welcomeMessage: this._welcomeMessage,
159143
area: 'sidebar'
160144
});
161145

@@ -267,13 +251,8 @@ export class MultiChatPanel extends SidePanel {
267251
this
268252
);
269253
private _sectionAdded = new Signal<MultiChatPanel, ChatSection>(this);
270-
private _rmRegistry: IRenderMimeRegistry;
271-
private _themeManager?: IThemeManager | null;
272-
private _chatCommandRegistry?: IChatCommandRegistry;
273-
private _attachmentOpenerRegistry?: IAttachmentOpenerRegistry;
254+
private _chatOptions: Omit<Chat.IOptions, 'model' | 'inputToolbarRegistry'>;
274255
private _inputToolbarFactory?: IInputToolbarRegistryFactory;
275-
private _messageFooterRegistry?: IMessageFooterRegistry;
276-
private _welcomeMessage?: string;
277256
private _updateChatListDebouncer: Debouncer;
278257

279258
private _createModel?: (

0 commit comments

Comments
 (0)