Skip to content

Conversation

@brichet
Copy link
Collaborator

@brichet brichet commented Oct 22, 2025

Fixes #300

This PR uses YMap for each message in the shared document of the chat (jupyterlab-chat), instead of a static dictionary structure.
This allows individual messages to be updated without updating the entire message list.

Code change

  • use ymap in the shared document, backend and frontend side.
  • handle change of individual message in the frontend, to update only the relevant message in the model.
  • create a new Message object, implement a new IMessage interface. This new object includes, in addition to the messages content (body, time, sender...), a signal emitting when it has been updated.
    The react component associated to this message only renders when the message is updated.

@github-actions
Copy link
Contributor

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

@brichet brichet added the enhancement New feature or request label Oct 22, 2025
@brichet brichet marked this pull request as ready for review October 28, 2025 12:28
@brichet
Copy link
Collaborator Author

brichet commented Oct 28, 2025

I think this PR is ready for review. I tested it successfully with message edition from the frontend and the backend (with jupyter-ai).

@brichet
Copy link
Collaborator Author

brichet commented Oct 28, 2025

A follow up PR will refactor a little bit he frontend/react to avoid updating all the messages when a message is added or remove from the list. I didn't want to push these changes in this PR because it is not directly related to using ymap in the shared document.

@brichet brichet changed the title Message as ymap Message as ymap in shared document Oct 28, 2025
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

Status: No status

Development

Successfully merging this pull request may close these issues.

Message as YMap in jupyterlab-chat

1 participant