Skip to content

Add a welcome message #221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

brichet
Copy link
Collaborator

@brichet brichet commented May 22, 2025

This PR adds an optional welcome message to the chat, rendered as markdown.
This message is displayed on top of all the messages in the chat widget.

It also adds a token to jupyterlab-chat, to allow third party extensions to provide their own message with a plugin. There is no default message in jupyterlab-chat.


Fixes #217
Related to jupyterlite/ai#44

@brichet brichet added enhancement New feature or request @jupyter/chat labels May 22, 2025
Copy link
Contributor

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

@brichet brichet marked this pull request as draft May 22, 2025 09:19
@brichet
Copy link
Collaborator Author

brichet commented May 22, 2025

I was hoping to add UI tests on welcome message, but I'm not sure if this is possible, since jupyterlab-chat doesn't provide a default welcome message.

The 2 ways I could think of to test it are:

@brichet
Copy link
Collaborator Author

brichet commented May 22, 2025

Bump CI

@brichet brichet closed this May 22, 2025
@brichet brichet reopened this May 22, 2025
@brichet brichet marked this pull request as ready for review May 22, 2025 09:28
@brichet brichet requested a review from jtpio May 22, 2025 09:30
* @param rmRegistry - the rendermime registry.
* @returns a promise that resolves to the renderer.
*/
export async function renderContent(
Copy link
Member

@jtpio jtpio May 22, 2025

Choose a reason for hiding this comment

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

Looks like this method is new. Would it make sense to pass an options object instead of individual arguments? In case more parameters need to be added later.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right, I updated it.

@brichet
Copy link
Collaborator Author

brichet commented May 22, 2025

While updating the renderContent function, I noticed that this new namespace MarkdownRenderer may be more relevant outside of the components directory, for consistency (this is not a component).
I moved it in it own module, while keeping the MessageRenderer in the components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request @jupyter/chat
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add cutomizable welcome message when opening the chat
2 participants