Skip to content

Conversation

brichet
Copy link
Contributor

@brichet brichet commented May 6, 2025

This PR allows the user to update its attributes name, display_name, initials, color and avatar_url.

The updatable fields are send by the server, starting from jupyter-server/jupyter_server#1518.

It is backward compatible, the fields will not be updatable if the property is not provided by the server.

record-2025-05-07_07.58.20.webm

Fixes:

TODO

@brichet brichet added the enhancement New feature or request label May 6, 2025
Copy link
Contributor

github-actions bot commented May 6, 2025

Binder 👈 Launch a Binder on branch brichet/jupyter_collaboration/update_user_info

@brichet brichet marked this pull request as ready for review May 6, 2025 20:38
justify-content: space-between;
}

.jp-UserInfo-Field > * {
Copy link
Member

Choose a reason for hiding this comment

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

Can the * be replaced with a more precise selector? * has negative performance implications as every DOM element will be evaluated against the path.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated it with the expected tags.

body: new UserDetailsBody({
userManager: this._userManager
}),
title: 'User Details'
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to translate this title and the error message below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, the widget now receive an IRenderMime.TranslationBundle.
I don't know if this is the way to do it, or if it better to share the ITranslator token.

@brichet brichet force-pushed the update_user_info branch from bd8b942 to 4b05a25 Compare May 26, 2025 14:14
super();
this._user = user;
this._userManager = props.userManager;
this._translation = props.translation;
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be named _trans:

Suggested change
this._translation = props.translation;
this._trans = props.translation;

Because it gets extracted using very simple static analysis, see https://jupyterlab.readthedocs.io/en/latest/extension/internationalization.html#rules

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I didn't know about that, I'll try to remember it.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I just gave an example suggestion, it needs to be renamed in a few more places.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean renaming also the property name in the options ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I renamed it anyway for better readability, but I thought the name was required when using it only.

Copy link
Member

Choose a reason for hiding this comment

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

but I thought the name was required when using it only.

Yes, that's correct. My bad I misread the extend of changes in your previous commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😄 took me 5 min reading again, to be sure I was not missing something again.

@krassowski
Copy link
Member

Restarting CI after jupyter-core 5.8.1 release

@krassowski krassowski closed this May 27, 2025
@krassowski krassowski reopened this May 27, 2025
@krassowski krassowski merged commit 602746c into jupyterlab:main May 27, 2025
47 of 52 checks passed
@brichet brichet deleted the update_user_info branch May 27, 2025 09:35
@brichet
Copy link
Contributor Author

brichet commented May 27, 2025

Thanks for the review @krassowski and @davidbrochart

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.

3 participants