Skip to content

Display chat users #92

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/jupyterlab-chat/package.json
Original file line number Diff line number Diff line change
@@ -52,8 +52,8 @@
},
"dependencies": {
"@jupyter/chat": "^0.5.0",
"@jupyter/docprovider": "^2.1.4",
"@jupyter/ydoc": "^1.1.1",
"@jupyter/docprovider": "^2.1.5",
"@jupyter/ydoc": "^2.1.3",
"@jupyterlab/application": "^4.2.0",
"@jupyterlab/apputils": "^4.3.0",
"@jupyterlab/coreutils": "^6.2.0",
10 changes: 10 additions & 0 deletions packages/jupyterlab-chat/src/ychat.ts
Original file line number Diff line number Diff line change
@@ -137,6 +137,16 @@ export class YChat extends YDocument<IChatChanges> {
});
}

getMetadata(key: string): IMetadata | undefined {
return this._metadata.get(key);
}

setMetadata(key: string, value: PartialJSONValue) {
this.transact(() => {
this._metadata.set(key, value);
});
}

private _usersObserver = (event: Y.YMapEvent<IUser>): void => {
const userChange = new Array<UserChange>();
event.keysChanged.forEach(key => {
2 changes: 1 addition & 1 deletion python/jupyterlab-chat/jupyterlab_chat/ychat.py
Original file line number Diff line number Diff line change
@@ -149,7 +149,7 @@ def get_metadata(self) -> dict[str, dict]:
"""
return self._ymetadata.to_py()

def set_metadata(self, name: str, metadata: dict):
def set_metadata(self, name: str, metadata: Any):
"""
Adds or modifies a metadata of the document.
"""
5 changes: 3 additions & 2 deletions python/jupyterlab-chat/package.json
Original file line number Diff line number Diff line change
@@ -57,8 +57,9 @@
"watch:labextension": "jupyter labextension watch ."
},
"dependencies": {
"@jupyter/docprovider": "^2.1.4",
"@jupyter/ydoc": "^1.1.1",
"@jupyter/collaboration": "^2.1.5",
"@jupyter/docprovider": "^2.1.5",
"@jupyter/ydoc": "^2.1.3",
"@jupyterlab/application": "^4.2.0",
"@jupyterlab/apputils": "^4.3.0",
"@jupyterlab/coreutils": "^6.2.0",
4 changes: 3 additions & 1 deletion python/jupyterlab-chat/schema/chat-panel.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,9 @@
{
"name": "markAsRead",
"command": "jupyterlab-chat:markAsRead"
}
},
{ "name": "spacer", "type": "spacer", "rank": 100 },
{ "name": "usersItem", "rank": 150 }
]
},
"properties": {},
6 changes: 6 additions & 0 deletions python/jupyterlab-chat/src/index.ts
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ import {
chatIcon,
readIcon
} from '@jupyter/chat';
import { UsersItem } from '@jupyter/collaboration';
import {
ICollaborativeDrive,
SharedDocumentFactory
@@ -212,6 +213,11 @@ const docFactories: JupyterFrontEndPlugin<IChatFactory> = {
pluginIds.docFactories,
translator
);
toolbarRegistry.addFactory<CollaborativeChatPanel>(
FACTORY,
'usersItem',
panel => UsersItem.createWidget({ model: panel.model })
);
}

// Wait for the application to be restored and
1 change: 1 addition & 0 deletions python/jupyterlab-chat/style/base.css
Original file line number Diff line number Diff line change
@@ -10,3 +10,4 @@
*/

@import url('~jupyterlab-chat/style/index.css');
@import url('@jupyter/collaboration/style/index.css');