Skip to content

Comments

Multichatpanel followup#275

Merged
jtpio merged 6 commits intojupyterlab:mainfrom
brichet:multichatpanel_followup
Sep 17, 2025
Merged

Multichatpanel followup#275
jtpio merged 6 commits intojupyterlab:mainfrom
brichet:multichatpanel_followup

Conversation

@brichet
Copy link
Collaborator

@brichet brichet commented Sep 16, 2025

Follow up #262

In the current implementation the muti-chat panel receive an openChat callback, that (1) creates the model from the chat name, and (2) open the chat in the side panel.
To avoid this back and forth (calling a method from the chat panel that perform action on the chat panel), we should probably provide a createModel method, and open the chat from the multi-chat panel itself.

Originally posted by @brichet in #262 (comment)

code change

  • replace the callbacks openChat and createChat in the multichat panel by createModel
    These 2 callbacks were used to open a chat in the panel, the first one with a provided name (existing chat) and the second one without name (new chat). Both functions were supposed to call the addChat(model) function from the panel themselves, which is a bad design since they are executed from the panel.
    Instead, this PR adds a createModel callback that is responsible for creating a chat model, whether a name has been provided or not. In the case of jupyterlab-chat, the name is actually the path of the file.

  • do not open the chat in the createChat commands anymore. Instead there is a new command openAndCreate that do both actions.

  • add a signal when a new section is added to the multichat panel, to add the new chat to the tracker

- replace openChat and createChat callbacks with createModel callback
- do not open chat with the createChat command. A dedicated commands createAndOpen commands has been added
- add some docstring
@github-actions
Copy link
Contributor

Binder 👈 Launch a Binder on branch brichet/jupyter-chat/multichatpanel_followup

@brichet brichet requested a review from jtpio September 16, 2025 13:00
Copy link
Member

@jtpio jtpio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jtpio jtpio merged commit 7a906eb into jupyterlab:main Sep 17, 2025
12 checks passed
@brichet brichet deleted the multichatpanel_followup branch September 17, 2025 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants